gcc/gcc/tree-vect-stmts.c

9696 lines
299 KiB
C
Raw Normal View History

tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Statement Analysis and Transformation for Vectorization
Copyright (C) 2003-2017 Free Software Foundation, Inc.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
Contributed by Dorit Naishlos <dorit@il.ibm.com>
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
and Ira Rosen <irar@il.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/>. */
#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 "target.h"
#include "rtl.h"
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02: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"
#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 "optabs-tree.h"
#include "insn-config.h"
#include "recog.h" /* FIXME: for insn_data */
#include "cgraph.h"
#include "dumpfile.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 "alias.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"
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"
gimple.h: Remove all includes. * gimple.h: Remove all includes. (recalculate_side_effects): Move prototype to gimplify.h. * Makefile.in (PLUGIN_HEADERS): Add flattened gimple.h includes. * gengtype.c (open_base_files): Add gimple.h include list. * gimplify.h (recalculate_side_effects): Relocate prototype here. * gimple.c: Adjust include list. (recalculate_side_effects): Move to gimplify.c. * gimplify.c: Adjust include list. (recalculate_side_effects): Relocate from gimple.c. * alias.c: Add required include files removed from gimple.h. * asan.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraphbuild.c: Likewise. * cgraph.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * data-streamer.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * dse.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * graphite-blocking.c: Likewise. * graphite.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * ipa.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * symtab.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * varpool.c: Likewise. * var-tracking.c: Likewise. * vtable-verify.c: Likewise. * ada/gcc-interface/trans.c: Add required include files from gimple.h. * c/c-typeck.c: Add required include files from gimple.h. * c-family/c-common.c: Add required include files from gimple.h. * c-family/c-gimplify.c: Likewise * c-family/cilk.c: Likewise * cp/class.c: Add required include files from gimple.h. * cp/cp-gimplify.c: Likewise * cp/decl2.c: Likewise * cp/init.c: Likewise * cp/optimize.c: Likewise * cp/pt.c: Likewise * cp/semantics.c: Likewise * cp/tree.c: Likewise * cp/typeck.c: Likewise * cp/vtable-class-hierarchy.c: Likewise * fortran/trans.c: Add required include files from gimple.h. * fortran/trans-expr.c: Likewise * fortran/trans-openmp.c: Likewise * go/gofrontend/expressions.cc: Add required include files from gimple.h. * go/gofrontend/gogo-tree.cc: Likewise * go/gofrontend/types.cc: Likewise * go/go-gcc.cc: Likewise * go/go-lang.c: Likewise * java/java-gimplify.c: Add required include files from gimple.h. * lto/lto.c: Add required include files from gimple.h. * lto/lto-lang.c: Likewise * lto/lto-object.c: Likewise * lto/lto-partition.c: Likewise * lto/lto-symtab.c: Likewise * objc/objc-act.c: Add required include files from gimple.h. * config/darwin.c: Add required include files removed from gimple.h. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/alpha/alpha.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64.c: Likewise. * config/m32c/m32c.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/xtensa/xtensa.c: Likewise. * testsuite/gcc.dg/plugin/finish_unit_plugin.c: Add required include files removed from gimple.h. * testsuite/gcc.dg/plugin/ggcplug.c: Likewise. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/gcc.dg/plugin/selfassign.c: Likewise. * testsuite/gcc.dg/plugin/start_unit_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. From-SVN: r205272
2013-11-22 16:58:51 +01:00
#include "tree-eh.h"
gimple-expr.h (create_tmp_var_name, [...]): Relocate prototypes from gimple.h. 2013-11-12 Andrew MacLeod <amacleod@redhat.com> * gimple-expr.h (create_tmp_var_name, create_tmp_var_raw, create_tmp_var, create_tmp_reg, mark_addressable, is_gimple_reg_rhs): Relocate prototypes from gimple.h. * gimplify.h: New File. Relocate some prototypes from gimple.h here. (gimple_predicate, enum fallback, enum gimplify_status): Relocate from gimple.h. * gimple.h: Move some prototypes to gimplify.h. (gimple_predicate, enum fallback, enum gimplify_status): Move to gimplify.h. (gimple_do_not_emit_location_p, gimple_set_do_not_emit_location): Relocate from gimpify.c. * gimple-expr.c (remove_suffix, tmp_var_id_num, create_tmp_var_name, create_tmp_var_raw, create_tmp_var, create_tmp_reg, mark_addressable, is_gimple_reg_rhs) Relocate from gimplify.c. * gimplify.c (mark_addressable): Move to gimple-expr.c. (gimple_seq_add_stmt_without_update): Move to gimple.c. (remove_suffix, tmp_var_id_num, create_tmp_var_name, create_tmp_var_raw, create_tmp_var, create_tmp_reg, is_gimple_reg_rhs): Move to gimple-expr.c. (should_carry_location_p): Move to gimple.c. (gimple_do_not_emit_location_p, gimple_set_do_not_emit_location): Move to gimple.h. (annotate_one_with_location, annotate_all_with_location_after, annotate_all_with_location): Move to gimple.c. (compare_case_labels, sort_case_labels, preprocess_case_label_vec_for_gimple): Move to gimple.c. (rhs_predicate_for): Make static. (gimplify_assign): Relocate from gimple.c. * gimple.c (gimplify_assign): Move to gimplify.c. (gimple_seq_add_stmt_without_update, should_carry_location_p, annotate_one_with_location, annotate_all_with_location_after, annotate_all_with_location, compare_case_labels, sort_case_labels, preprocess_case_label_vec_for_gimple): Relocate from gimplify.c. * tree.h (unshare_expr, unshare_expr_without_location, mark_addressable): Move prototypes to gimplify.h. * Makefile.in (GTFILES): gimple-expr.c now has the GTY tag for tmp_var_id_num * asan.c: Include gimplify.h rather than gimple.h. * cfgloopmanip.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * dwarf2out.c: Dont include gimple.h. * fold-const.c: Include gimplify.h rather than gimple.h. * function.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-sese-to-poly.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa.c: Likewise. * langhooks.c: Dont include gimple.h. * loop-init.c: Include gimplify.h rather than gimple.h. * omp-low.c: Likewise. * sese.c: Likewise. * stor-layout.c: Likewise. * targhooks.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-complex.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversio: Likewise.n.c * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * config/aarch64/aarch64.c: Include gimplify.h instead of gimple.h. * config/alpha/alpha.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/xtensa/xtensa.c: Likewise. * ada/gcc-interface/trans.c: Include gimplify.h. * c/c-typeck.c: Include gimplify.h. * c-family/c-common.c: Include gimplify.h. * c-family/c-gimplify.c: Likewise. * c-family/cilk.c: Likewise. * c-family/c-omp.c: Include gimple-expr.h instead of gimple.h. * c-family/c-ubsan.c: Don't include gimple.h. * cp/class.c: Include gimplify.h. * cp/cp-gimplify.c: Likewise. * cp/error.c: Likewise. * cp/init.c: Likewise. * cp/optimize.c: Likewise. * cp/pt.c: Likewise. * cp/semantics.c: Likewise. * cp/tree.c: Likewise. * cp/vtable-class-hierarchy.c: Likewise. * cp/decl2.c: Don't include gimple.h. * cp/except.c: Likewise. * cp/method.c: Include pointer-set.h instead of gimple.h. * fortran/f95-lang.c: Don't include gimple.h. * fortran/trans-array.c: Include gimple-expr.h instead of gimple.h. * fortran/trans.c: Likewise. * fortran/trans-decl.c: Likewise. * fortran/trans-expr.c: Include gimplify.h. * fortran/trans-openmp.c: Likewise. * go/go-lang.c: Include gimplify.h. * java/java-gimplify.c: Include gimplify.h. * objc/objc-act.c: Include gimplify.h. From-SVN: r204717
2013-11-12 21:26:43 +01:00
#include "gimplify.h"
gimple-walk.h: New File. * gimple-walk.h: New File. Relocate prototypes from gimple.h. (struct walk_stmt_info): Relocate here from gimple.h. * gimple-iterator.h: New File. Relocate prototypes from gimple.h. (struct gimple_stmt_iterator_d): Relocate here from gimple.h. (gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb, gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt, gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug, gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb, gsi_last_nondebug_bb, gsi_bb, gsi_seq): Relocate here from gimple.h. * gimple.h (struct gimple_stmt_iterator_d): Move to gimple-iterator.h. (gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb, gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt, gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug, gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb, gsi_last_nondebug_bb, gsi_bb, gsi_seq): Move to gimple-iterator.h. (struct walk_stmt_info): Move to gimple-walk.h. (gimple_seq_set_location): Move to gimple.c * gimple-walk.c: New File. (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op, walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Relocate here from gimple.c. * gimple-iterator.c: Include gimple-iterator.h. * gimple.c (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op, walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Move to gimple-walk.c. (gimple_seq_set_location): Relocate from gimple.h. * tree-phinodes.h (set_phi_nodes): Move to tree-phinodes.c. * tree-phinodes.c (set_phi_nodes): Relocate from tree-phinodes.h. * gengtype.c (open_base_files): Add gimple-iterator.h to include list. * Makefile.in (OBJS): Add gimple-walk.o * asan.c: Update Include list as required for gimple-iterator.h and gimple-walk.h. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * vtable-verify.c: Likewise. * config/aarch64/aarch64-builtins.c: Include gimple-iterator.h. * config/rs6000/rs6000.c: Include gimple-iterator.h and gimple-walk.h. * testsuite/g++.dg/plugin/selfassign.c: Include gimple-iterator.h. * testsuite/gcc.dg/plugin/selfassign.c: Likewise. From-SVN: r204763
2013-11-14 00:54:17 +01:00
#include "gimple-iterator.h"
gimplify-be.h: New file. * gimplify-be.h: New file. Add prototypes. * gimplify.h: Don't include gimple.h. (struct gimplify_hasher, struct gimplify_ctx, is_gimple_sizepos, gimplify_hasher::hash, gimplify_hasher::equal): Relocate from gimple.h. * gimple.h (struct gimplify_hasher, gimplify_hasher::hash, gimplify_hasher::equal, struct gimplify_ctx, is_gimple_sizepos): Move to gimplify.h. (enum gsi_iterator_update): Move to gimple-iterator.h. * gimple-iterator.h (enum gsi_iterator_update): Relocate from gimple.h. * gimplify-be.c: New File. (force_gimple_operand_1, force_gimple_operand, force_gimple_operand_gsi_1, force_gimple_operand_gsi): Relocate from gimplify.c. * gimplify.c (force_gimple_operand_1, force_gimple_operand, force_gimple_operand_gsi_1, force_gimple_operand_gsi): Move to gimplify-be.c. * Makefile.in (OBJS): Add gimplify-be.o * asan.c: Include only gimplify.h, gimplify-be.h, and/or gimple.h as required. * cfgloopmanip.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-sese-to-poly.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa.c: Likewise. * langhooks.c: Likewise. * omp-low.c: Likewise. * sese.c: Likewise. * stor-layout.c: Likewise. * targhooks.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-complex.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/alpha/alpha.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/xtensa/xtensa.c: Likewise. * c/c-typeck.c: Include only gimplify.h and gimple.h as needed. * c-family/c-common.c: Likewise. * c-family/c-gimplify.c: Likewise. * c-family/cilk.c: Likewise. * cp/class.c: Include only gimplify.h and gimple.h as needed. * cp/cp-gimplify.c: Likewise. * cp/error.c: Likewise. * cp/init.c: Likewise. * cp/optimize.c: Likewise. * cp/pt.c: Likewise. * cp/semantics.c: Likewise. * cp/tree.c: Likewise. * cp/vtable-class-hierarchy.c: Likewise. * fortran/trans-expr.c: Include only gimplify.h and gimple.h as needed. * fortran/trans-openmp.c: Likewise. * go/go-lang.c: Include only gimplify.h and gimple.h as needed. * java/java-gimplify.c: Include only gimplify.h and gimple.h as needed. * objc/objc-act.c: Include only gimplify.h and gimple.h as needed. From-SVN: r204812
2013-11-14 20:39:38 +01:00
#include "gimplify-me.h"
tree-ssa.h: Remove all #include's * tree-ssa.h: Remove all #include's * gengtype.c (open_base_files): Adjust include list for gtype-desc.c. * alias.c: Move required includes from tree-ssa.h. * asan.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * dse.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * loop-init.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * omp-low.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * targhooks.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varpool.c: Likewise. * vtable-verify.c: Likewise. From-SVN: r203967
2013-10-23 14:16:58 +02:00
#include "tree-cfg.h"
#include "tree-ssa-loop-manip.h"
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
#include "cfgloop.h"
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
#include "tree-ssa-loop.h"
#include "tree-scalar-evolution.h"
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
#include "tree-vectorizer.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"
#include "internal-fn.h"
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
system.h (dump_file): Do not define. gcc/ * system.h (dump_file): Do not define. * tree-pass.h: Include dumpfile.h, which is a new file containing... (enum tree_dump_index, TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name, dump_file, dump_flags, dump_file_name, get_dump_file_info, struct dump_file_info): all of this, moved to... * dumpfile.h: Here, new file. * tree-dump.h: Include dumpfile.h, but not tree-pass.h. (dump_stmt): Remove prototype for C++ specific function. (dump_enumerated_decls): Move prototype from here... * tree-flow.h (dump_enumerated_decls): ... to here. (get_ref_base_and_extent) Move prototype from here ... * tree.h (get_ref_base_and_extent) ... to here. * tree-ssa-live.c: Do not inclde tree-pretty-print.h, because gimple-pretty-print.h is enough. Do not include tree-dump.h, include timevar.h and dumpfile.h instead. (struct numbered_tree_d, compare_decls_by_uid, dump_enumerated_decls_push, dump_enumerated_decls): Move from here ... * tree-dfa.c:(struct numbered_tree_d, compare_decls_by_uid, dump_enumerated_decls_push, dump_enumerated_decls):... to here. Do not include timevar.h. * tree.c: Do not include timevar.h. * tree-cfg.c: Do not include langhooks.h, tree-pretty-print.h, and timevar.h. (dump_cfg_stats): Use current_function_name. (gimple_cfg2vcg): Likewise. (dump_function_to_file): Likewise. * df-scan.c: Do not include tree-pass.h and timevar.h. Include dumpfile.h. (df_entry_block_bitmap_verify, df_exit_block_bitmap_verify): Do not use print_current_pass. * df-problems.c: Include dumpfile.h. Always define REG_DEAD_DEBUGGING, avoid #ifdef code, because it leads to errors in the code not selected. (df_note_compute): Do not print_rtl_with_bb here. Fix compilation bug if REG_DEAD_DEBUGGING is not 0, get_insns is not available here. * lcm.c: Include dumpfile.h. Remove obsolete include of insn-attr.h. * dojump.c (do_compare_rtx_and_jump): Remove failure printing for missing probability notes. * stmt.c: Include dumpfile.h. (emit_case_decision_tree): Re-enable printing expand details only if TDF_DETAILS. * alias.c, auto-inc-dec.c, bb-reorder.c, caller-save.c, cfg.c, cfgcleanup.c, cfgexpand.c, cfgloop.c, cfgloopmanip.c, cgraph.c, cgraphclones.c, cgraphunit.c, combine.c, combine-stack-adj.c, coverage.c, cprop.c, cse.c, cselib.c, dbgcnt.c, dce.c, df-core.c, dse.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, final.c, function.c, fwprop.c, gcse.c, gimple-fold.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-blocking.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-interchange.c, graphite-optimize-isl.c, graphite-poly.c, graphite-sese-to-poly.c, haifa-sched.c, hw-doloop.c, ifcvt.c, ipa.c, ipa-cp.c, ipa-inline-analysis.c, ipa-inline.c, ipa-inline-transform.c, ipa-prop.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ira.c, ira-emit.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, loop-unroll.c, loop-unswitch.c, lower-subreg.c, lto-section-out.c, lto-streamer-in.c, matrix-reorg.c, mcf.c, mode-switching.c, modulo-sched.c, omega.c, omp-low.c, passes.c, plugin.c, postreload.c, postreload-gcse.c, predict.c, print-rtl.c, print-tree.c, profile.c, recog.c, ree.c, regcprop.c, reginfo.c, regmove.c, regrename.c, reg-stack.c, reload1.c, reorg.c, sched-rgn.c, sched-vis.c, sel-sched.c, sel-sched-ir.c, store-motion.c, tracer.c, trans-mem.c, tree-affine.c, tree-call-cdce.c, tree-cfgcleanup.c, tree-chrec.c, tree-data-ref.c, tree-diagnostic.c, tree-dump.c, tree-eh.c, tree-flow-inline.h, tree-if-conv.c, tree-into-ssa.c, tree-mudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-outof-ssa.c, tree-predcom.c, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa.c, tree-ssa-ccp.c, tree-ssa-coalesce.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.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-propagate.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-sink.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-ter.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vect-loop-manip.c, tree-vectorizer.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, value-prof.c, var-tracking.c, web.c: Include tree-pass.h only if needed. If tree-pass.h is included, do not include timevar.h and dumpfile.h. If tree-pass.h is not included but dump_file, or dump_flags, or the TDF_* flags are used, include dumpfile.h. If gimple-pretty-print.h is included, don't include tree-pretty-print.h. Remove assorted unnecessary includes. * config/mn10300/mn10300.c, config/c6x/c6x.c, config/ia64/ia64.c, config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c, config/spu/spu.c, config/mep/mep.c, config/i386/i386.c: Include dumpfile.h. * config/rl78/rl78.c: Include dumpfile.h instead of tree-pass.h. * arm/t-arm, avr/t-avr, i386/t-i386, ia64/t-ia64, mep/t-mep, spu/t-spu-elf: Fix dependencies. c-family/ * c-gimplify.c: Include dumpfile.h instead of tree-dump.h. * c-ada-spec.c: Likewise. * c-dump.c (dump_stmt): Move to cp/dump.c, the only user. c/ * c-decl.c: Include dumpfile.h instead of tree-dump.h. * Make-lang.in: Fix dependencies. cp/ * dump.c (dump_stmt): Moved here from c-dump.c. * optimize.c: Include dumpfile.h instead of tree-dump.h. * class.c: Likewise. * decl2.c: Likewise. * Make-lang.in: Fix dependencies. fortran/ * f95-lang.c: Include dumpfile.h instead of tree-dump.h. * Make-lang.in: Fix dependencies. java/ * java-gimplify.c Include dumpfile.h instead of tree-dump.h * Make-lang.in: Fix dependencies. lto/ * lto.c: Do not include timevar.h. * Make-lang.in: Fix dependencies. ada/ * gcc-interface/utils.c: Include timevar.h. * Make-lang.in: Fix dependencies. From-SVN: r189519
2012-07-16 13:32:42 +02:00
/* For lang_hooks.types.type_for_mode. */
#include "langhooks.h"
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
/* Says whether a statement is a load, a store of a vectorized statement
result, or a store of an invariant value. */
enum vec_load_store_type {
VLS_LOAD,
VLS_STORE,
VLS_STORE_INVARIANT
};
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
/* Return the vectorized type for the given statement. */
tree
stmt_vectype (struct _stmt_vec_info *stmt_info)
{
return STMT_VINFO_VECTYPE (stmt_info);
}
/* Return TRUE iff the given statement is in an inner loop relative to
the loop being vectorized. */
bool
stmt_in_inner_loop_p (struct _stmt_vec_info *stmt_info)
{
gimple *stmt = STMT_VINFO_STMT (stmt_info);
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
basic_block bb = gimple_bb (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
struct loop* loop;
if (!loop_vinfo)
return false;
loop = LOOP_VINFO_LOOP (loop_vinfo);
return (bb->loop_father == loop->inner);
}
/* Record the cost of a statement, either by directly informing the
target model or by saving it in a vector for later processing.
Return a preliminary estimate of the statement's cost. */
unsigned
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
record_stmt_cost (stmt_vector_for_cost *body_cost_vec, int count,
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
enum vect_cost_for_stmt kind, stmt_vec_info stmt_info,
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
int misalign, enum vect_cost_model_location where)
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
{
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
if (body_cost_vec)
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
{
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
tree vectype = stmt_info ? stmt_vectype (stmt_info) : NULL_TREE;
stmt_info_for_cost si = { count, kind,
stmt_info ? STMT_VINFO_STMT (stmt_info) : NULL,
misalign };
body_cost_vec->safe_push (si);
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
return (unsigned)
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
(builtin_vectorization_cost (kind, vectype, misalign) * count);
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
}
else
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
return add_stmt_cost (stmt_info->vinfo->target_cost_data,
count, kind, stmt_info, misalign, where);
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
}
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* Return a variable of type ELEM_TYPE[NELEMS]. */
static tree
create_vector_array (tree elem_type, unsigned HOST_WIDE_INT nelems)
{
return create_tmp_var (build_array_type_nelts (elem_type, nelems),
"vect_array");
}
/* ARRAY is an array of vectors created by create_vector_array.
Return an SSA_NAME for the vector in index N. The reference
is part of the vectorization of STMT and the vector is associated
with scalar destination SCALAR_DEST. */
static tree
read_vector_array (gimple *stmt, gimple_stmt_iterator *gsi, tree scalar_dest,
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
tree array, unsigned HOST_WIDE_INT n)
{
tree vect_type, vect, vect_name, array_ref;
gimple *new_stmt;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
gcc_assert (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE);
vect_type = TREE_TYPE (TREE_TYPE (array));
vect = vect_create_destination_var (scalar_dest, vect_type);
array_ref = build4 (ARRAY_REF, vect_type, array,
build_int_cst (size_type_node, n),
NULL_TREE, NULL_TREE);
new_stmt = gimple_build_assign (vect, array_ref);
vect_name = make_ssa_name (vect, new_stmt);
gimple_assign_set_lhs (new_stmt, vect_name);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
return vect_name;
}
/* ARRAY is an array of vectors created by create_vector_array.
Emit code to store SSA_NAME VECT in index N of the array.
The store is part of the vectorization of STMT. */
static void
write_vector_array (gimple *stmt, gimple_stmt_iterator *gsi, tree vect,
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
tree array, unsigned HOST_WIDE_INT n)
{
tree array_ref;
gimple *new_stmt;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
array_ref = build4 (ARRAY_REF, TREE_TYPE (vect), array,
build_int_cst (size_type_node, n),
NULL_TREE, NULL_TREE);
new_stmt = gimple_build_assign (array_ref, vect);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
}
/* PTR is a pointer to an array of type TYPE. Return a representation
of *PTR. The memory reference replaces those in FIRST_DR
(and its group). */
static tree
create_array_ref (tree type, tree ptr, tree alias_ptr_type)
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
{
tree mem_ref;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
mem_ref = build2 (MEM_REF, type, ptr, build_int_cst (alias_ptr_type, 0));
/* Arrays have the same alignment as their type. */
builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte... 2012-05-03 Martin Jambor <mjambor@suse.cz> * builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_pointer_alignment_1 for dereference alignment. (get_pointer_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_ptr_info_alignment to get SSA name alignment. (get_object_alignment): Update call to get_object_alignment_1. (get_object_or_type_alignment): Likewise, fall back to type alignment only when it returned false. (get_pointer_alignment): Update call to get_pointer_alignment_1. * fold-const.c (get_pointer_modulus_and_residue): Update call to get_object_alignment_1. * ipa-prop.c (ipa_modify_call_arguments): Update call to get_pointer_alignment_1. * tree-sra.c (build_ref_for_offset): Likewise, fall back to the type of MEM_REF or TARGET_MEM_REF only when it returns false. * tree-ssa-ccp.c (get_value_from_alignment): Update call to get_object_alignment_1. (ccp_finalize): Use set_ptr_info_alignment. * tree.h (get_object_alignment_1): Update declaration. (get_pointer_alignment_1): Likewise. * gimple-pretty-print.c (dump_gimple_phi): Use get_ptr_info_alignment. (dump_gimple_stmt): Likewise. * tree-flow.h (ptr_info_def): Updated comments of fields align and misalign. (get_ptr_info_alignment): Declared. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. * tree-ssa-address.c (copy_ref_info): Use new access functions to get and set alignment of SSA names. * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Call mark_ptr_info_alignment_unknown. * tree-ssanames.c (get_ptr_info_alignment): New function. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. (get_ptr_info): Call mark_ptr_info_alignment_unknown. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Likewise. (bump_vector_ptr): Likewise. * tree-vect-stmts.c (create_array_ref): Use set_ptr_info_alignment. (vectorizable_store): Likewise. (vectorizable_load): Likewise. From-SVN: r187101
2012-05-03 17:48:56 +02:00
set_ptr_info_alignment (get_ptr_info (ptr), TYPE_ALIGN_UNIT (type), 0);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
return mem_ref;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Utility functions used by vect_mark_stmts_to_be_vectorized. */
/* Function vect_mark_relevant.
Mark STMT as "relevant for vectorization" and add it to WORKLIST. */
static void
vect_mark_relevant (vec<gimple *> *worklist, gimple *stmt,
enum vect_relevant relevant, bool live_p)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
enum vect_relevant save_relevant = STMT_VINFO_RELEVANT (stmt_info);
bool save_live_p = STMT_VINFO_LIVE_P (stmt_info);
gimple *pattern_stmt;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (dump_enabled_p ())
{
dump_printf_loc (MSG_NOTE, vect_location,
"mark relevant %d, live %d: ", relevant, live_p);
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* If this stmt is an original stmt in a pattern, we might need to mark its
related pattern stmt instead of the original stmt. However, such stmts
may have their own uses that are not in any pattern, in such cases the
stmt itself should be marked. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (STMT_VINFO_IN_PATTERN_P (stmt_info))
{
/* This is the last stmt in a sequence that was detected as a
pattern that can potentially be vectorized. Don't mark the stmt
as relevant/live because it's not going to be vectorized.
Instead mark the pattern-stmt that replaces it. */
pattern_stmt = STMT_VINFO_RELATED_STMT (stmt_info);
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location,
"last stmt in pattern. don't mark"
" relevant/live.\n");
stmt_info = vinfo_for_stmt (pattern_stmt);
gcc_assert (STMT_VINFO_RELATED_STMT (stmt_info) == stmt);
save_relevant = STMT_VINFO_RELEVANT (stmt_info);
save_live_p = STMT_VINFO_LIVE_P (stmt_info);
stmt = pattern_stmt;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
STMT_VINFO_LIVE_P (stmt_info) |= live_p;
if (relevant > STMT_VINFO_RELEVANT (stmt_info))
STMT_VINFO_RELEVANT (stmt_info) = relevant;
if (STMT_VINFO_RELEVANT (stmt_info) == save_relevant
&& STMT_VINFO_LIVE_P (stmt_info) == save_live_p)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"already marked relevant/live.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return;
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
worklist->safe_push (stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* Function is_simple_and_all_uses_invariant
Return true if STMT is simple and all uses of it are invariant. */
bool
is_simple_and_all_uses_invariant (gimple *stmt, loop_vec_info loop_vinfo)
{
tree op;
gimple *def_stmt;
ssa_op_iter iter;
if (!is_gimple_assign (stmt))
return false;
FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
{
enum vect_def_type dt = vect_uninitialized_def;
if (!vect_is_simple_use (op, loop_vinfo, &def_stmt, &dt))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"use not simple.\n");
return false;
}
if (dt != vect_external_def && dt != vect_constant_def)
return false;
}
return true;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function vect_stmt_relevant_p.
Return true if STMT in loop that is represented by LOOP_VINFO is
"relevant for vectorization".
A stmt is considered "relevant for vectorization" if:
- it has uses outside the loop.
- it has vdefs (it alters memory).
- control stmts in the loop (except for the exit condition).
CHECKME: what other side effects would the vectorizer allow? */
static bool
vect_stmt_relevant_p (gimple *stmt, loop_vec_info loop_vinfo,
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum vect_relevant *relevant, bool *live_p)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
ssa_op_iter op_iter;
imm_use_iterator imm_iter;
use_operand_p use_p;
def_operand_p def_p;
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
*relevant = vect_unused_in_scope;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
*live_p = false;
/* cond stmt other than loop exit cond. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (is_ctrl_stmt (stmt)
&& STMT_VINFO_TYPE (vinfo_for_stmt (stmt))
!= loop_exit_ctrl_vec_info_type)
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
*relevant = vect_used_in_scope;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* changing memory. */
if (gimple_code (stmt) != GIMPLE_PHI)
if (gimple_vdef (stmt)
&& !gimple_clobber_p (stmt))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"vec_stmt_relevant_p: stmt has vdefs.\n");
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
*relevant = vect_used_in_scope;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* uses outside the loop. */
FOR_EACH_PHI_OR_STMT_DEF (def_p, stmt, op_iter, SSA_OP_DEF)
{
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, DEF_FROM_PTR (def_p))
{
basic_block bb = gimple_bb (USE_STMT (use_p));
if (!flow_bb_inside_loop_p (loop, bb))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"vec_stmt_relevant_p: used out of loop.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (is_gimple_debug (USE_STMT (use_p)))
continue;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* We expect all such uses to be in the loop exit phis
(because of loop closed form) */
gcc_assert (gimple_code (USE_STMT (use_p)) == GIMPLE_PHI);
gcc_assert (bb == single_exit (loop)->dest);
*live_p = true;
}
}
}
if (*live_p && *relevant == vect_unused_in_scope
&& !is_simple_and_all_uses_invariant (stmt, loop_vinfo))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location,
"vec_stmt_relevant_p: stmt live but not relevant.\n");
*relevant = vect_used_only_live;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return (*live_p || *relevant);
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Function exist_non_indexing_operands_for_use_p
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
USE is one of the uses attached to STMT. Check if USE is
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
used in STMT for anything other than indexing an array. */
static bool
exist_non_indexing_operands_for_use_p (tree use, gimple *stmt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree operand;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
/* USE corresponds to some operand in STMT. If there is no data
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
reference in STMT, then any operand that corresponds to USE
is not indexing an array. */
if (!STMT_VINFO_DATA_REF (stmt_info))
return true;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* STMT has a data_ref. FORNOW this means that its of one of
the following forms:
-1- ARRAY_REF = var
-2- var = ARRAY_REF
(This should have been verified in analyze_data_refs).
'var' in the second case corresponds to a def, not a use,
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
so USE cannot correspond to any operands that are not used
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
for array indexing.
Therefore, all we need to check is if STMT falls into the
first case, and whether var corresponds to USE. */
if (!gimple_assign_copy_p (stmt))
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
{
if (is_gimple_call (stmt)
&& gimple_call_internal_p (stmt))
switch (gimple_call_internal_fn (stmt))
{
case IFN_MASK_STORE:
operand = gimple_call_arg (stmt, 3);
if (operand == use)
return true;
/* FALLTHRU */
case IFN_MASK_LOAD:
operand = gimple_call_arg (stmt, 2);
if (operand == use)
return true;
break;
default:
break;
}
return false;
}
if (TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME)
return false;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
operand = gimple_assign_rhs1 (stmt);
if (TREE_CODE (operand) != SSA_NAME)
return false;
if (operand == use)
return true;
return false;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/*
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Function process_use.
Inputs:
- a USE in STMT in a loop represented by LOOP_VINFO
- RELEVANT - enum value to be set in the STMT_VINFO of the stmt
that defined USE. This is done by calling mark_relevant and passing it
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
the WORKLIST (to add DEF_STMT to the WORKLIST in case it is relevant).
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
- FORCE is true if exist_non_indexing_operands_for_use_p check shouldn't
be performed.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Outputs:
Generally, LIVE_P and RELEVANT are used to define the liveness and
relevance info of the DEF_STMT of this USE:
STMT_VINFO_LIVE_P (DEF_STMT_info) <-- live_p
STMT_VINFO_RELEVANT (DEF_STMT_info) <-- relevant
Exceptions:
- case 1: If USE is used only for address computations (e.g. array indexing),
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
which does not need to be directly vectorized, then the liveness/relevance
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
of the respective DEF_STMT is left unchanged.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
- case 2: If STMT is a reduction phi and DEF_STMT is a reduction stmt, we
skip DEF_STMT cause it had already been processed.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
- case 3: If DEF_STMT and STMT are in different nests, then "relevant" will
be modified accordingly.
Return true if everything is as expected. Return false otherwise. */
static bool
process_use (gimple *stmt, tree use, loop_vec_info loop_vinfo,
enum vect_relevant relevant, vec<gimple *> *worklist,
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
bool force)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
stmt_vec_info dstmt_vinfo;
basic_block bb, def_bb;
gimple *def_stmt;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum vect_def_type dt;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* case 1: we are only interested in uses that need to be vectorized. Uses
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
that are used for address computation are not considered relevant. */
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
if (!force && !exist_non_indexing_operands_for_use_p (use, stmt))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
if (!vect_is_simple_use (use, loop_vinfo, &def_stmt, &dt))
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"not vectorized: unsupported use in stmt.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
if (!def_stmt || gimple_nop_p (def_stmt))
return true;
def_bb = gimple_bb (def_stmt);
if (!flow_bb_inside_loop_p (loop, def_bb))
{
if (dump_enabled_p ())
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf_loc (MSG_NOTE, vect_location, "def_stmt is out of loop.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* case 2: A reduction phi (STMT) defined by a reduction stmt (DEF_STMT).
DEF_STMT must have already been processed, because this should be the
only way that STMT, which is a reduction-phi, was put in the worklist,
as there should be no other uses for DEF_STMT in the loop. So we just
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
check that everything is as expected, and we are done. */
dstmt_vinfo = vinfo_for_stmt (def_stmt);
bb = gimple_bb (stmt);
if (gimple_code (stmt) == GIMPLE_PHI
&& STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def
&& gimple_code (def_stmt) != GIMPLE_PHI
&& STMT_VINFO_DEF_TYPE (dstmt_vinfo) == vect_reduction_def
&& bb->loop_father == def_bb->loop_father)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"reduc-stmt defining reduc-phi in the same nest.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (STMT_VINFO_IN_PATTERN_P (dstmt_vinfo))
dstmt_vinfo = vinfo_for_stmt (STMT_VINFO_RELATED_STMT (dstmt_vinfo));
gcc_assert (STMT_VINFO_RELEVANT (dstmt_vinfo) < vect_used_by_reduction);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
gcc_assert (STMT_VINFO_LIVE_P (dstmt_vinfo)
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
|| STMT_VINFO_RELEVANT (dstmt_vinfo) > vect_unused_in_scope);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
/* case 3a: outer-loop stmt defining an inner-loop stmt:
outer-loop-header-bb:
d = def_stmt
inner-loop:
stmt # use (d)
outer-loop-tail-bb:
... */
if (flow_loop_nested_p (def_bb->loop_father, bb->loop_father))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"outer-loop def-stmt defining inner-loop stmt.\n");
2009-06-16 09:21:12 +02:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
switch (relevant)
{
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
case vect_unused_in_scope:
2009-06-16 09:21:12 +02:00
relevant = (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_nested_cycle) ?
vect_used_in_scope : vect_unused_in_scope;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
2009-06-16 09:21:12 +02:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
case vect_used_in_outer_by_reduction:
2009-06-16 09:21:12 +02:00
gcc_assert (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_reduction_def);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
relevant = vect_used_by_reduction;
break;
2009-06-16 09:21:12 +02:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
case vect_used_in_outer:
2009-06-16 09:21:12 +02:00
gcc_assert (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_reduction_def);
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
relevant = vect_used_in_scope;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
2009-06-16 09:21:12 +02:00
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
case vect_used_in_scope:
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
default:
gcc_unreachable ();
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* case 3b: inner-loop stmt defining an outer-loop stmt:
outer-loop-header-bb:
...
inner-loop:
d = def_stmt
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
outer-loop-tail-bb (or outer-loop-exit-bb in double reduction):
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt # use (d) */
else if (flow_loop_nested_p (bb->loop_father, def_bb->loop_father))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"inner-loop def-stmt defining outer-loop stmt.\n");
2009-06-16 09:21:12 +02:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
switch (relevant)
{
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
case vect_unused_in_scope:
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
relevant = (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
|| STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_double_reduction_def) ?
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
vect_used_in_outer_by_reduction : vect_unused_in_scope;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
case vect_used_by_reduction:
case vect_used_only_live:
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
relevant = vect_used_in_outer_by_reduction;
break;
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
case vect_used_in_scope:
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
relevant = vect_used_in_outer;
break;
default:
gcc_unreachable ();
}
}
vect_mark_relevant (worklist, def_stmt, relevant, false);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
/* Function vect_mark_stmts_to_be_vectorized.
Not all stmts in the loop need to be vectorized. For example:
for i...
for j...
1. T0 = i + j
2. T1 = a[T0]
3. j = j + 1
Stmt 1 and 3 do not need to be vectorized, because loop control and
addressing of vectorized data-refs are handled differently.
This pass detects such stmts. */
bool
vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
unsigned int nbbs = loop->num_nodes;
gimple_stmt_iterator si;
gimple *stmt;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
unsigned int i;
stmt_vec_info stmt_vinfo;
basic_block bb;
gimple *phi;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
bool live_p;
enum vect_relevant relevant;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"=== vect_mark_stmts_to_be_vectorized ===\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
auto_vec<gimple *, 64> worklist;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* 1. Init worklist. */
for (i = 0; i < nbbs; i++)
{
bb = bbs[i];
for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
{
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
phi = gsi_stmt (si);
if (dump_enabled_p ())
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location, "init: phi relevant? ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
if (vect_stmt_relevant_p (phi, loop_vinfo, &relevant, &live_p))
vect_mark_relevant (&worklist, phi, relevant, live_p);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
stmt = gsi_stmt (si);
if (dump_enabled_p ())
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location, "init: stmt relevant? ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (vect_stmt_relevant_p (stmt, loop_vinfo, &relevant, &live_p))
vect_mark_relevant (&worklist, stmt, relevant, live_p);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
}
/* 2. Process_worklist */
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
while (worklist.length () > 0)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
use_operand_p use_p;
ssa_op_iter iter;
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
stmt = worklist.pop ();
if (dump_enabled_p ())
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location, "worklist: examine stmt: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Examine the USEs of STMT. For each USE, mark the stmt that defines it
(DEF_STMT) as relevant/irrelevant according to the relevance property
of STMT. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt_vinfo = vinfo_for_stmt (stmt);
relevant = STMT_VINFO_RELEVANT (stmt_vinfo);
/* Generally, the relevance property of STMT (in STMT_VINFO_RELEVANT) is
propagated as is to the DEF_STMTs of its USEs.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
One exception is when STMT has been identified as defining a reduction
variable; in this case we set the relevance to vect_used_by_reduction.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
This is because we distinguish between two kinds of relevant stmts -
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
those that are used by a reduction computation, and those that are
(also) used by a regular computation. This allows us later on to
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
identify stmts that are used solely by a reduction, and therefore the
2009-06-16 09:21:12 +02:00
order of the results that they produce does not have to be kept. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
switch (STMT_VINFO_DEF_TYPE (stmt_vinfo))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
case vect_reduction_def:
gcc_assert (relevant != vect_unused_in_scope);
if (relevant != vect_unused_in_scope
&& relevant != vect_used_in_scope
&& relevant != vect_used_by_reduction
&& relevant != vect_used_only_live)
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"unsupported use of reduction.\n");
return false;
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
}
break;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
case vect_nested_cycle:
if (relevant != vect_unused_in_scope
&& relevant != vect_used_in_outer_by_reduction
&& relevant != vect_used_in_outer)
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"unsupported use of nested cycle.\n");
2009-06-16 09:21:12 +02:00
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
return false;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
break;
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
case vect_double_reduction_def:
if (relevant != vect_unused_in_scope
&& relevant != vect_used_by_reduction
&& relevant != vect_used_only_live)
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"unsupported use of double reduction.\n");
2009-06-16 09:21:12 +02:00
return false;
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
break;
2009-06-16 09:21:12 +02:00
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
default:
break;
2009-06-16 09:21:12 +02:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
if (is_pattern_stmt_p (stmt_vinfo))
{
/* Pattern statements are not inserted into the code, so
FOR_EACH_PHI_OR_STMT_USE optimizes their operands out, and we
have to scan the RHS or function arguments instead. */
if (is_gimple_assign (stmt))
{
enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
tree op = gimple_assign_rhs1 (stmt);
i = 1;
if (rhs_code == COND_EXPR && COMPARISON_CLASS_P (op))
{
if (!process_use (stmt, TREE_OPERAND (op, 0), loop_vinfo,
relevant, &worklist, false)
|| !process_use (stmt, TREE_OPERAND (op, 1), loop_vinfo,
relevant, &worklist, false))
return false;
i = 2;
}
for (; i < gimple_num_ops (stmt); i++)
{
op = gimple_op (stmt, i);
if (TREE_CODE (op) == SSA_NAME
&& !process_use (stmt, op, loop_vinfo, relevant,
&worklist, false))
Replace some heap vectors with stack vectors. From http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02735.html This patch is pretty dull, it just replaces a bunch of things of the form vec<T> x; x.create (N); // N is a constant blah blah x.release (); by stack_vec<T, N> x; blah blah 2013-11-01 Trevor Saunders <tsaunders@mozilla.com> gcc/ * function.c (reorder_blocks): Convert block_stack to a stack_vec. * gimplify.c (gimplify_compound_lval): Likewise. * graphite-clast-to-gimple.c (gloog): Likewise. * graphite-dependences.c (loop_is_parallel_p): Likewise. * graphite-scop-detection.c (scopdet_basic_block_info): Likewise. (limit_scop); Likewise. (build_scops): Likewise. (dot_scop): Likewise. * graphite-sese-to-poly.c (sese_dom_walker): Likewise. (build_scop_drs): Likewise. (insert_stmts): Likewise. (insert_out_of_ssa_copy): Likewise. (remove_phi): Likewise. (rewrite_commutative_reductions_out_of_ssa_close_phi): Likewise. * hw-doloop.c (discover_loop): Likewise. * tree-call-cdce.c (shrink_wrap_one_built_in_call): Likewise. * tree-dfa.c (dump_enumerated_decls): Likewise. * tree-if-conv.c (if_convertable_loop_p): Likewise. * tree-inline.c (tree_function_versioning): Likewise. * tree-loop-distribution.c (build_rdg): Likewise. (rdg_flag_vertex_and_dependent): Likewise. (distribute_loop): Likewise. * tree-parloops.c (loop_parallel_p): Likewise. (eliminate_local_variables): Likewise. (separate_decls_in_region): Likewise. * tree-predcom.c (tree_predictive_commoning_loop): Likewise. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Likewise. * tree-ssa-uncprop.c (uncprop_dom_walker): Likewise. * tree-vect-loop.c (vect_analyze_scaler_cycles_1): Likewise. * tree-vect-patterns.c (vect_pattern_recog): Likewise. * tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Likewise. (vectorizable_condition): Likewise. gcc/cp/ * semantics.c (build_anon_member_initialization): Convert fields to be a stack_vec. From-SVN: r204301
2013-11-01 21:31:32 +01:00
return false;
}
}
else if (is_gimple_call (stmt))
{
for (i = 0; i < gimple_call_num_args (stmt); i++)
{
tree arg = gimple_call_arg (stmt, i);
if (!process_use (stmt, arg, loop_vinfo, relevant,
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
&worklist, false))
Replace some heap vectors with stack vectors. From http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02735.html This patch is pretty dull, it just replaces a bunch of things of the form vec<T> x; x.create (N); // N is a constant blah blah x.release (); by stack_vec<T, N> x; blah blah 2013-11-01 Trevor Saunders <tsaunders@mozilla.com> gcc/ * function.c (reorder_blocks): Convert block_stack to a stack_vec. * gimplify.c (gimplify_compound_lval): Likewise. * graphite-clast-to-gimple.c (gloog): Likewise. * graphite-dependences.c (loop_is_parallel_p): Likewise. * graphite-scop-detection.c (scopdet_basic_block_info): Likewise. (limit_scop); Likewise. (build_scops): Likewise. (dot_scop): Likewise. * graphite-sese-to-poly.c (sese_dom_walker): Likewise. (build_scop_drs): Likewise. (insert_stmts): Likewise. (insert_out_of_ssa_copy): Likewise. (remove_phi): Likewise. (rewrite_commutative_reductions_out_of_ssa_close_phi): Likewise. * hw-doloop.c (discover_loop): Likewise. * tree-call-cdce.c (shrink_wrap_one_built_in_call): Likewise. * tree-dfa.c (dump_enumerated_decls): Likewise. * tree-if-conv.c (if_convertable_loop_p): Likewise. * tree-inline.c (tree_function_versioning): Likewise. * tree-loop-distribution.c (build_rdg): Likewise. (rdg_flag_vertex_and_dependent): Likewise. (distribute_loop): Likewise. * tree-parloops.c (loop_parallel_p): Likewise. (eliminate_local_variables): Likewise. (separate_decls_in_region): Likewise. * tree-predcom.c (tree_predictive_commoning_loop): Likewise. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Likewise. * tree-ssa-uncprop.c (uncprop_dom_walker): Likewise. * tree-vect-loop.c (vect_analyze_scaler_cycles_1): Likewise. * tree-vect-patterns.c (vect_pattern_recog): Likewise. * tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Likewise. (vectorizable_condition): Likewise. gcc/cp/ * semantics.c (build_anon_member_initialization): Convert fields to be a stack_vec. From-SVN: r204301
2013-11-01 21:31:32 +01:00
return false;
}
}
}
else
FOR_EACH_PHI_OR_STMT_USE (use_p, stmt, iter, SSA_OP_USE)
{
tree op = USE_FROM_PTR (use_p);
if (!process_use (stmt, op, loop_vinfo, relevant,
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
&worklist, false))
Replace some heap vectors with stack vectors. From http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02735.html This patch is pretty dull, it just replaces a bunch of things of the form vec<T> x; x.create (N); // N is a constant blah blah x.release (); by stack_vec<T, N> x; blah blah 2013-11-01 Trevor Saunders <tsaunders@mozilla.com> gcc/ * function.c (reorder_blocks): Convert block_stack to a stack_vec. * gimplify.c (gimplify_compound_lval): Likewise. * graphite-clast-to-gimple.c (gloog): Likewise. * graphite-dependences.c (loop_is_parallel_p): Likewise. * graphite-scop-detection.c (scopdet_basic_block_info): Likewise. (limit_scop); Likewise. (build_scops): Likewise. (dot_scop): Likewise. * graphite-sese-to-poly.c (sese_dom_walker): Likewise. (build_scop_drs): Likewise. (insert_stmts): Likewise. (insert_out_of_ssa_copy): Likewise. (remove_phi): Likewise. (rewrite_commutative_reductions_out_of_ssa_close_phi): Likewise. * hw-doloop.c (discover_loop): Likewise. * tree-call-cdce.c (shrink_wrap_one_built_in_call): Likewise. * tree-dfa.c (dump_enumerated_decls): Likewise. * tree-if-conv.c (if_convertable_loop_p): Likewise. * tree-inline.c (tree_function_versioning): Likewise. * tree-loop-distribution.c (build_rdg): Likewise. (rdg_flag_vertex_and_dependent): Likewise. (distribute_loop): Likewise. * tree-parloops.c (loop_parallel_p): Likewise. (eliminate_local_variables): Likewise. (separate_decls_in_region): Likewise. * tree-predcom.c (tree_predictive_commoning_loop): Likewise. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Likewise. * tree-ssa-uncprop.c (uncprop_dom_walker): Likewise. * tree-vect-loop.c (vect_analyze_scaler_cycles_1): Likewise. * tree-vect-patterns.c (vect_pattern_recog): Likewise. * tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Likewise. (vectorizable_condition): Likewise. gcc/cp/ * semantics.c (build_anon_member_initialization): Convert fields to be a stack_vec. From-SVN: r204301
2013-11-01 21:31:32 +01:00
return false;
}
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
if (STMT_VINFO_GATHER_SCATTER_P (stmt_vinfo))
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
{
gather_scatter_info gs_info;
if (!vect_check_gather_scatter (stmt, loop_vinfo, &gs_info))
gcc_unreachable ();
if (!process_use (stmt, gs_info.offset, loop_vinfo, relevant,
&worklist, true))
return false;
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
} /* while worklist */
return true;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Function vect_model_simple_cost.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
Models cost for simple operations, i.e. those that only emit ncopies of a
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
single op. Right now, this does not account for multiple insns that could
be generated for the single vector op. We will handle that shortly. */
void
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
vect_model_simple_cost (stmt_vec_info stmt_info, int ncopies,
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
enum vect_def_type *dt,
stmt_vector_for_cost *prologue_cost_vec,
stmt_vector_for_cost *body_cost_vec)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
int i;
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
int inside_cost = 0, prologue_cost = 0;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* The SLP costs were already calculated during SLP tree build. */
if (PURE_SLP_STMT (stmt_info))
return;
/* FORNOW: Assuming maximum 2 args per stmts. */
for (i = 0; i < 2; i++)
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
if (dt[i] == vect_constant_def || dt[i] == vect_external_def)
prologue_cost += record_stmt_cost (prologue_cost_vec, 1, vector_stmt,
stmt_info, 0, vect_prologue);
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
/* Pass the inside-of-loop statements to the target-specific cost model. */
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
inside_cost = record_stmt_cost (body_cost_vec, ncopies, vector_stmt,
stmt_info, 0, vect_body);
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"vect_model_simple_cost: inside_cost = %d, "
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"prologue_cost = %d .\n", inside_cost, prologue_cost);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* Model cost for type demotion and promotion operations. PWR is normally
zero for single-step promotions and demotions. It will be one if
two-step promotion/demotion is required, and so on. Each additional
step doubles the number of instructions required. */
static void
vect_model_promotion_demotion_cost (stmt_vec_info stmt_info,
enum vect_def_type *dt, int pwr)
{
int i, tmp;
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
int inside_cost = 0, prologue_cost = 0;
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
void *target_cost_data;
/* The SLP costs were already calculated during SLP tree build. */
if (PURE_SLP_STMT (stmt_info))
return;
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
if (loop_vinfo)
target_cost_data = LOOP_VINFO_TARGET_COST_DATA (loop_vinfo);
else
target_cost_data = BB_VINFO_TARGET_COST_DATA (bb_vinfo);
for (i = 0; i < pwr + 1; i++)
{
tmp = (STMT_VINFO_TYPE (stmt_info) == type_promotion_vec_info_type) ?
(i + 1) : i;
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
inside_cost += add_stmt_cost (target_cost_data, vect_pow2 (tmp),
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
vec_promote_demote, stmt_info, 0,
vect_body);
}
/* FORNOW: Assuming maximum 2 args per stmts. */
for (i = 0; i < 2; i++)
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
if (dt[i] == vect_constant_def || dt[i] == vect_external_def)
prologue_cost += add_stmt_cost (target_cost_data, 1, vector_stmt,
stmt_info, 0, vect_prologue);
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"vect_model_promotion_demotion_cost: inside_cost = %d, "
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"prologue_cost = %d .\n", inside_cost, prologue_cost);
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function vect_model_store_cost
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
Models cost for stores. In the case of grouped accesses, one access
has the overhead of the grouped access attributed to it. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
void
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
vect_model_store_cost (stmt_vec_info stmt_info, int ncopies,
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vect_memory_access_type memory_access_type,
enum vect_def_type dt, slp_tree slp_node,
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
stmt_vector_for_cost *prologue_cost_vec,
stmt_vector_for_cost *body_cost_vec)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
unsigned int inside_cost = 0, prologue_cost = 0;
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
gimple *first_stmt = STMT_VINFO_STMT (stmt_info);
bool grouped_access_p = STMT_VINFO_GROUPED_ACCESS (stmt_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
if (dt == vect_constant_def || dt == vect_external_def)
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
prologue_cost += record_stmt_cost (prologue_cost_vec, 1, scalar_to_vec,
stmt_info, 0, vect_prologue);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Grouped stores update all elements in the group at once,
so we want the DR for the first statement. */
if (!slp_node && grouped_access_p)
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
{
first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* True if we should include any once-per-group costs as well as
the cost of the statement itself. For SLP we only get called
once per group anyhow. */
bool first_stmt_p = (first_stmt == STMT_VINFO_STMT (stmt_info));
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* We assume that the cost of a single store-lanes instruction is
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
equivalent to the cost of GROUP_SIZE separate stores. If a grouped
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
access is instead being provided by a permute-and-store operation,
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
include the cost of the permutes. */
if (first_stmt_p
&& memory_access_type == VMAT_CONTIGUOUS_PERMUTE)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
/* Uses a high and low interleave or shuffle operations for each
needed permute. */
int group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
int nstmts = ncopies * ceil_log2 (group_size) * group_size;
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
inside_cost = record_stmt_cost (body_cost_vec, nstmts, vec_perm,
stmt_info, 0, vect_body);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"vect_model_store_cost: strided group_size = %d .\n",
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
group_size);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Costs of the stores. */
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_ELEMENTWISE)
/* N scalar stores plus extracting the elements. */
inside_cost += record_stmt_cost (body_cost_vec,
ncopies * TYPE_VECTOR_SUBPARTS (vectype),
scalar_store, stmt_info, 0, vect_body);
else
vect_get_store_cost (dr, ncopies, &inside_cost, body_cost_vec);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_ELEMENTWISE
|| memory_access_type == VMAT_STRIDED_SLP)
inside_cost += record_stmt_cost (body_cost_vec,
ncopies * TYPE_VECTOR_SUBPARTS (vectype),
vec_to_scalar, stmt_info, 0, vect_body);
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"vect_model_store_cost: inside_cost = %d, "
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"prologue_cost = %d .\n", inside_cost, prologue_cost);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
/* Calculate cost of DR's memory access. */
void
vect_get_store_cost (struct data_reference *dr, int ncopies,
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
unsigned int *inside_cost,
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
stmt_vector_for_cost *body_cost_vec)
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
{
int alignment_support_scheme = vect_supportable_dr_alignment (dr, false);
gimple *stmt = DR_STMT (dr);
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
switch (alignment_support_scheme)
{
case dr_aligned:
{
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
*inside_cost += record_stmt_cost (body_cost_vec, ncopies,
vector_store, stmt_info, 0,
vect_body);
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"vect_model_store_cost: aligned.\n");
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
break;
}
case dr_unaligned_supported:
{
/* Here, we assign an additional cost for the unaligned store. */
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
*inside_cost += record_stmt_cost (body_cost_vec, ncopies,
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
unaligned_store, stmt_info,
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
DR_MISALIGNMENT (dr), vect_body);
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"vect_model_store_cost: unaligned supported by "
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"hardware.\n");
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
break;
}
case dr_unaligned_unsupported:
{
*inside_cost = VECT_MAX_COST;
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"vect_model_store_cost: unsupported access.\n");
break;
}
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
default:
gcc_unreachable ();
}
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function vect_model_load_cost
Models cost for loads. In the case of grouped accesses, one access has
the overhead of the grouped access attributed to it. Since unaligned
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
accesses are supported for loads, we also account for the costs of the
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
access scheme chosen. */
void
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
vect_model_load_cost (stmt_vec_info stmt_info, int ncopies,
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vect_memory_access_type memory_access_type,
slp_tree slp_node,
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
stmt_vector_for_cost *prologue_cost_vec,
stmt_vector_for_cost *body_cost_vec)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
gimple *first_stmt = STMT_VINFO_STMT (stmt_info);
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
unsigned int inside_cost = 0, prologue_cost = 0;
bool grouped_access_p = STMT_VINFO_GROUPED_ACCESS (stmt_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Grouped loads read all elements in the group at once,
so we want the DR for the first statement. */
if (!slp_node && grouped_access_p)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* True if we should include any once-per-group costs as well as
the cost of the statement itself. For SLP we only get called
once per group anyhow. */
bool first_stmt_p = (first_stmt == STMT_VINFO_STMT (stmt_info));
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* We assume that the cost of a single load-lanes instruction is
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
equivalent to the cost of GROUP_SIZE separate loads. If a grouped
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
access is instead being provided by a load-and-permute operation,
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
include the cost of the permutes. */
if (first_stmt_p
&& memory_access_type == VMAT_CONTIGUOUS_PERMUTE)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
/* Uses an even and odd extract operations or shuffle operations
for each needed permute. */
int group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
int nstmts = ncopies * ceil_log2 (group_size) * group_size;
inside_cost = record_stmt_cost (body_cost_vec, nstmts, vec_perm,
stmt_info, 0, vect_body);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (dump_enabled_p ())
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"vect_model_load_cost: strided group_size = %d .\n",
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
group_size);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* The loads themselves. */
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_ELEMENTWISE)
{
/* N scalar loads plus gathering them into a vector. */
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
inside_cost += record_stmt_cost (body_cost_vec,
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
ncopies * TYPE_VECTOR_SUBPARTS (vectype),
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
scalar_load, stmt_info, 0, vect_body);
}
else
vect_get_load_cost (dr, ncopies, first_stmt_p,
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
&inside_cost, &prologue_cost,
prologue_cost_vec, body_cost_vec, true);
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_ELEMENTWISE
|| memory_access_type == VMAT_STRIDED_SLP)
inside_cost += record_stmt_cost (body_cost_vec, ncopies, vec_construct,
stmt_info, 0, vect_body);
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"vect_model_load_cost: inside_cost = %d, "
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"prologue_cost = %d .\n", inside_cost, prologue_cost);
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
}
/* Calculate cost of DR's memory access. */
void
vect_get_load_cost (struct data_reference *dr, int ncopies,
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
bool add_realign_cost, unsigned int *inside_cost,
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
unsigned int *prologue_cost,
stmt_vector_for_cost *prologue_cost_vec,
stmt_vector_for_cost *body_cost_vec,
bool record_prologue_costs)
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
{
int alignment_support_scheme = vect_supportable_dr_alignment (dr, false);
gimple *stmt = DR_STMT (dr);
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
switch (alignment_support_scheme)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
case dr_aligned:
{
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
*inside_cost += record_stmt_cost (body_cost_vec, ncopies, vector_load,
stmt_info, 0, vect_body);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"vect_model_load_cost: aligned.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
}
case dr_unaligned_supported:
{
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
/* Here, we assign an additional cost for the unaligned load. */
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
*inside_cost += record_stmt_cost (body_cost_vec, ncopies,
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
unaligned_load, stmt_info,
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
DR_MISALIGNMENT (dr), vect_body);
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"vect_model_load_cost: unaligned supported by "
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"hardware.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
}
case dr_explicit_realign:
{
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
*inside_cost += record_stmt_cost (body_cost_vec, ncopies * 2,
vector_load, stmt_info, 0, vect_body);
*inside_cost += record_stmt_cost (body_cost_vec, ncopies,
vec_perm, stmt_info, 0, vect_body);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* FIXME: If the misalignment remains fixed across the iterations of
the containing loop, the following cost should be added to the
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
prologue costs. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (targetm.vectorize.builtin_mask_for_load)
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
*inside_cost += record_stmt_cost (body_cost_vec, 1, vector_stmt,
stmt_info, 0, vect_body);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (dump_enabled_p ())
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"vect_model_load_cost: explicit realign\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
}
case dr_explicit_realign_optimized:
{
if (dump_enabled_p ())
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
"vect_model_load_cost: unaligned software "
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"pipelined.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Unaligned software pipeline has a load of an address, an initial
load, and possibly a mask operation to "prime" the loop. However,
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
if this is an access in a group of loads, which provide grouped
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
access, then the above cost should only be considered for one
access in the group. Inside the loop, there is a load op
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
and a realignment op. */
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
if (add_realign_cost && record_prologue_costs)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
*prologue_cost += record_stmt_cost (prologue_cost_vec, 2,
vector_stmt, stmt_info,
0, vect_prologue);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (targetm.vectorize.builtin_mask_for_load)
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
*prologue_cost += record_stmt_cost (prologue_cost_vec, 1,
vector_stmt, stmt_info,
0, vect_prologue);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
*inside_cost += record_stmt_cost (body_cost_vec, ncopies, vector_load,
stmt_info, 0, vect_body);
*inside_cost += record_stmt_cost (body_cost_vec, ncopies, vec_perm,
stmt_info, 0, vect_body);
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"vect_model_load_cost: explicit realign optimized"
"\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
}
case dr_unaligned_unsupported:
{
*inside_cost = VECT_MAX_COST;
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"vect_model_load_cost: unsupported access.\n");
break;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
default:
gcc_unreachable ();
}
}
/* Insert the new stmt NEW_STMT at *GSI or at the appropriate place in
the loop preheader for the vectorized stmt STMT. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
static void
vect_init_vector_1 (gimple *stmt, gimple *new_stmt, gimple_stmt_iterator *gsi)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (gsi)
vect_finish_stmt_generation (stmt, new_stmt, gsi);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
{
stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
if (loop_vinfo)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block new_bb;
edge pe;
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
if (nested_in_vect_loop_p (loop, stmt))
loop = loop->inner;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
pe = loop_preheader_edge (loop);
new_bb = gsi_insert_on_edge_immediate (pe, new_stmt);
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
gcc_assert (!new_bb);
}
else
{
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_vinfo);
basic_block bb;
gimple_stmt_iterator gsi_bb_start;
gcc_assert (bb_vinfo);
bb = BB_VINFO_BB (bb_vinfo);
gsi_bb_start = gsi_after_labels (bb);
gsi_insert_before (&gsi_bb_start, new_stmt, GSI_SAME_STMT);
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
if (dump_enabled_p ())
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"created new init_stmt: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, new_stmt, 0);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
}
/* Function vect_init_vector.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Insert a new stmt (INIT_STMT) that initializes a new variable of type
TYPE with the value VAL. If TYPE is a vector type and VAL does not have
vector type a vector with all elements equal to VAL is created first.
Place the initialization at BSI if it is not NULL. Otherwise, place the
initialization at the loop preheader.
Return the DEF of INIT_STMT.
It will be used in the vectorization of STMT. */
tree
vect_init_vector (gimple *stmt, tree val, tree type, gimple_stmt_iterator *gsi)
{
gimple *init_stmt;
tree new_temp;
/* We abuse this function to push sth to a SSA name with initial 'val'. */
if (! useless_type_conversion_p (type, TREE_TYPE (val)))
{
gcc_assert (TREE_CODE (type) == VECTOR_TYPE);
if (! types_compatible_p (TREE_TYPE (type), TREE_TYPE (val)))
{
/* Scalar boolean value should be transformed into
all zeros or all ones value before building a vector. */
if (VECTOR_BOOLEAN_TYPE_P (type))
{
tree true_val = build_all_ones_cst (TREE_TYPE (type));
tree false_val = build_zero_cst (TREE_TYPE (type));
if (CONSTANT_CLASS_P (val))
val = integer_zerop (val) ? false_val : true_val;
else
{
new_temp = make_ssa_name (TREE_TYPE (type));
init_stmt = gimple_build_assign (new_temp, COND_EXPR,
val, true_val, false_val);
vect_init_vector_1 (stmt, init_stmt, gsi);
val = new_temp;
}
}
else if (CONSTANT_CLASS_P (val))
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
val = fold_convert (TREE_TYPE (type), val);
else
{
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
new_temp = make_ssa_name (TREE_TYPE (type));
if (! INTEGRAL_TYPE_P (TREE_TYPE (val)))
init_stmt = gimple_build_assign (new_temp,
fold_build1 (VIEW_CONVERT_EXPR,
TREE_TYPE (type),
val));
else
init_stmt = gimple_build_assign (new_temp, NOP_EXPR, val);
vect_init_vector_1 (stmt, init_stmt, gsi);
val = new_temp;
}
}
val = build_vector_from_val (type, val);
}
new_temp = vect_get_new_ssa_name (type, vect_simple_var, "cst_");
init_stmt = gimple_build_assign (new_temp, val);
vect_init_vector_1 (stmt, init_stmt, gsi);
return new_temp;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* Function vect_get_vec_def_for_operand_1.
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
For a defining stmt DEF_STMT of a scalar stmt, return a vector def with type
DT that will be used in the vectorized stmt. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree
vect_get_vec_def_for_operand_1 (gimple *def_stmt, enum vect_def_type dt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree vec_oprnd;
gimple *vec_stmt;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt_vec_info def_stmt_info = NULL;
switch (dt)
{
/* operand is a constant or a loop invariant. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
case vect_constant_def:
case vect_external_def:
/* Code should use vect_get_vec_def_for_operand. */
gcc_unreachable ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* operand is defined inside the loop. */
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
case vect_internal_def:
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
/* Get the def from the vectorized stmt. */
def_stmt_info = vinfo_for_stmt (def_stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vec_stmt = STMT_VINFO_VEC_STMT (def_stmt_info);
/* Get vectorized pattern statement. */
if (!vec_stmt
&& STMT_VINFO_IN_PATTERN_P (def_stmt_info)
&& !STMT_VINFO_RELEVANT (def_stmt_info))
vec_stmt = STMT_VINFO_VEC_STMT (vinfo_for_stmt (
STMT_VINFO_RELATED_STMT (def_stmt_info)));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gcc_assert (vec_stmt);
if (gimple_code (vec_stmt) == GIMPLE_PHI)
vec_oprnd = PHI_RESULT (vec_stmt);
else if (is_gimple_call (vec_stmt))
vec_oprnd = gimple_call_lhs (vec_stmt);
else
vec_oprnd = gimple_assign_lhs (vec_stmt);
return vec_oprnd;
}
/* operand is defined by a loop header phi - reduction */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
case vect_reduction_def:
tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. From-SVN: r149526
2009-07-12 09:09:07 +02:00
case vect_double_reduction_def:
2009-06-16 09:21:12 +02:00
case vect_nested_cycle:
/* Code should use get_initial_def_for_reduction. */
gcc_unreachable ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* operand is defined by loop-header phi - induction. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
case vect_induction_def:
{
gcc_assert (gimple_code (def_stmt) == GIMPLE_PHI);
/* Get the def from the vectorized stmt. */
def_stmt_info = vinfo_for_stmt (def_stmt);
vec_stmt = STMT_VINFO_VEC_STMT (def_stmt_info);
if (gimple_code (vec_stmt) == GIMPLE_PHI)
vec_oprnd = PHI_RESULT (vec_stmt);
else
vec_oprnd = gimple_get_lhs (vec_stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return vec_oprnd;
}
default:
gcc_unreachable ();
}
}
/* Function vect_get_vec_def_for_operand.
OP is an operand in STMT. This function returns a (vector) def that will be
used in the vectorized stmt for STMT.
In the case that OP is an SSA_NAME which is defined in the loop, then
STMT_VINFO_VEC_STMT of the defining stmt holds the relevant def.
In case OP is an invariant or constant, a new stmt that creates a vector def
needs to be introduced. VECTYPE may be used to specify a required type for
vector invariant. */
tree
vect_get_vec_def_for_operand (tree op, gimple *stmt, tree vectype)
{
gimple *def_stmt;
enum vect_def_type dt;
bool is_simple_use;
stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
if (dump_enabled_p ())
{
dump_printf_loc (MSG_NOTE, vect_location,
"vect_get_vec_def_for_operand: ");
dump_generic_expr (MSG_NOTE, TDF_SLIM, op);
dump_printf (MSG_NOTE, "\n");
}
is_simple_use = vect_is_simple_use (op, loop_vinfo, &def_stmt, &dt);
gcc_assert (is_simple_use);
if (def_stmt && dump_enabled_p ())
{
dump_printf_loc (MSG_NOTE, vect_location, " def_stmt = ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, def_stmt, 0);
}
if (dt == vect_constant_def || dt == vect_external_def)
{
tree stmt_vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
tree vector_type;
if (vectype)
vector_type = vectype;
else if (VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (op))
&& VECTOR_BOOLEAN_TYPE_P (stmt_vectype))
vector_type = build_same_sized_truth_vector_type (stmt_vectype);
else
vector_type = get_vectype_for_scalar_type (TREE_TYPE (op));
gcc_assert (vector_type);
return vect_init_vector (stmt, op, vector_type, NULL);
}
else
return vect_get_vec_def_for_operand_1 (def_stmt, dt);
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function vect_get_vec_def_for_stmt_copy
Return a vector-def for an operand. This function is used when the
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
vectorized stmt to be created (by the caller to this function) is a "copy"
created in case the vectorized result cannot fit in one vector, and several
copies of the vector-stmt are required. In this case the vector-def is
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
retrieved from the vector stmt recorded in the STMT_VINFO_RELATED_STMT field
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
of the stmt that defines VEC_OPRND.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
DT is the type of the vector def VEC_OPRND.
Context:
In case the vectorization factor (VF) is bigger than the number
of elements that can fit in a vectype (nunits), we have to generate
more than one vector stmt to vectorize the scalar stmt. This situation
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
arises when there are multiple data-types operated upon in the loop; the
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
smallest data-type determines the VF, and as a result, when vectorizing
stmts operating on wider types we need to create 'VF/nunits' "copies" of the
vector stmt (each computing a vector of 'nunits' results, and together
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
computing 'VF' results in each iteration). This function is called when
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vectorizing such a stmt (e.g. vectorizing S2 in the illustration below, in
which VF=16 and nunits=4, so the number of copies required is 4):
scalar stmt: vectorized into: STMT_VINFO_RELATED_STMT
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
S1: x = load VS1.0: vx.0 = memref0 VS1.1
VS1.1: vx.1 = memref1 VS1.2
VS1.2: vx.2 = memref2 VS1.3
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
VS1.3: vx.3 = memref3
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
S2: z = x + ... VSnew.0: vz0 = vx.0 + ... VSnew.1
VSnew.1: vz1 = vx.1 + ... VSnew.2
VSnew.2: vz2 = vx.2 + ... VSnew.3
VSnew.3: vz3 = vx.3 + ...
The vectorization of S1 is explained in vectorizable_load.
The vectorization of S2:
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
To create the first vector-stmt out of the 4 copies - VSnew.0 -
the function 'vect_get_vec_def_for_operand' is called to
get the relevant vector-def for each operand of S2. For operand x it
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
returns the vector-def 'vx.0'.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
To create the remaining copies of the vector-stmt (VSnew.j), this
function is called to get the relevant vector-def for each operand. It is
obtained from the respective VS1.j stmt, which is recorded in the
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
STMT_VINFO_RELATED_STMT field of the stmt that defines VEC_OPRND.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
For example, to obtain the vector-def 'vx.1' in order to create the
vector stmt 'VSnew.1', this function is called with VEC_OPRND='vx.0'.
Given 'vx0' we obtain the stmt that defines it ('VS1.0'); from the
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
STMT_VINFO_RELATED_STMT field of 'VS1.0' we obtain the next copy - 'VS1.1',
and return its def ('vx.1').
Overall, to create the above sequence this function will be called 3 times:
vx.1 = vect_get_vec_def_for_stmt_copy (dt, vx.0);
vx.2 = vect_get_vec_def_for_stmt_copy (dt, vx.1);
vx.3 = vect_get_vec_def_for_stmt_copy (dt, vx.2); */
tree
vect_get_vec_def_for_stmt_copy (enum vect_def_type dt, tree vec_oprnd)
{
gimple *vec_stmt_for_operand;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt_vec_info def_stmt_info;
/* Do nothing; can reuse same def. */
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
if (dt == vect_external_def || dt == vect_constant_def )
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return vec_oprnd;
vec_stmt_for_operand = SSA_NAME_DEF_STMT (vec_oprnd);
def_stmt_info = vinfo_for_stmt (vec_stmt_for_operand);
gcc_assert (def_stmt_info);
vec_stmt_for_operand = STMT_VINFO_RELATED_STMT (def_stmt_info);
gcc_assert (vec_stmt_for_operand);
if (gimple_code (vec_stmt_for_operand) == GIMPLE_PHI)
vec_oprnd = PHI_RESULT (vec_stmt_for_operand);
else
vec_oprnd = gimple_get_lhs (vec_stmt_for_operand);
return vec_oprnd;
}
/* Get vectorized definitions for the operands to create a copy of an original
stmt. See vect_get_vec_def_for_stmt_copy () for details. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
static void
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
vect_get_vec_defs_for_stmt_copy (enum vect_def_type *dt,
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> *vec_oprnds0,
vec<tree> *vec_oprnds1)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
tree vec_oprnd = vec_oprnds0->pop ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vec_oprnd = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0->quick_push (vec_oprnd);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
if (vec_oprnds1 && vec_oprnds1->length ())
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnd = vec_oprnds1->pop ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vec_oprnd = vect_get_vec_def_for_stmt_copy (dt[1], vec_oprnd);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds1->quick_push (vec_oprnd);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
}
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
/* Get vectorized definitions for OP0 and OP1.
REDUC_INDEX is the index of reduction operand in case of reduction,
and -1 otherwise. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
void
vect_get_vec_defs (tree op0, tree op1, gimple *stmt,
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> *vec_oprnds0,
vec<tree> *vec_oprnds1,
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
slp_tree slp_node, int reduc_index)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (slp_node)
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
{
int nops = (op1 == NULL_TREE) ? 1 : 2;
auto_vec<tree> ops (nops);
auto_vec<vec<tree> > vec_defs (nops);
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
ops.quick_push (op0);
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
if (op1)
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
ops.quick_push (op1);
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
vect_get_slp_defs (ops, slp_node, &vec_defs, reduc_index);
*vec_oprnds0 = vec_defs[0];
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
if (op1)
*vec_oprnds1 = vec_defs[1];
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
{
tree vec_oprnd;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0->create (1);
vec_oprnd = vect_get_vec_def_for_operand (op0, stmt);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0->quick_push (vec_oprnd);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (op1)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds1->create (1);
vec_oprnd = vect_get_vec_def_for_operand (op1, stmt);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds1->quick_push (vec_oprnd);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
}
}
/* Function vect_finish_stmt_generation.
Insert a new stmt. */
void
vect_finish_stmt_generation (gimple *stmt, gimple *vec_stmt,
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gimple_stmt_iterator *gsi)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
vec_info *vinfo = stmt_info->vinfo;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gcc_assert (gimple_code (stmt) != GIMPLE_LABEL);
if (!gsi_end_p (*gsi)
&& gimple_has_mem_ops (vec_stmt))
{
gimple *at_stmt = gsi_stmt (*gsi);
tree vuse = gimple_vuse (at_stmt);
if (vuse && TREE_CODE (vuse) == SSA_NAME)
{
tree vdef = gimple_vdef (at_stmt);
gimple_set_vuse (vec_stmt, gimple_vuse (at_stmt));
/* If we have an SSA vuse and insert a store, update virtual
SSA form to avoid triggering the renamer. Do so only
if we can easily see all uses - which is what almost always
happens with the way vectorized stmts are inserted. */
if ((vdef && TREE_CODE (vdef) == SSA_NAME)
&& ((is_gimple_assign (vec_stmt)
&& !is_gimple_reg (gimple_assign_lhs (vec_stmt)))
|| (is_gimple_call (vec_stmt)
&& !(gimple_call_flags (vec_stmt)
& (ECF_CONST|ECF_PURE|ECF_NOVOPS)))))
{
tree new_vdef = copy_ssa_name (vuse, vec_stmt);
gimple_set_vdef (vec_stmt, new_vdef);
SET_USE (gimple_vuse_op (at_stmt), new_vdef);
}
}
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gsi_insert_before (gsi, vec_stmt, GSI_SAME_STMT);
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
set_vinfo_for_stmt (vec_stmt, new_stmt_vec_info (vec_stmt, vinfo));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (dump_enabled_p ())
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location, "add new stmt: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, vec_stmt, 0);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
gimple_set_location (vec_stmt, gimple_location (stmt));
/* While EH edges will generally prevent vectorization, stmt might
e.g. be in a must-not-throw region. Ensure newly created stmts
that could throw are part of the same region. */
int lp_nr = lookup_stmt_eh_lp (stmt);
if (lp_nr != 0 && stmt_could_throw_p (vec_stmt))
add_stmt_to_eh_lp (vec_stmt, lp_nr);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* We want to vectorize a call to combined function CFN with function
decl FNDECL, using VECTYPE_OUT as the type of the output and VECTYPE_IN
as the types of all inputs. Check whether this is possible using
an internal function, returning its code if so or IFN_LAST if not. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
static internal_fn
vectorizable_internal_function (combined_fn cfn, tree fndecl,
tree vectype_out, tree vectype_in)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
internal_fn ifn;
if (internal_fn_p (cfn))
ifn = as_internal_fn (cfn);
else
ifn = associated_internal_fn (fndecl);
if (ifn != IFN_LAST && direct_internal_fn_p (ifn))
{
const direct_internal_fn_info &info = direct_internal_fn (ifn);
if (info.vectorizable)
{
tree type0 = (info.type0 < 0 ? vectype_out : vectype_in);
tree type1 = (info.type1 < 0 ? vectype_out : vectype_in);
PR 68432: Add a target hook to control size/speed optab choices The problem in the PR is that some i386 optabs FAIL when optimising for size rather than speed. The gimple level generally needs access to this information before calling the generator, so this patch adds a new hook to say whether an optab should be used when optimising for size or speed. It also has a "both" option for cases where we want code that is optimised for both size and speed. I've passed the optab to the target hook because I think in most cases that's more useful than the instruction code. We could pass both if there's a use for it though. At the moment the match-and-simplify code doesn't have direct access to the target block, so for now I've used "both" there. Tested on x86_64-linux-gnu and powerpc64-linux-gnu. gcc/ PR tree-optimization/68432 * coretypes.h (optimization_type): New enum. * doc/tm.texi.in (TARGET_OPTAB_SUPPORTED_P): New hook. * doc/tm.texi: Regenerate. * target.def (optab_supported_p): New hook. * targhooks.h (default_optab_supported_p): Declare. * targhooks.c (default_optab_supported_p): New function. * predict.h (function_optimization_type): Declare. (bb_optimization_type): Likewise. * predict.c (function_optimization_type): New function. (bb_optimization_type): Likewise. * optabs-query.h (convert_optab_handler): Define an overload that takes an optimization type. (direct_optab_handler): Likewise. * optabs-query.c (convert_optab_handler): Likewise. (direct_optab_handler): Likewise. * internal-fn.h (direct_internal_fn_supported_p): Take an optimization_type argument. * internal-fn.c (direct_optab_supported_p): Likewise. (multi_vector_optab_supported_p): Likewise. (direct_internal_fn_supported_p): Likewise. * builtins.c (replacement_internal_fn): Update call to direct_internal_fn_supported_p. * gimple-match-head.c (build_call_internal): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Likewise. * tree-vect-stmts.c (vectorizable_internal_function): Likewise. * tree.c (maybe_build_call_expr_loc): Likewise. * config/i386/i386.c (ix86_optab_supported_p): New function. (TARGET_OPTAB_SUPPORTED_P): Define. * config/i386/i386.md (asinxf2): Remove optimize_insn_for_size_p check. (asin<mode>2, acosxf2, acos<mode>2, log1pxf2, log1p<mode>2) (expNcorexf3, expxf2, exp<mode>2, exp10xf2, exp10<mode>2, exp2xf2) (exp2<mode>2, expm1xf2, expm1<mode>2, ldexpxf3, ldexp<mode>3) (scalbxf3, scalb<mode>3, rint<mode>2, round<mode>2) (<rounding_insn>xf2, <rounding_insn><mode>2): Likewise. gcc/testsuite/ * gcc.target/i386/pr68432-1.c: New test. * gcc.target/i386/pr68432-2.c: Likewise. * gcc.target/i386/pr68432-3.c: Likewise. From-SVN: r231161
2015-12-02 10:08:49 +01:00
if (direct_internal_fn_supported_p (ifn, tree_pair (type0, type1),
OPTIMIZE_FOR_SPEED))
return ifn;
}
}
return IFN_LAST;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
static tree permute_vec_elements (tree, tree, tree, gimple *,
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
gimple_stmt_iterator *);
/* STMT is a non-strided load or store, meaning that it accesses
elements with a known constant step. Return -1 if that step
is negative, 0 if it is zero, and 1 if it is greater than zero. */
static int
compare_step_with_zero (gimple *stmt)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
tree step;
if (loop_vinfo && nested_in_vect_loop_p (LOOP_VINFO_LOOP (loop_vinfo), stmt))
step = STMT_VINFO_DR_STEP (stmt_info);
else
step = DR_STEP (STMT_VINFO_DATA_REF (stmt_info));
return tree_int_cst_compare (step, size_zero_node);
}
/* If the target supports a permute mask that reverses the elements in
a vector of type VECTYPE, return that mask, otherwise return null. */
static tree
perm_mask_for_reverse (tree vectype)
{
int i, nunits;
unsigned char *sel;
nunits = TYPE_VECTOR_SUBPARTS (vectype);
sel = XALLOCAVEC (unsigned char, nunits);
for (i = 0; i < nunits; ++i)
sel[i] = nunits - 1 - i;
if (!can_vec_perm_p (TYPE_MODE (vectype), false, sel))
return NULL_TREE;
return vect_gen_perm_mask_checked (vectype, sel);
}
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
/* A subroutine of get_load_store_type, with a subset of the same
arguments. Handle the case where STMT is part of a grouped load
or store.
For stores, the statements in the group are all consecutive
and there is no gap at the end. For loads, the statements in the
group might not be consecutive; there can be gaps between statements
as well as at the end. */
static bool
get_group_load_store_type (gimple *stmt, tree vectype, bool slp,
vec_load_store_type vls_type,
vect_memory_access_type *memory_access_type)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
vec_info *vinfo = stmt_info->vinfo;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
struct loop *loop = loop_vinfo ? LOOP_VINFO_LOOP (loop_vinfo) : NULL;
gimple *first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
unsigned int group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
bool single_element_p = (stmt == first_stmt
&& !GROUP_NEXT_ELEMENT (stmt_info));
unsigned HOST_WIDE_INT gap = GROUP_GAP (vinfo_for_stmt (first_stmt));
unsigned nunits = TYPE_VECTOR_SUBPARTS (vectype);
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
/* True if the vectorized statements would access beyond the last
statement in the group. */
bool overrun_p = false;
/* True if we can cope with such overrun by peeling for gaps, so that
there is at least one final scalar iteration after the vector loop. */
bool can_overrun_p = (vls_type == VLS_LOAD && loop_vinfo && !loop->inner);
/* There can only be a gap at the end of the group if the stride is
known at compile time. */
gcc_assert (!STMT_VINFO_STRIDED_P (stmt_info) || gap == 0);
/* Stores can't yet have gaps. */
gcc_assert (slp || vls_type == VLS_LOAD || gap == 0);
if (slp)
{
if (STMT_VINFO_STRIDED_P (stmt_info))
{
/* Try to use consecutive accesses of GROUP_SIZE elements,
separated by the stride, until we have a complete vector.
Fall back to scalar accesses if that isn't possible. */
if (nunits % group_size == 0)
*memory_access_type = VMAT_STRIDED_SLP;
else
*memory_access_type = VMAT_ELEMENTWISE;
}
else
{
overrun_p = loop_vinfo && gap != 0;
if (overrun_p && vls_type != VLS_LOAD)
{
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"Grouped store with gaps requires"
" non-consecutive accesses\n");
return false;
}
/* If the access is aligned an overrun is fine. */
if (overrun_p
&& aligned_access_p
(STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt))))
overrun_p = false;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (overrun_p && !can_overrun_p)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"Peeling for outer loop is not supported\n");
return false;
}
*memory_access_type = VMAT_CONTIGUOUS;
}
}
else
{
/* We can always handle this case using elementwise accesses,
but see if something more efficient is available. */
*memory_access_type = VMAT_ELEMENTWISE;
/* If there is a gap at the end of the group then these optimizations
would access excess elements in the last iteration. */
bool would_overrun_p = (gap != 0);
/* If the access is aligned an overrun is fine, but only if the
overrun is not inside an unused vector (if the gap is as large
or larger than a vector). */
if (would_overrun_p
&& gap < nunits
&& aligned_access_p
(STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt))))
would_overrun_p = false;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (!STMT_VINFO_STRIDED_P (stmt_info)
&& (can_overrun_p || !would_overrun_p)
&& compare_step_with_zero (stmt) > 0)
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
{
/* First try using LOAD/STORE_LANES. */
if (vls_type == VLS_LOAD
? vect_load_lanes_supported (vectype, group_size)
: vect_store_lanes_supported (vectype, group_size))
{
*memory_access_type = VMAT_LOAD_STORE_LANES;
overrun_p = would_overrun_p;
}
/* If that fails, try using permuting loads. */
if (*memory_access_type == VMAT_ELEMENTWISE
&& (vls_type == VLS_LOAD
? vect_grouped_load_supported (vectype, single_element_p,
group_size)
: vect_grouped_store_supported (vectype, group_size)))
{
*memory_access_type = VMAT_CONTIGUOUS_PERMUTE;
overrun_p = would_overrun_p;
}
}
}
if (vls_type != VLS_LOAD && first_stmt == stmt)
{
/* STMT is the leader of the group. Check the operands of all the
stmts of the group. */
gimple *next_stmt = GROUP_NEXT_ELEMENT (stmt_info);
while (next_stmt)
{
gcc_assert (gimple_assign_single_p (next_stmt));
tree op = gimple_assign_rhs1 (next_stmt);
gimple *def_stmt;
enum vect_def_type dt;
if (!vect_is_simple_use (op, vinfo, &def_stmt, &dt))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"use not simple.\n");
return false;
}
next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt));
}
}
if (overrun_p)
{
gcc_assert (can_overrun_p);
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"Data access with gaps requires scalar "
"epilogue loop\n");
LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo) = true;
}
return true;
}
/* A subroutine of get_load_store_type, with a subset of the same
arguments. Handle the case where STMT is a load or store that
accesses consecutive elements with a negative step. */
static vect_memory_access_type
get_negative_load_store_type (gimple *stmt, tree vectype,
vec_load_store_type vls_type,
unsigned int ncopies)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
dr_alignment_support alignment_support_scheme;
if (ncopies > 1)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"multiple types with negative step.\n");
return VMAT_ELEMENTWISE;
}
alignment_support_scheme = vect_supportable_dr_alignment (dr, false);
if (alignment_support_scheme != dr_aligned
&& alignment_support_scheme != dr_unaligned_supported)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"negative step but alignment required.\n");
return VMAT_ELEMENTWISE;
}
if (vls_type == VLS_STORE_INVARIANT)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location,
"negative step with invariant source;"
" no permute needed.\n");
return VMAT_CONTIGUOUS_DOWN;
}
if (!perm_mask_for_reverse (vectype))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"negative step and reversing not supported.\n");
return VMAT_ELEMENTWISE;
}
return VMAT_CONTIGUOUS_REVERSE;
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
/* Analyze load or store statement STMT of type VLS_TYPE. Return true
if there is a memory access type that the vectorized form can use,
storing it in *MEMORY_ACCESS_TYPE if so. If we decide to use gathers
or scatters, fill in GS_INFO accordingly.
SLP says whether we're performing SLP rather than loop vectorization.
VECTYPE is the vector type that the vectorized statements will use.
NCOPIES is the number of vector statements that will be needed. */
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
static bool
get_load_store_type (gimple *stmt, tree vectype, bool slp,
vec_load_store_type vls_type, unsigned int ncopies,
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vect_memory_access_type *memory_access_type,
gather_scatter_info *gs_info)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
vec_info *vinfo = stmt_info->vinfo;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
if (STMT_VINFO_GATHER_SCATTER_P (stmt_info))
{
*memory_access_type = VMAT_GATHER_SCATTER;
gimple *def_stmt;
if (!vect_check_gather_scatter (stmt, loop_vinfo, gs_info))
gcc_unreachable ();
else if (!vect_is_simple_use (gs_info->offset, vinfo, &def_stmt,
&gs_info->offset_dt,
&gs_info->offset_vectype))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"%s index use not simple.\n",
vls_type == VLS_LOAD ? "gather" : "scatter");
return false;
}
}
else if (STMT_VINFO_GROUPED_ACCESS (stmt_info))
{
if (!get_group_load_store_type (stmt, vectype, slp, vls_type,
memory_access_type))
return false;
}
else if (STMT_VINFO_STRIDED_P (stmt_info))
{
gcc_assert (!slp);
*memory_access_type = VMAT_ELEMENTWISE;
}
else
{
int cmp = compare_step_with_zero (stmt);
if (cmp < 0)
*memory_access_type = get_negative_load_store_type
(stmt, vectype, vls_type, ncopies);
else if (cmp == 0)
{
gcc_assert (vls_type == VLS_LOAD);
*memory_access_type = VMAT_INVARIANT;
}
else
*memory_access_type = VMAT_CONTIGUOUS;
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
/* FIXME: At the moment the cost model seems to underestimate the
cost of using elementwise accesses. This check preserves the
traditional behavior until that can be fixed. */
if (*memory_access_type == VMAT_ELEMENTWISE
&& !STMT_VINFO_STRIDED_P (stmt_info))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"not falling back to elementwise accesses\n");
return false;
}
return true;
}
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
/* Function vectorizable_mask_load_store.
Check if STMT performs a conditional load or store that can be vectorized.
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
stmt to replace it, put it in VEC_STMT, and insert it at GSI.
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
static bool
vectorizable_mask_load_store (gimple *stmt, gimple_stmt_iterator *gsi,
gimple **vec_stmt, slp_tree slp_node)
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
{
tree vec_dest = NULL;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
stmt_vec_info prev_stmt_info;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
bool nested_in_vect_loop = nested_in_vect_loop_p (loop, stmt);
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
tree rhs_vectype = NULL_TREE;
tree mask_vectype;
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
tree elem_type;
gimple *new_stmt;
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
tree dummy;
tree dataref_ptr = NULL_TREE;
gimple *ptr_incr;
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
int ncopies;
int i, j;
bool inv_p;
gather_scatter_info gs_info;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vec_load_store_type vls_type;
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
tree mask;
gimple *def_stmt;
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
enum vect_def_type dt;
if (slp_node != NULL)
return false;
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
mask = gimple_call_arg (stmt, 2);
if (!VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (mask)))
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
return false;
/* FORNOW. This restriction should be relaxed. */
if (nested_in_vect_loop && ncopies > 1)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"multiple types in nested loop.");
return false;
}
if (!STMT_VINFO_RELEVANT_P (stmt_info))
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& ! vec_stmt)
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
return false;
if (!STMT_VINFO_DATA_REF (stmt_info))
return false;
elem_type = TREE_TYPE (vectype);
if (TREE_CODE (mask) != SSA_NAME)
return false;
if (!vect_is_simple_use (mask, loop_vinfo, &def_stmt, &dt, &mask_vectype))
return false;
if (!mask_vectype)
mask_vectype = get_mask_type_for_scalar_type (TREE_TYPE (vectype));
if (!mask_vectype || !VECTOR_BOOLEAN_TYPE_P (mask_vectype)
|| TYPE_VECTOR_SUBPARTS (mask_vectype) != TYPE_VECTOR_SUBPARTS (vectype))
return false;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (gimple_call_internal_fn (stmt) == IFN_MASK_STORE)
{
tree rhs = gimple_call_arg (stmt, 3);
if (!vect_is_simple_use (rhs, loop_vinfo, &def_stmt, &dt, &rhs_vectype))
return false;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (dt == vect_constant_def || dt == vect_external_def)
vls_type = VLS_STORE_INVARIANT;
else
vls_type = VLS_STORE;
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
else
vls_type = VLS_LOAD;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vect_memory_access_type memory_access_type;
if (!get_load_store_type (stmt, vectype, false, vls_type, ncopies,
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
&memory_access_type, &gs_info))
return false;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_GATHER_SCATTER)
{
tree arglist = TYPE_ARG_TYPES (TREE_TYPE (gs_info.decl));
tree masktype
= TREE_VALUE (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (arglist))));
if (TREE_CODE (masktype) == INTEGER_TYPE)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"masked gather with integer mask not supported.");
return false;
}
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
else if (memory_access_type != VMAT_CONTIGUOUS)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"unsupported access type for masked %s.\n",
vls_type == VLS_LOAD ? "load" : "store");
return false;
}
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
else if (!VECTOR_MODE_P (TYPE_MODE (vectype))
|| !can_vec_mask_load_store_p (TYPE_MODE (vectype),
TYPE_MODE (mask_vectype),
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vls_type == VLS_LOAD)
|| (rhs_vectype
&& !useless_type_conversion_p (vectype, rhs_vectype)))
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
return false;
if (!vec_stmt) /* transformation not required. */
{
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
STMT_VINFO_MEMORY_ACCESS_TYPE (stmt_info) = memory_access_type;
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
STMT_VINFO_TYPE (stmt_info) = call_vec_info_type;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (vls_type == VLS_LOAD)
vect_model_load_cost (stmt_info, ncopies, memory_access_type,
NULL, NULL, NULL);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
else
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vect_model_store_cost (stmt_info, ncopies, memory_access_type,
dt, NULL, NULL, NULL);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
return true;
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
gcc_assert (memory_access_type == STMT_VINFO_MEMORY_ACCESS_TYPE (stmt_info));
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
/** Transform. **/
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_GATHER_SCATTER)
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
{
tree vec_oprnd0 = NULL_TREE, op;
tree arglist = TYPE_ARG_TYPES (TREE_TYPE (gs_info.decl));
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
tree rettype, srctype, ptrtype, idxtype, masktype, scaletype;
tree ptr, vec_mask = NULL_TREE, mask_op = NULL_TREE, var, scale;
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
tree perm_mask = NULL_TREE, prev_res = NULL_TREE;
tree mask_perm_mask = NULL_TREE;
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
edge pe = loop_preheader_edge (loop);
gimple_seq seq;
basic_block new_bb;
enum { NARROW, NONE, WIDEN } modifier;
int gather_off_nunits = TYPE_VECTOR_SUBPARTS (gs_info.offset_vectype);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
rettype = TREE_TYPE (TREE_TYPE (gs_info.decl));
srctype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
ptrtype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
idxtype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
masktype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
scaletype = TREE_VALUE (arglist);
gcc_checking_assert (types_compatible_p (srctype, rettype)
&& types_compatible_p (srctype, masktype));
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
if (nunits == gather_off_nunits)
modifier = NONE;
else if (nunits == gather_off_nunits / 2)
{
unsigned char *sel = XALLOCAVEC (unsigned char, gather_off_nunits);
modifier = WIDEN;
for (i = 0; i < gather_off_nunits; ++i)
sel[i] = i | nunits;
perm_mask = vect_gen_perm_mask_checked (gs_info.offset_vectype, sel);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
}
else if (nunits == gather_off_nunits * 2)
{
unsigned char *sel = XALLOCAVEC (unsigned char, nunits);
modifier = NARROW;
for (i = 0; i < nunits; ++i)
sel[i] = i < gather_off_nunits
? i : i + nunits - gather_off_nunits;
perm_mask = vect_gen_perm_mask_checked (vectype, sel);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
ncopies *= 2;
for (i = 0; i < nunits; ++i)
sel[i] = i | gather_off_nunits;
mask_perm_mask = vect_gen_perm_mask_checked (masktype, sel);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
}
else
gcc_unreachable ();
vec_dest = vect_create_destination_var (gimple_call_lhs (stmt), vectype);
ptr = fold_convert (ptrtype, gs_info.base);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
if (!is_gimple_min_invariant (ptr))
{
ptr = force_gimple_operand (ptr, &seq, true, NULL_TREE);
new_bb = gsi_insert_seq_on_edge_immediate (pe, seq);
gcc_assert (!new_bb);
}
scale = build_int_cst (scaletype, gs_info.scale);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
prev_stmt_info = NULL;
for (j = 0; j < ncopies; ++j)
{
if (modifier == WIDEN && (j & 1))
op = permute_vec_elements (vec_oprnd0, vec_oprnd0,
perm_mask, stmt, gsi);
else if (j == 0)
op = vec_oprnd0
= vect_get_vec_def_for_operand (gs_info.offset, stmt);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
else
op = vec_oprnd0
= vect_get_vec_def_for_stmt_copy (gs_info.offset_dt, vec_oprnd0);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
if (!useless_type_conversion_p (idxtype, TREE_TYPE (op)))
{
gcc_assert (TYPE_VECTOR_SUBPARTS (TREE_TYPE (op))
== TYPE_VECTOR_SUBPARTS (idxtype));
var = vect_get_new_ssa_name (idxtype, vect_simple_var);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
op = build1 (VIEW_CONVERT_EXPR, idxtype, op);
new_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
= gimple_build_assign (var, VIEW_CONVERT_EXPR, op);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
op = var;
}
if (mask_perm_mask && (j & 1))
mask_op = permute_vec_elements (mask_op, mask_op,
mask_perm_mask, stmt, gsi);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
else
{
if (j == 0)
vec_mask = vect_get_vec_def_for_operand (mask, stmt);
else
{
vect_is_simple_use (vec_mask, loop_vinfo, &def_stmt, &dt);
vec_mask = vect_get_vec_def_for_stmt_copy (dt, vec_mask);
}
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
mask_op = vec_mask;
if (!useless_type_conversion_p (masktype, TREE_TYPE (vec_mask)))
{
gcc_assert (TYPE_VECTOR_SUBPARTS (TREE_TYPE (mask_op))
== TYPE_VECTOR_SUBPARTS (masktype));
var = vect_get_new_ssa_name (masktype, vect_simple_var);
mask_op = build1 (VIEW_CONVERT_EXPR, masktype, mask_op);
new_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
= gimple_build_assign (var, VIEW_CONVERT_EXPR, mask_op);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
mask_op = var;
}
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
}
new_stmt
= gimple_build_call (gs_info.decl, 5, mask_op, ptr, op, mask_op,
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
scale);
if (!useless_type_conversion_p (vectype, rettype))
{
gcc_assert (TYPE_VECTOR_SUBPARTS (vectype)
== TYPE_VECTOR_SUBPARTS (rettype));
op = vect_get_new_ssa_name (rettype, vect_simple_var);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
gimple_call_set_lhs (new_stmt, op);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
var = make_ssa_name (vec_dest);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
op = build1 (VIEW_CONVERT_EXPR, vectype, op);
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 (var, VIEW_CONVERT_EXPR, op);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
}
else
{
var = make_ssa_name (vec_dest, new_stmt);
gimple_call_set_lhs (new_stmt, var);
}
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (modifier == NARROW)
{
if ((j & 1) == 0)
{
prev_res = var;
continue;
}
var = permute_vec_elements (prev_res, var,
perm_mask, stmt, gsi);
new_stmt = SSA_NAME_DEF_STMT (var);
}
if (prev_stmt_info == NULL)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
/* Ensure that even with -fno-tree-dce the scalar MASK_LOAD is removed
from the IL. */
if (STMT_VINFO_RELATED_STMT (stmt_info))
{
stmt = STMT_VINFO_RELATED_STMT (stmt_info);
stmt_info = vinfo_for_stmt (stmt);
}
tree lhs = gimple_call_lhs (stmt);
new_stmt = gimple_build_assign (lhs, build_zero_cst (TREE_TYPE (lhs)));
set_vinfo_for_stmt (new_stmt, stmt_info);
set_vinfo_for_stmt (stmt, NULL);
STMT_VINFO_STMT (stmt_info) = new_stmt;
gsi_replace (gsi, new_stmt, true);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
return true;
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
else if (vls_type != VLS_LOAD)
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
{
tree vec_rhs = NULL_TREE, vec_mask = NULL_TREE;
prev_stmt_info = NULL;
LOOP_VINFO_HAS_MASK_STORE (loop_vinfo) = true;
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
for (i = 0; i < ncopies; i++)
{
unsigned align, misalign;
if (i == 0)
{
tree rhs = gimple_call_arg (stmt, 3);
vec_rhs = vect_get_vec_def_for_operand (rhs, stmt);
vec_mask = vect_get_vec_def_for_operand (mask, stmt);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
/* We should have catched mismatched types earlier. */
gcc_assert (useless_type_conversion_p (vectype,
TREE_TYPE (vec_rhs)));
dataref_ptr = vect_create_data_ref_ptr (stmt, vectype, NULL,
NULL_TREE, &dummy, gsi,
&ptr_incr, false, &inv_p);
gcc_assert (!inv_p);
}
else
{
vect_is_simple_use (vec_rhs, loop_vinfo, &def_stmt, &dt);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
vec_rhs = vect_get_vec_def_for_stmt_copy (dt, vec_rhs);
vect_is_simple_use (vec_mask, loop_vinfo, &def_stmt, &dt);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
vec_mask = vect_get_vec_def_for_stmt_copy (dt, vec_mask);
dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
TYPE_SIZE_UNIT (vectype));
}
align = TYPE_ALIGN_UNIT (vectype);
if (aligned_access_p (dr))
misalign = 0;
else if (DR_MISALIGNMENT (dr) == -1)
{
align = TYPE_ALIGN_UNIT (elem_type);
misalign = 0;
}
else
misalign = DR_MISALIGNMENT (dr);
set_ptr_info_alignment (get_ptr_info (dataref_ptr), align,
misalign);
tree ptr = build_int_cst (TREE_TYPE (gimple_call_arg (stmt, 1)),
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
misalign ? least_bit_hwi (misalign) : align);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
new_stmt
= gimple_build_call_internal (IFN_MASK_STORE, 4, dataref_ptr,
ptr, vec_mask, vec_rhs);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (i == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
}
else
{
tree vec_mask = NULL_TREE;
prev_stmt_info = NULL;
vec_dest = vect_create_destination_var (gimple_call_lhs (stmt), vectype);
for (i = 0; i < ncopies; i++)
{
unsigned align, misalign;
if (i == 0)
{
vec_mask = vect_get_vec_def_for_operand (mask, stmt);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
dataref_ptr = vect_create_data_ref_ptr (stmt, vectype, NULL,
NULL_TREE, &dummy, gsi,
&ptr_incr, false, &inv_p);
gcc_assert (!inv_p);
}
else
{
vect_is_simple_use (vec_mask, loop_vinfo, &def_stmt, &dt);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
vec_mask = vect_get_vec_def_for_stmt_copy (dt, vec_mask);
dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
TYPE_SIZE_UNIT (vectype));
}
align = TYPE_ALIGN_UNIT (vectype);
if (aligned_access_p (dr))
misalign = 0;
else if (DR_MISALIGNMENT (dr) == -1)
{
align = TYPE_ALIGN_UNIT (elem_type);
misalign = 0;
}
else
misalign = DR_MISALIGNMENT (dr);
set_ptr_info_alignment (get_ptr_info (dataref_ptr), align,
misalign);
tree ptr = build_int_cst (TREE_TYPE (gimple_call_arg (stmt, 1)),
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
misalign ? least_bit_hwi (misalign) : align);
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
new_stmt
= gimple_build_call_internal (IFN_MASK_LOAD, 3, dataref_ptr,
ptr, vec_mask);
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
gimple_call_set_lhs (new_stmt, make_ssa_name (vec_dest));
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (i == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (vls_type == VLS_LOAD)
{
/* Ensure that even with -fno-tree-dce the scalar MASK_LOAD is removed
from the IL. */
if (STMT_VINFO_RELATED_STMT (stmt_info))
{
stmt = STMT_VINFO_RELATED_STMT (stmt_info);
stmt_info = vinfo_for_stmt (stmt);
}
tree lhs = gimple_call_lhs (stmt);
new_stmt = gimple_build_assign (lhs, build_zero_cst (TREE_TYPE (lhs)));
set_vinfo_for_stmt (new_stmt, stmt_info);
set_vinfo_for_stmt (stmt, NULL);
STMT_VINFO_STMT (stmt_info) = new_stmt;
gsi_replace (gsi, new_stmt, true);
}
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
return true;
}
/* Check and perform vectorization of BUILT_IN_BSWAP{16,32,64}. */
static bool
vectorizable_bswap (gimple *stmt, gimple_stmt_iterator *gsi,
gimple **vec_stmt, slp_tree slp_node,
tree vectype_in, enum vect_def_type *dt)
{
tree op, vectype;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
unsigned ncopies, nunits;
op = gimple_call_arg (stmt, 0);
vectype = STMT_VINFO_VECTYPE (stmt_info);
nunits = TYPE_VECTOR_SUBPARTS (vectype);
/* Multiple types in SLP are handled by creating the appropriate number of
vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
case of SLP. */
if (slp_node)
ncopies = 1;
else
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
tree char_vectype = get_same_sized_vectype (char_type_node, vectype_in);
if (! char_vectype)
return false;
unsigned char *elts
= XALLOCAVEC (unsigned char, TYPE_VECTOR_SUBPARTS (char_vectype));
unsigned char *elt = elts;
unsigned word_bytes = TYPE_VECTOR_SUBPARTS (char_vectype) / nunits;
for (unsigned i = 0; i < nunits; ++i)
for (unsigned j = 0; j < word_bytes; ++j)
*elt++ = (i + 1) * word_bytes - j - 1;
if (! can_vec_perm_p (TYPE_MODE (char_vectype), false, elts))
return false;
if (! vec_stmt)
{
STMT_VINFO_TYPE (stmt_info) = call_vec_info_type;
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location, "=== vectorizable_bswap ==="
"\n");
if (! PURE_SLP_STMT (stmt_info))
{
add_stmt_cost (stmt_info->vinfo->target_cost_data,
1, vector_stmt, stmt_info, 0, vect_prologue);
add_stmt_cost (stmt_info->vinfo->target_cost_data,
ncopies, vec_perm, stmt_info, 0, vect_body);
}
return true;
}
tree *telts = XALLOCAVEC (tree, TYPE_VECTOR_SUBPARTS (char_vectype));
for (unsigned i = 0; i < TYPE_VECTOR_SUBPARTS (char_vectype); ++i)
telts[i] = build_int_cst (char_type_node, elts[i]);
tree bswap_vconst = build_vector (char_vectype, telts);
/* Transform. */
vec<tree> vec_oprnds = vNULL;
gimple *new_stmt = NULL;
stmt_vec_info prev_stmt_info = NULL;
for (unsigned j = 0; j < ncopies; j++)
{
/* Handle uses. */
if (j == 0)
vect_get_vec_defs (op, NULL, stmt, &vec_oprnds, NULL, slp_node, -1);
else
vect_get_vec_defs_for_stmt_copy (dt, &vec_oprnds, NULL);
/* Arguments are ready. create the new vector stmt. */
unsigned i;
tree vop;
FOR_EACH_VEC_ELT (vec_oprnds, i, vop)
{
tree tem = make_ssa_name (char_vectype);
new_stmt = gimple_build_assign (tem, build1 (VIEW_CONVERT_EXPR,
char_vectype, vop));
vect_finish_stmt_generation (stmt, new_stmt, gsi);
tree tem2 = make_ssa_name (char_vectype);
new_stmt = gimple_build_assign (tem2, VEC_PERM_EXPR,
tem, tem, bswap_vconst);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
tem = make_ssa_name (vectype);
new_stmt = gimple_build_assign (tem, build1 (VIEW_CONVERT_EXPR,
vectype, tem2));
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (slp_node)
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
}
if (slp_node)
continue;
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
vec_oprnds.release ();
return true;
}
/* Return true if vector types VECTYPE_IN and VECTYPE_OUT have
integer elements and if we can narrow VECTYPE_IN to VECTYPE_OUT
in a single step. On success, store the binary pack code in
*CONVERT_CODE. */
static bool
simple_integer_narrowing (tree vectype_out, tree vectype_in,
tree_code *convert_code)
{
if (!INTEGRAL_TYPE_P (TREE_TYPE (vectype_out))
|| !INTEGRAL_TYPE_P (TREE_TYPE (vectype_in)))
return false;
tree_code code;
int multi_step_cvt = 0;
auto_vec <tree, 8> interm_types;
if (!supportable_narrowing_operation (NOP_EXPR, vectype_out, vectype_in,
&code, &multi_step_cvt,
&interm_types)
|| multi_step_cvt)
return false;
*convert_code = code;
return true;
}
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function vectorizable_call.
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
Check if GS performs a function call that can be vectorized.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt to replace it, put it in VEC_STMT, and insert it at BSI.
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
static bool
vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt,
slp_tree slp_node)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +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
gcall *stmt;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree vec_dest;
tree scalar_dest;
tree op, type;
tree vec_oprnd0 = NULL_TREE, vec_oprnd1 = NULL_TREE;
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
stmt_vec_info stmt_info = vinfo_for_stmt (gs), prev_stmt_info;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree vectype_out, vectype_in;
int nunits_in;
int nunits_out;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
vec_info *vinfo = stmt_info->vinfo;
tree fndecl, new_temp, rhs_type;
gimple *def_stmt;
enum vect_def_type dt[3]
= {vect_unknown_def_type, vect_unknown_def_type, vect_unknown_def_type};
gimple *new_stmt = NULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
int ncopies, j;
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
vec<tree> vargs = vNULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum { NARROW, NONE, WIDEN } modifier;
size_t i, nargs;
tree lhs;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& ! vec_stmt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
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
/* Is GS a vectorizable call? */
stmt = dyn_cast <gcall *> (gs);
if (!stmt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
if (gimple_call_internal_p (stmt)
&& (gimple_call_internal_fn (stmt) == IFN_MASK_LOAD
|| gimple_call_internal_fn (stmt) == IFN_MASK_STORE))
return vectorizable_mask_load_store (stmt, gsi, vec_stmt,
slp_node);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
if (gimple_call_lhs (stmt) == NULL_TREE
|| TREE_CODE (gimple_call_lhs (stmt)) != SSA_NAME)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
gcc_checking_assert (!stmt_can_throw_internal (stmt));
vectype_out = STMT_VINFO_VECTYPE (stmt_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Process function arguments. */
rhs_type = NULL_TREE;
vectype_in = NULL_TREE;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
nargs = gimple_call_num_args (stmt);
2010-10-15 19:42:05 +02:00
/* Bail out if the function has more than three arguments, we do not have
interesting builtin functions to vectorize with more than two arguments
except for fma. No arguments is also not good. */
if (nargs == 0 || nargs > 3)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
/* Ignore the argument of IFN_GOMP_SIMD_LANE, it is magic. */
if (gimple_call_internal_p (stmt)
&& gimple_call_internal_fn (stmt) == IFN_GOMP_SIMD_LANE)
{
nargs = 0;
rhs_type = unsigned_type_node;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
for (i = 0; i < nargs; i++)
{
tree opvectype;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
op = gimple_call_arg (stmt, i);
/* We can only handle calls with arguments of the same type. */
if (rhs_type
&& !types_compatible_p (rhs_type, TREE_TYPE (op)))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"argument types differ.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
if (!rhs_type)
rhs_type = TREE_TYPE (op);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (!vect_is_simple_use (op, vinfo, &def_stmt, &dt[i], &opvectype))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"use not simple.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
if (!vectype_in)
vectype_in = opvectype;
else if (opvectype
&& opvectype != vectype_in)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"argument vector types differ.\n");
return false;
}
}
/* If all arguments are external or constant defs use a vector type with
the same size as the output vector type. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (!vectype_in)
vectype_in = get_same_sized_vectype (rhs_type, vectype_out);
if (vec_stmt)
gcc_assert (vectype_in);
if (!vectype_in)
{
if (dump_enabled_p ())
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"no vectype for scalar type ");
dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, rhs_type);
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* FORNOW */
nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (nunits_in == nunits_out / 2)
modifier = NARROW;
else if (nunits_out == nunits_in)
modifier = NONE;
else if (nunits_out == nunits_in / 2)
modifier = WIDEN;
else
return false;
/* We only handle functions that do not read or clobber memory. */
if (gimple_vuse (stmt))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"function reads from or writes to memory.\n");
return false;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* For now, we only vectorize functions if a target specific builtin
is available. TODO -- in some cases, it might be profitable to
insert the calls for pieces of the vector, in order to be able
to vectorize other operations in the loop. */
fndecl = NULL_TREE;
internal_fn ifn = IFN_LAST;
combined_fn cfn = gimple_call_combined_fn (stmt);
tree callee = gimple_call_fndecl (stmt);
/* First try using an internal function. */
tree_code convert_code = ERROR_MARK;
if (cfn != CFN_LAST
&& (modifier == NONE
|| (modifier == NARROW
&& simple_integer_narrowing (vectype_out, vectype_in,
&convert_code))))
ifn = vectorizable_internal_function (cfn, callee, vectype_out,
vectype_in);
/* If that fails, try asking for a target-specific built-in function. */
if (ifn == IFN_LAST)
{
if (cfn != CFN_LAST)
fndecl = targetm.vectorize.builtin_vectorized_function
(cfn, vectype_out, vectype_in);
else
fndecl = targetm.vectorize.builtin_md_vectorized_function
(callee, vectype_out, vectype_in);
}
if (ifn == IFN_LAST && !fndecl)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (cfn == CFN_GOMP_SIMD_LANE
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
&& !slp_node
&& loop_vinfo
&& LOOP_VINFO_LOOP (loop_vinfo)->simduid
&& TREE_CODE (gimple_call_arg (stmt, 0)) == SSA_NAME
&& LOOP_VINFO_LOOP (loop_vinfo)->simduid
== SSA_NAME_VAR (gimple_call_arg (stmt, 0)))
{
/* We can handle IFN_GOMP_SIMD_LANE by returning a
{ 0, 1, 2, ... vf - 1 } vector. */
gcc_assert (nargs == 0);
}
else if (modifier == NONE
&& (gimple_call_builtin_p (stmt, BUILT_IN_BSWAP16)
|| gimple_call_builtin_p (stmt, BUILT_IN_BSWAP32)
|| gimple_call_builtin_p (stmt, BUILT_IN_BSWAP64)))
return vectorizable_bswap (stmt, gsi, vec_stmt, slp_node,
vectype_in, dt);
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
else
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"function is not vectorizable.\n");
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
return false;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
if (slp_node)
ncopies = 1;
else if (modifier == NARROW && ifn == IFN_LAST)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_out;
else
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
/* Sanity check: make sure that at least one copy of the vectorized stmt
needs to be generated. */
gcc_assert (ncopies >= 1);
if (!vec_stmt) /* transformation not required. */
{
STMT_VINFO_TYPE (stmt_info) = call_vec_info_type;
if (dump_enabled_p ())
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf_loc (MSG_NOTE, vect_location, "=== vectorizable_call ==="
"\n");
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
vect_model_simple_cost (stmt_info, ncopies, dt, NULL, NULL);
if (ifn != IFN_LAST && modifier == NARROW && !slp_node)
add_stmt_cost (stmt_info->vinfo->target_cost_data, ncopies / 2,
vec_promote_demote, stmt_info, 0, vect_body);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
/** Transform. **/
if (dump_enabled_p ())
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf_loc (MSG_NOTE, vect_location, "transform call.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Handle def. */
scalar_dest = gimple_call_lhs (stmt);
vec_dest = vect_create_destination_var (scalar_dest, vectype_out);
prev_stmt_info = NULL;
if (modifier == NONE || ifn != IFN_LAST)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree prev_res = NULL_TREE;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
for (j = 0; j < ncopies; ++j)
{
/* Build argument list for the vectorized call. */
if (j == 0)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.create (nargs);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.truncate (0);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (slp_node)
{
auto_vec<vec<tree> > vec_defs (nargs);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> vec_oprnds0;
for (i = 0; i < nargs; i++)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.quick_push (gimple_call_arg (stmt, i));
vect_get_slp_defs (vargs, slp_node, &vec_defs, -1);
vec_oprnds0 = vec_defs[0];
/* Arguments are ready. Create the new vector stmt. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (vec_oprnds0, i, vec_oprnd0)
{
size_t k;
for (k = 0; k < nargs; k++)
{
vec<tree> vec_oprndsk = vec_defs[k];
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs[k] = vec_oprndsk[i];
}
if (modifier == NARROW)
{
tree half_res = make_ssa_name (vectype_in);
new_stmt = gimple_build_call_internal_vec (ifn, vargs);
gimple_call_set_lhs (new_stmt, half_res);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if ((i & 1) == 0)
{
prev_res = half_res;
continue;
}
new_temp = make_ssa_name (vec_dest);
new_stmt = gimple_build_assign (new_temp, convert_code,
prev_res, half_res);
}
else
{
if (ifn != IFN_LAST)
new_stmt = gimple_build_call_internal_vec (ifn, vargs);
else
new_stmt = gimple_build_call_vec (fndecl, vargs);
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_call_set_lhs (new_stmt, new_temp);
}
vect_finish_stmt_generation (stmt, new_stmt, gsi);
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
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
}
for (i = 0; i < nargs; i++)
{
vec<tree> vec_oprndsi = vec_defs[i];
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprndsi.release ();
}
continue;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
for (i = 0; i < nargs; i++)
{
op = gimple_call_arg (stmt, i);
if (j == 0)
vec_oprnd0
= vect_get_vec_def_for_operand (op, stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
{
vec_oprnd0 = gimple_call_arg (new_stmt, i);
vec_oprnd0
= vect_get_vec_def_for_stmt_copy (dt[i], vec_oprnd0);
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.quick_push (vec_oprnd0);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
if (gimple_call_internal_p (stmt)
&& gimple_call_internal_fn (stmt) == IFN_GOMP_SIMD_LANE)
{
tree *v = XALLOCAVEC (tree, nunits_out);
int k;
for (k = 0; k < nunits_out; ++k)
v[k] = build_int_cst (unsigned_type_node, j * nunits_out + k);
tree cst = build_vector (vectype_out, v);
tree new_var
= vect_get_new_ssa_name (vectype_out, vect_simple_var, "cst_");
gimple *init_stmt = gimple_build_assign (new_var, cst);
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
vect_init_vector_1 (stmt, init_stmt, NULL);
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
new_temp = make_ssa_name (vec_dest);
new_stmt = gimple_build_assign (new_temp, new_var);
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
}
else if (modifier == NARROW)
{
tree half_res = make_ssa_name (vectype_in);
new_stmt = gimple_build_call_internal_vec (ifn, vargs);
gimple_call_set_lhs (new_stmt, half_res);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if ((j & 1) == 0)
{
prev_res = half_res;
continue;
}
new_temp = make_ssa_name (vec_dest);
new_stmt = gimple_build_assign (new_temp, convert_code,
prev_res, half_res);
}
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
else
{
if (ifn != IFN_LAST)
new_stmt = gimple_build_call_internal_vec (ifn, vargs);
else
new_stmt = gimple_build_call_vec (fndecl, vargs);
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_call_set_lhs (new_stmt, new_temp);
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (j == (modifier == NARROW ? 1 : 0))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
}
else if (modifier == NARROW)
{
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
for (j = 0; j < ncopies; ++j)
{
/* Build argument list for the vectorized call. */
if (j == 0)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.create (nargs * 2);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.truncate (0);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (slp_node)
{
auto_vec<vec<tree> > vec_defs (nargs);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> vec_oprnds0;
for (i = 0; i < nargs; i++)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.quick_push (gimple_call_arg (stmt, i));
vect_get_slp_defs (vargs, slp_node, &vec_defs, -1);
vec_oprnds0 = vec_defs[0];
/* Arguments are ready. Create the new vector stmt. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
for (i = 0; vec_oprnds0.iterate (i, &vec_oprnd0); i += 2)
{
size_t k;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.truncate (0);
for (k = 0; k < nargs; k++)
{
vec<tree> vec_oprndsk = vec_defs[k];
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.quick_push (vec_oprndsk[i]);
vargs.quick_push (vec_oprndsk[i + 1]);
}
if (ifn != IFN_LAST)
new_stmt = gimple_build_call_internal_vec (ifn, vargs);
else
new_stmt = gimple_build_call_vec (fndecl, vargs);
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_call_set_lhs (new_stmt, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
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
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
}
for (i = 0; i < nargs; i++)
{
vec<tree> vec_oprndsi = vec_defs[i];
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprndsi.release ();
}
continue;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
for (i = 0; i < nargs; i++)
{
op = gimple_call_arg (stmt, i);
if (j == 0)
{
vec_oprnd0
= vect_get_vec_def_for_operand (op, stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vec_oprnd1
= vect_get_vec_def_for_stmt_copy (dt[i], vec_oprnd0);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
else
{
vec_oprnd1 = gimple_call_arg (new_stmt, 2*i + 1);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vec_oprnd0
= vect_get_vec_def_for_stmt_copy (dt[i], vec_oprnd1);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vec_oprnd1
= vect_get_vec_def_for_stmt_copy (dt[i], vec_oprnd0);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.quick_push (vec_oprnd0);
vargs.quick_push (vec_oprnd1);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
new_stmt = gimple_build_call_vec (fndecl, vargs);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_call_set_lhs (new_stmt, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
}
else
/* No current target implements this case. */
return false;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.release ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* The call in STMT might prevent it from being removed in dce.
We however cannot remove it here, due to the way the ssa name
it defines is mapped to the new definition. So just replace
rhs of the statement with something harmless. */
if (slp_node)
return true;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
type = TREE_TYPE (scalar_dest);
if (is_pattern_stmt_p (stmt_info))
lhs = gimple_call_lhs (STMT_VINFO_RELATED_STMT (stmt_info));
else
lhs = gimple_call_lhs (stmt);
new_stmt = gimple_build_assign (lhs, build_zero_cst (type));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
set_vinfo_for_stmt (new_stmt, stmt_info);
set_vinfo_for_stmt (stmt, NULL);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
STMT_VINFO_STMT (stmt_info) = new_stmt;
gsi_replace (gsi, new_stmt, false);
return true;
}
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
struct simd_call_arg_info
{
tree vectype;
tree op;
HOST_WIDE_INT linear_step;
enum vect_def_type dt;
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
unsigned int align;
bool simd_lane_linear;
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
};
/* Helper function of vectorizable_simd_clone_call. If OP, an SSA_NAME,
is linear within simd lane (but not within whole loop), note it in
*ARGINFO. */
static void
vect_simd_lane_linear (tree op, struct loop *loop,
struct simd_call_arg_info *arginfo)
{
gimple *def_stmt = SSA_NAME_DEF_STMT (op);
if (!is_gimple_assign (def_stmt)
|| gimple_assign_rhs_code (def_stmt) != POINTER_PLUS_EXPR
|| !is_gimple_min_invariant (gimple_assign_rhs1 (def_stmt)))
return;
tree base = gimple_assign_rhs1 (def_stmt);
HOST_WIDE_INT linear_step = 0;
tree v = gimple_assign_rhs2 (def_stmt);
while (TREE_CODE (v) == SSA_NAME)
{
tree t;
def_stmt = SSA_NAME_DEF_STMT (v);
if (is_gimple_assign (def_stmt))
switch (gimple_assign_rhs_code (def_stmt))
{
case PLUS_EXPR:
t = gimple_assign_rhs2 (def_stmt);
if (linear_step || TREE_CODE (t) != INTEGER_CST)
return;
base = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (base), base, t);
v = gimple_assign_rhs1 (def_stmt);
continue;
case MULT_EXPR:
t = gimple_assign_rhs2 (def_stmt);
if (linear_step || !tree_fits_shwi_p (t) || integer_zerop (t))
return;
linear_step = tree_to_shwi (t);
v = gimple_assign_rhs1 (def_stmt);
continue;
CASE_CONVERT:
t = gimple_assign_rhs1 (def_stmt);
if (TREE_CODE (TREE_TYPE (t)) != INTEGER_TYPE
|| (TYPE_PRECISION (TREE_TYPE (v))
< TYPE_PRECISION (TREE_TYPE (t))))
return;
if (!linear_step)
linear_step = 1;
v = t;
continue;
default:
return;
}
else if (gimple_call_internal_p (def_stmt, IFN_GOMP_SIMD_LANE)
&& loop->simduid
&& TREE_CODE (gimple_call_arg (def_stmt, 0)) == SSA_NAME
&& (SSA_NAME_VAR (gimple_call_arg (def_stmt, 0))
== loop->simduid))
{
if (!linear_step)
linear_step = 1;
arginfo->linear_step = linear_step;
arginfo->op = base;
arginfo->simd_lane_linear = true;
return;
}
}
}
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
/* Function vectorizable_simd_clone_call.
Check if STMT performs a function call that can be vectorized
by calling a simd clone of the function.
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
stmt to replace it, put it in VEC_STMT, and insert it at BSI.
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
static bool
vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
gimple **vec_stmt, slp_tree slp_node)
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
{
tree vec_dest;
tree scalar_dest;
tree op, type;
tree vec_oprnd0 = NULL_TREE;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt), prev_stmt_info;
tree vectype;
unsigned int nunits;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
vec_info *vinfo = stmt_info->vinfo;
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
struct loop *loop = loop_vinfo ? LOOP_VINFO_LOOP (loop_vinfo) : NULL;
tree fndecl, new_temp;
gimple *def_stmt;
gimple *new_stmt = NULL;
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
int ncopies, j;
auto_vec<simd_call_arg_info> arginfo;
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
vec<tree> vargs = vNULL;
size_t i, nargs;
tree lhs, rtype, ratype;
vec<constructor_elt, va_gc> *ret_ctor_elts;
/* Is STMT a vectorizable call? */
if (!is_gimple_call (stmt))
return false;
fndecl = gimple_call_fndecl (stmt);
if (fndecl == NULL_TREE)
return false;
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
struct cgraph_node *node = cgraph_node::get (fndecl);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
if (node == NULL || node->simd_clones == NULL)
return false;
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& ! vec_stmt)
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
return false;
if (gimple_call_lhs (stmt)
&& TREE_CODE (gimple_call_lhs (stmt)) != SSA_NAME)
return false;
gcc_checking_assert (!stmt_can_throw_internal (stmt));
vectype = STMT_VINFO_VECTYPE (stmt_info);
if (loop_vinfo && nested_in_vect_loop_p (loop, stmt))
return false;
/* FORNOW */
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
if (slp_node)
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
return false;
/* Process function arguments. */
nargs = gimple_call_num_args (stmt);
/* Bail out if the function has zero arguments. */
if (nargs == 0)
return false;
arginfo.reserve (nargs, true);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
for (i = 0; i < nargs; i++)
{
simd_call_arg_info thisarginfo;
affine_iv iv;
thisarginfo.linear_step = 0;
thisarginfo.align = 0;
thisarginfo.op = NULL_TREE;
thisarginfo.simd_lane_linear = false;
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
op = gimple_call_arg (stmt, i);
if (!vect_is_simple_use (op, vinfo, &def_stmt, &thisarginfo.dt,
&thisarginfo.vectype)
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
|| thisarginfo.dt == vect_uninitialized_def)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"use not simple.\n");
return false;
}
if (thisarginfo.dt == vect_constant_def
|| thisarginfo.dt == vect_external_def)
gcc_assert (thisarginfo.vectype == NULL_TREE);
else
gcc_assert (thisarginfo.vectype != NULL_TREE);
/* For linear arguments, the analyze phase should have saved
the base and step in STMT_VINFO_SIMD_CLONE_INFO. */
if (i * 3 + 4 <= STMT_VINFO_SIMD_CLONE_INFO (stmt_info).length ()
&& STMT_VINFO_SIMD_CLONE_INFO (stmt_info)[i * 3 + 2])
{
gcc_assert (vec_stmt);
thisarginfo.linear_step
= tree_to_shwi (STMT_VINFO_SIMD_CLONE_INFO (stmt_info)[i * 3 + 2]);
thisarginfo.op
= STMT_VINFO_SIMD_CLONE_INFO (stmt_info)[i * 3 + 1];
thisarginfo.simd_lane_linear
= (STMT_VINFO_SIMD_CLONE_INFO (stmt_info)[i * 3 + 3]
== boolean_true_node);
/* If loop has been peeled for alignment, we need to adjust it. */
tree n1 = LOOP_VINFO_NITERS_UNCHANGED (loop_vinfo);
tree n2 = LOOP_VINFO_NITERS (loop_vinfo);
if (n1 != n2 && !thisarginfo.simd_lane_linear)
{
tree bias = fold_build2 (MINUS_EXPR, TREE_TYPE (n1), n1, n2);
tree step = STMT_VINFO_SIMD_CLONE_INFO (stmt_info)[i * 3 + 2];
tree opt = TREE_TYPE (thisarginfo.op);
bias = fold_convert (TREE_TYPE (step), bias);
bias = fold_build2 (MULT_EXPR, TREE_TYPE (step), bias, step);
thisarginfo.op
= fold_build2 (POINTER_TYPE_P (opt)
? POINTER_PLUS_EXPR : PLUS_EXPR, opt,
thisarginfo.op, bias);
}
}
else if (!vec_stmt
&& thisarginfo.dt != vect_constant_def
&& thisarginfo.dt != vect_external_def
&& loop_vinfo
&& TREE_CODE (op) == SSA_NAME
&& simple_iv (loop, loop_containing_stmt (stmt), op,
&iv, false)
&& tree_fits_shwi_p (iv.step))
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
{
thisarginfo.linear_step = tree_to_shwi (iv.step);
thisarginfo.op = iv.base;
}
else if ((thisarginfo.dt == vect_constant_def
|| thisarginfo.dt == vect_external_def)
&& POINTER_TYPE_P (TREE_TYPE (op)))
thisarginfo.align = get_pointer_alignment (op) / BITS_PER_UNIT;
/* Addresses of array elements indexed by GOMP_SIMD_LANE are
linear too. */
if (POINTER_TYPE_P (TREE_TYPE (op))
&& !thisarginfo.linear_step
&& !vec_stmt
&& thisarginfo.dt != vect_constant_def
&& thisarginfo.dt != vect_external_def
&& loop_vinfo
&& !slp_node
&& TREE_CODE (op) == SSA_NAME)
vect_simd_lane_linear (op, loop, &thisarginfo);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
arginfo.quick_push (thisarginfo);
}
unsigned int badness = 0;
struct cgraph_node *bestn = NULL;
if (STMT_VINFO_SIMD_CLONE_INFO (stmt_info).exists ())
bestn = cgraph_node::get (STMT_VINFO_SIMD_CLONE_INFO (stmt_info)[0]);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
else
for (struct cgraph_node *n = node->simd_clones; n != NULL;
n = n->simdclone->next_clone)
{
unsigned int this_badness = 0;
if (n->simdclone->simdlen
> (unsigned) LOOP_VINFO_VECT_FACTOR (loop_vinfo)
|| n->simdclone->nargs != nargs)
continue;
if (n->simdclone->simdlen
< (unsigned) LOOP_VINFO_VECT_FACTOR (loop_vinfo))
this_badness += (exact_log2 (LOOP_VINFO_VECT_FACTOR (loop_vinfo))
- exact_log2 (n->simdclone->simdlen)) * 1024;
if (n->simdclone->inbranch)
this_badness += 2048;
int target_badness = targetm.simd_clone.usable (n);
if (target_badness < 0)
continue;
this_badness += target_badness * 512;
/* FORNOW: Have to add code to add the mask argument. */
if (n->simdclone->inbranch)
continue;
for (i = 0; i < nargs; i++)
{
switch (n->simdclone->args[i].arg_type)
{
case SIMD_CLONE_ARG_TYPE_VECTOR:
if (!useless_type_conversion_p
(n->simdclone->args[i].orig_type,
TREE_TYPE (gimple_call_arg (stmt, i))))
i = -1;
else if (arginfo[i].dt == vect_constant_def
|| arginfo[i].dt == vect_external_def
|| arginfo[i].linear_step)
this_badness += 64;
break;
case SIMD_CLONE_ARG_TYPE_UNIFORM:
if (arginfo[i].dt != vect_constant_def
&& arginfo[i].dt != vect_external_def)
i = -1;
break;
case SIMD_CLONE_ARG_TYPE_LINEAR_CONSTANT_STEP:
builtin-types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR, [...]): New. gcc/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * builtin-types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR, BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR, BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR, BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR, BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL, BT_FN_VOID_LONG_VAR, BT_FN_VOID_ULL_VAR): New. (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR, BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): Remove. * cgraph.h (enum cgraph_simd_clone_arg_type): Add SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP, SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP and SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP. (struct cgraph_simd_clone_arg): Adjust comment. * coretypes.h (struct gomp_ordered): New forward decl. * gimple.c (gimple_build_omp_critical): Add CLAUSES argument, set critical clauses to it. (gimple_build_omp_ordered): Return gomp_ordered * instead of gimple *. Add CLAUSES argument, set ordered clauses to it. (gimple_copy): Unshare clauses on GIMPLE_OMP_CRITICAL and GIMPLE_OMP_ORDERED. * gimple.def (GIMPLE_OMP_ORDERED): Change from GSS_OMP to GSS_OMP_SINGLE_LAYOUT, move it after GIMPLE_OMP_TEAMS. * gimple.h (enum gf_mask): Add GF_OMP_TASK_TASKLOOP. Add another bit to GF_OMP_FOR_KIND_MASK mask. Add GF_OMP_FOR_KIND_TASKLOOP, renumber GF_OMP_FOR_KIND_CILKFOR and GF_OMP_FOR_KIND_OACC_LOOP. Adjust GF_OMP_FOR_SIMD, GF_OMP_FOR_COMBINED and GF_OMP_FOR_COMBINED_INTO. Add another bit to GF_OMP_TARGET_KIND_MASK mask. Add GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA, renumber GF_OMP_TARGET_KIND_OACC_{PARALLEL,KERNELS,DATA,UPDATE,ENTER_EXIT_DATA}. (gomp_critical): Add clauses field. (gomp_ordered): New struct. (is_a_helper <gomp_ordered *>::test): New inline. (gimple_build_omp_critical): Add CLAUSES argument. (gimple_build_omp_ordered): Likewise. Return gomp_ordered * instead of gimple *. (gimple_omp_critical_clauses, gimple_omp_critical_clauses_ptr, gimple_omp_critical_set_clauses, gimple_omp_ordered_clauses, gimple_omp_ordered_clauses_ptr, gimple_omp_ordered_set_clauses, gimple_omp_task_taskloop_p, gimple_omp_task_set_taskloop_p): New inline functions. * gimple-pretty-print.c (dump_gimple_omp_for): Handle taskloop. (dump_gimple_omp_target): Handle enter data and exit data. (dump_gimple_omp_block): Don't handle GIMPLE_OMP_ORDERED here. (dump_gimple_omp_critical): Print clauses. (dump_gimple_omp_ordered): New function. (dump_gimple_omp_task): Handle taskloop. (pp_gimple_stmt_1): Use dump_gimple_omp_ordered for GIMPLE_OMP_ORDERED. * gimple-walk.c (walk_gimple_op): Walk clauses on GIMPLE_OMP_CRITICAL and GIMPLE_OMP_ORDERED. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_0LEN_ARRAY. (enum omp_region_type): Add ORT_COMBINED_TARGET and ORT_NONE. (struct gimplify_omp_ctx): Add loop_iter_var, target_map_scalars_firstprivate, target_map_pointers_as_0len_arrays and target_firstprivatize_array_bases fields. (delete_omp_context): Release loop_iter_var. (gimplify_bind_expr): Handle ORT_NONE. (maybe_fold_stmt): Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. (is_gimple_stmt): Return true for OMP_TASKLOOP, OMP_TEAMS and OMP_TARGET{,_DATA,_UPDATE,_ENTER_DATA,_EXIT_DATA}. (omp_firstprivatize_variable): Handle ORT_NONE. Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. Handle ctx->target_map_scalars_firstprivate. (omp_add_variable): Handle ORT_NONE. Allow map clause together with data sharing clauses. For data sharing clause with VLA decl on omp target/target data don't add firstprivate for the pointer. Call omp_notice_variable on TYPE_SIZE_UNIT only if it is a DECL_P. (omp_notice_threadprivate_variable): Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. (omp_notice_variable): Handle ORT_NONE. Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. Handle implicit mapping of pointers as zero length array sections and ctx->target_map_scalars_firstprivate mapping of scalars as firstprivate data sharing. (omp_check_private): Handle omp_member_access_dummy_var vars. (find_decl_expr): New function. (gimplify_scan_omp_clauses): Add CODE argument. For OMP_CLAUSE_IF complain if OMP_CLAUSE_IF_MODIFIER is present and does not match code. Handle OMP_CLAUSE_GANG separately. Handle OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD,SIMDLEN} clauses. Diagnose linear clause on combined distribute {, parallel for} simd construct, unless it is the loop iterator. Handle struct element GOMP_MAP_FIRSTPRIVATE_POINTER. Handle map clauses with COMPONENT_REF. Initialize ctx->target_map_scalars_firstprivate, ctx->target_firstprivatize_array_bases and ctx->target_map_pointers_as_0len_arrays. Add firstprivate for linear clause even to target region if combined. Remove map clauses with GOMP_MAP_FIRSTPRIVATE_POINTER kind from OMP_TARGET_{,ENTER_,EXIT_}DATA. For GOMP_MAP_FIRSTPRIVATE_POINTER map kind with non-INTEGER_CST OMP_CLAUSE_SIZE firstprivatize the bias. Handle OMP_CLAUSE_DEPEND_{SINK,SOURCE}. Handle OMP_CLAUSE_{{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}. For linear clause on worksharing loop combined with parallel add shared clause on the parallel. Handle OMP_CLAUSE_REDUCTION with MEM_REF OMP_CLAUSE_DECL. Set DECL_NAME on omp_member_access_dummy_var vars. Add lastprivate clause to outer taskloop if needed. (gimplify_adjust_omp_clauses_1): Handle GOVD_MAP_0LEN_ARRAY. If gimplify_omp_ctxp->target_firstprivatize_array_bases, use GOMP_MAP_FIRSTPRIVATE_POINTER map kind instead of GOMP_MAP_POINTER. (gimplify_adjust_omp_clauses): Add CODE argument. Handle removal of GOMP_MAP_FIRSTPRIVATE_POINTER struct elements for struct not seen in target body. Handle removal of struct mapping if struct is not seen in target body. Remove GOMP_MAP_STRUCT map clause on OMP_TARGET_EXIT_DATA. Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. Use GOMP_MAP_FIRSTPRIVATE_POINTER instead of GOMP_MAP_POINTER if ctx->target_firstprivatize_array_bases for VLAs. Set OMP_CLAUSE_MAP_PRIVATE if both data sharing and map clause appear together. Handle OMP_CLAUSE_{{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}. Don't remove map clause if it has map-type-modifier always. Handle OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD,SIMDLEN} clauses. (gimplify_oacc_cache, gimplify_omp_parallel, gimplify_omp_task): Adjust gimplify_scan_omp_clauses and gimplify_adjust_omp_clauses callers. (gimplify_omp_for): Likewise. Handle OMP_TASKLOOP. Initialize loop_iter_var. Use OMP_FOR_ORIG_DECLS. Fix handling of lastprivate iterators in doacross loops. (gimplify_omp_workshare): Adjust gimplify_scan_omp_clauses and gimplify_adjust_omp_clauses callers. Use ORT_COMBINED_TARGET for OMP_TARGET_COMBINED. Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. (gimplify_omp_target_update): Adjust gimplify_scan_omp_clauses and gimplify_adjust_omp_clauses callers. Handle OMP_TARGET_ENTER_DATA and OMP_TARGET_EXIT_DATA. (gimplify_omp_ordered): New function. (gimplify_expr): Handle OMP_TASKLOOP, OMP_TARGET_ENTER_DATA and OMP_TARGET_EXIT_DATA. Use gimplify_omp_ordered for OMP_ORDERED. Gimplify clauses on OMP_CRITICAL. * internal-fn.c (expand_GOMP_SIMD_ORDERED_START, expand_GOMP_SIMD_ORDERED_END): New functions. * internal-fn.def (GOMP_SIMD_ORDERED_START, GOMP_SIMD_ORDERED_END): New internal functions. * omp-builtins.def (BUILT_IN_GOMP_LOOP_DOACROSS_STATIC_START, BUILT_IN_GOMP_LOOP_DOACROSS_DYNAMIC_START, BUILT_IN_GOMP_LOOP_DOACROSS_GUIDED_START, BUILT_IN_GOMP_LOOP_DOACROSS_RUNTIME_START, BUILT_IN_GOMP_LOOP_ULL_DOACROSS_STATIC_START, BUILT_IN_GOMP_LOOP_ULL_DOACROSS_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ULL_DOACROSS_GUIDED_START, BUILT_IN_GOMP_LOOP_ULL_DOACROSS_RUNTIME_START, BUILT_IN_GOMP_DOACROSS_POST, BUILT_IN_GOMP_DOACROSS_WAIT, BUILT_IN_GOMP_DOACROSS_ULL_POST, BUILT_IN_GOMP_DOACROSS_ULL_WAIT, BUILT_IN_GOMP_TARGET_ENTER_EXIT_DATA, BUILT_IN_GOMP_TASKLOOP, BUILT_IN_GOMP_TASKLOOP_ULL): New built-ins. (BUILT_IN_GOMP_TASK): Add INT argument to the end. (BUILT_IN_GOMP_TARGET): Rename from GOMP_target to GOMP_target_41, adjust type. (BUILT_IN_GOMP_TARGET_DATA): Rename from GOMP_target_data to GOMP_target_data_41, adjust type. (BUILT_IN_GOMP_TARGET_UPDATE): Rename from GOMP_target_update to GOMP_target_update_41, adjust type. * omp-low.c (struct omp_region): Adjust comments, add ord_stmt field. (struct omp_for_data): Add ordered and simd_schedule fields. (omp_member_access_dummy_var, unshare_and_remap_1, unshare_and_remap, is_taskloop_ctx): New functions. (is_taskreg_ctx): Use is_parallel_ctx and is_task_ctx. (extract_omp_for_data): Handle taskloops and doacross loops and simd schedule modifier. (omp_adjust_chunk_size): New function. (get_ws_args_for): Use it. (lookup_sfield): Change first argument to splay_tree_key, add overload with first argument tree. (maybe_lookup_field): Likewise. (use_pointer_for_field): Handle omp_member_access_dummy_var. (omp_copy_decl_2): If var is TREE_ADDRESSABLE listed in task_shared_vars, clear TREE_ADDRESSABLE on the copy. (build_outer_var_ref): Add LASTPRIVATE argument, handle taskloops and omp_member_access_dummy_var vars. (build_sender_ref): Change first argument to splay_tree_key, add overload with first argument tree. (install_var_field): For mask & 8 use &DECL_UID as key instead of the tree itself. (fixup_child_record_type): Const qualify *.omp_data_i. (scan_sharing_clauses): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE, C/C++ array reductions, OMP_CLAUSE_{IS,USE}_DEVICE_PTR clauses, OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,SIMDLEN,THREADS,SIMD} and OMP_CLAUSE_{NOGROUP,DEFAULTMAP} clauses, OMP_CLAUSE__LOOPTEMP_ clause on taskloop, GOMP_MAP_FIRSTPRIVATE_POINTER, OMP_CLAUSE_MAP_PRIVATE. (create_omp_child_function): Set TREE_READONLY on .omp_data_i. (find_combined_for): Allow searching for different GIMPLE_OMP_FOR kinds. (add_taskreg_looptemp_clauses): New function. (scan_omp_parallel): Use it. (scan_omp_task): Likewise. (finish_taskreg_scan): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE. For taskloop, move fields for the first two _LOOPTEMP_ clauses first. (check_omp_nesting_restrictions): Handle GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA. Formatting fixes. Allow the sandwiched taskloop constructs. Type check OMP_CLAUSE_DEPEND_{KIND,SOURCE}. Allow ordered simd inside of simd region. Diagnose depend(source) or depend(sink:...) on target constructs or task/taskloop. (handle_simd_reference): Use get_name. (lower_rec_input_clauses): Likewise. Ignore all OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE clauses on taskloop construct. Allow _LOOPTEMP_ clause on GOMP_TASK. Unshare new_var before passing it to omp_clause_{default,copy}_ctor. Handle OMP_CLAUSE_REDUCTION with MEM_REF OMP_CLAUSE_DECL. Set lastprivate_firstprivate flag for linear that needs copyin and copyout. Use BUILT_IN_ALLOCA_WITH_ALIGN instead of BUILT_IN_ALLOCA. (lower_lastprivate_clauses): For OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE on taskloop lookup decl in outer context. Pass true to build_outer_var_ref lastprivate argument. Handle OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV lastprivate if the decl is global outside of outer taskloop for. (lower_reduction_clauses): Handle OMP_CLAUSE_REDUCTION with MEM_REF OMP_CLAUSE_DECL. (lower_send_clauses): Ignore first two _LOOPTEMP_ clauses in taskloop GOMP_TASK. Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE. Handle omp_member_access_dummy_var vars. Handle OMP_CLAUSE_REDUCTION with MEM_REF OMP_CLAUSE_DECL. Use new lookup_sfield overload. (lower_send_shared_vars): Ignore fields with NULL or FIELD_DECL abstract origin. Handle omp_member_access_dummy_var vars. (expand_parallel_call): Use expand_omp_build_assign. (expand_task_call): Handle taskloop construct expansion. Add REGION argument. Use GOMP_TASK_* defines instead of hardcoded integers. Add priority argument to GOMP_task* calls. Or in GOMP_TASK_FLAG_PRIORITY into flags if priority is present for GOMP_task call. (expand_omp_build_assign): Add prototype. Add AFTER argument, if true emit statements after *GSI_P and continue linking. (expand_omp_taskreg): Adjust expand_task_call caller. (expand_omp_for_init_counts): Rename zero_iter_bb argument to zero_iter1_bb and first_zero_iter to first_zero_iter1, add zero_iter2_bb and first_zero_iter2 arguments, handle computation of counts even for ordered loops. (expand_omp_for_init_vars): Handle GOMP_TASK inner_stmt. (expand_omp_ordered_source, expand_omp_ordered_sink, expand_omp_ordered_source_sink, expand_omp_for_ordered_loops): New functions. (expand_omp_for_generic): Use omp_adjust_chunk_size. Handle linear clauses on worksharing loop. Handle DOACROSS loop expansion. (expand_omp_for_static_nochunk): Handle linear clauses on worksharing loop. Adjust expand_omp_for_init_counts callers. (expand_omp_for_static_chunk): Likewise. Use omp_adjust_chunk_size. (expand_omp_simd): Handle addressable fd->loop.v. Adjust expand_omp_for_init_counts callers. (expand_omp_taskloop_for_outer, expand_omp_taskloop_for_inner): New functions. (expand_omp_for): Call expand_omp_taskloop_for_* for taskloop. Handle doacross loops. (expand_omp_target): Handle GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA. Pass flags and depend arguments to GOMP_target_{41,update_41,enter_exit_data} libcalls. (expand_omp): Don't expand ordered depend constructs here, record ord_stmt instead for later expand_omp_for_generic. (build_omp_regions_1): Handle GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA. Treat GIMPLE_OMP_ORDERED with depend clause as stand-alone directive. (lower_omp_ordered_clauses): New function. (lower_omp_ordered): Handle OMP_CLAUSE_SIMD, for OMP_CLAUSE_DEPEND don't lower anything. (lower_omp_for_lastprivate): Use last _looptemp_ clause on taskloop for comparison. (lower_omp_for): Handle taskloop constructs. Adjust OMP_CLAUSE_DECL and OMP_CLAUSE_LINEAR_STEP so that expand_omp_for_* can use it during expansion for linear adjustments. (create_task_copyfn): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE. (lower_depend_clauses): Assert not seeing sink/source depend kinds. Set TREE_ADDRESSABLE on array. Change first argument from gimple * to tree * pointing to the stmt's clauses. (lower_omp_taskreg): Adjust lower_depend_clauses caller. (lower_omp_target): Handle GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA, depend clauses, GOMP_MAP_{RELEASE,ALWAYS_{TO,FROM,TOFROM},FIRSTPRIVATE_POINTER,STRUCT} map kinds, OMP_CLAUSE_{FIRSTPRIVATE,PRIVATE,{IS,USE}_DEVICE_PTR clauses. Always use short kind and 8-bit align shift. (lower_omp_regimplify_p): Use IS_TYPE_OR_DECL_P macro. (struct lower_omp_regimplify_operands_data): New type. (lower_omp_regimplify_operands_p, lower_omp_regimplify_operands): New functions. (lower_omp_1): Use lower_omp_regimplify_operands instead of gimple_regimplify_operands. (make_gimple_omp_edges): Handle GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA. Treat GIMPLE_OMP_ORDERED with depend clause as stand-alone directive. (simd_clone_clauses_extract): Honor OMP_CLAUSE_LINEAR_KIND. (simd_clone_mangle): Mangle the various linear kinds per the new ABI. (simd_clone_adjust_argument_types): Handle SIMD_CLONE_ARG_TYPE_LINEAR_*_CONSTANT_STEP. (simd_clone_init_simd_arrays): Don't do anything for uval. (simd_clone_adjust): Handle SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP like SIMD_CLONE_ARG_TYPE_LINEAR_CONSTANT_STEP. Handle SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP. * omp-low.h (omp_member_access_dummy_var): New prototype. * passes.def (pass_simduid_cleanup): Schedule another copy of the pass after all optimizations. * tree.c (omp_clause_code_name): Add entries for OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT} and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD}. (omp_clause_num_ops): Likewise. Bump number of OMP_CLAUSE_REDUCTION arguments to 5 and for OMP_CLAUSE_ORDERED to 1. (walk_tree_1): Adjust for OMP_CLAUSE_ORDERED having 1 argument and OMP_CLAUSE_REDUCTION 5 arguments. Handle OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT} and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD} clauses. * tree-core.h (enum omp_clause_linear_kind): New. (struct tree_omp_clause): Change type of map_kind from unsigned char to unsigned int. Add subcode.if_modifier and subcode.linear_kind fields. (enum omp_clause_code): Add OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT} and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD}. (OMP_CLAUSE_REDUCTION): Document OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER. (enum omp_clause_depend_kind): Add OMP_CLAUSE_DEPEND_{SOURCE,SINK}. * tree.def (OMP_FOR): Add OMP_FOR_ORIG_DECLS operand. (OMP_CRITICAL): Move before OMP_SINGLE. Add OMP_CRITICAL_CLAUSES operand. (OMP_ORDERED): Move before OMP_SINGLE. Add OMP_ORDERED_CLAUSES operand. (OMP_TASKLOOP, OMP_TARGET_ENTER_DATA, OMP_TARGET_EXIT_DATA): New tree codes. * tree.h (OMP_BODY): Replace OMP_CRITICAL with OMP_TASKGROUP. (OMP_CLAUSE_SET_MAP_KIND): Cast to unsigned int rather than unsigned char. (OMP_CRITICAL_NAME): Adjust to be 3rd operand instead of 2nd. (OMP_CLAUSE_NUM_TASKS_EXPR): Formatting fix. (OMP_STANDALONE_CLAUSES): Adjust to cover OMP_TARGET_{ENTER,EXIT}_DATA. (OMP_CLAUSE_DEPEND_SINK_NEGATIVE, OMP_TARGET_COMBINED, OMP_CLAUSE_MAP_PRIVATE, OMP_FOR_ORIG_DECLS, OMP_CLAUSE_IF_MODIFIER, OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION, OMP_CRITICAL_CLAUSES, OMP_CLAUSE_PRIVATE_TASKLOOP_IV, OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV, OMP_CLAUSE_HINT_EXPR, OMP_CLAUSE_SCHEDULE_SIMD, OMP_CLAUSE_LINEAR_KIND, OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER, OMP_CLAUSE_SHARED_FIRSTPRIVATE, OMP_ORDERED_CLAUSES, OMP_TARGET_ENTER_DATA_CLAUSES, OMP_TARGET_EXIT_DATA_CLAUSES, OMP_CLAUSE_NUM_TASKS_EXPR, OMP_CLAUSE_GRAINSIZE_EXPR, OMP_CLAUSE_PRIORITY_EXPR, OMP_CLAUSE_ORDERED_EXPR): Define. * tree-inline.c (remap_gimple_stmt): Handle clauses on GIMPLE_OMP_ORDERED and GIMPLE_OMP_CRITICAL. For IFN_GOMP_SIMD_ORDERED_{START,END} set has_simduid_loops. * tree-nested.c (convert_nonlocal_omp_clauses): Handle OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,SIMDLEN,PRIORITY,SIMD} and OMP_CLAUSE_{GRAINSIZE,NUM_TASKS,HINT,NOGROUP,THREADS,DEFAULTMAP} clauses. Handle OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER. (convert_local_omp_clauses): Likewise. * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,SIMDLEN,PRIORITY,SIMD} and OMP_CLAUSE_{GRAINSIZE,NUM_TASKS,HINT,NOGROUP,THREADS,DEFAULTMAP} clauses. Handle OMP_CLAUSE_IF_MODIFIER, OMP_CLAUSE_ORDERED_EXPR, OMP_CLAUSE_SCHEDULE_SIMD, OMP_CLAUSE_LINEAR_KIND, OMP_CLAUSE_DEPEND_{SOURCE,SINK}. Use "delete" for GOMP_MAP_FORCE_DEALLOC. Handle GOMP_MAP_{ALWAYS_{TO,FROM,TOFROM},RELEASE,FIRSTPRIVATE_POINTER,STRUCT}. (dump_generic_node): Handle OMP_TASKLOOP, OMP_TARGET_{ENTER,EXIT}_DATA and clauses on OMP_ORDERED and OMP_CRITICAL. * tree-vectorizer.c (adjust_simduid_builtins): Adjust comment. Remove IFN_GOMP_SIMD_ORDERED_{START,END}. (vectorize_loops): Adjust comments. (pass_simduid_cleanup::execute): Likewise. * tree-vect-stmts.c (vectorizable_simd_clone_call): Handle SIMD_CLONE_ARG_TYPE_LINEAR_{REF,VAL,UVAL}_CONSTANT_STEP. * wide-int.h (wi::gcd): New. gcc/c-family/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> * c-common.c (enum c_builtin_type): Define DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10 and DEF_FUNCTION_TYPE_11. (c_define_builtins): Likewise. * c-common.h (enum c_omp_clause_split): Add C_OMP_CLAUSE_SPLIT_TASKLOOP. (c_finish_omp_critical, c_finish_omp_ordered): Add CLAUSES argument. (c_finish_omp_for): Add ORIG_DECLV argument. * c-cppbuiltin.c (c_cpp_builtins): Predefine _OPENMP as 201511 instead of 201307. * c-omp.c (c_finish_omp_critical): Add CLAUSES argument, set OMP_CRITICAL_CLAUSES to it. (c_finish_omp_ordered): Add CLAUSES argument, set OMP_ORDERED_CLAUSES to it. (c_finish_omp_for): Add ORIG_DECLV argument, set OMP_FOR_ORIG_DECLS to it if OMP_FOR. Clear DECL_INITIAL on the IVs. (c_omp_split_clauses): Handle OpenMP 4.5 combined/composite constructs and new OpenMP 4.5 clauses. Clear OMP_CLAUSE_SCHEDULE_SIMD if not combined with OMP_SIMD. Add verification code. * c-pragma.c (omp_pragmas_simd): Add taskloop. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_TASKLOOP. (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_{DEFAULTMAP,GRAINSIZE,HINT,{IS,USE}_DEVICE_PTR} and PRAGMA_OMP_CLAUSE_{LINK,NOGROUP,NUM_TASKS,PRIORITY,SIMD,THREADS}. gcc/c/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> * c-parser.c (c_parser_pragma): Handle PRAGMA_OMP_ORDERED here. (c_parser_omp_clause_name): Handle OpenMP 4.5 clauses. (c_parser_omp_variable_list): Handle structure elements for map, to and from clauses. Handle array sections in reduction clause. Formatting fixes. (c_parser_omp_clause_if): Add IS_OMP argument, handle parsing of if clause modifiers. (c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize, c_parser_omp_clause_priority, c_parser_omp_clause_hint, c_parser_omp_clause_defaultmap, c_parser_omp_clause_use_device_ptr, c_parser_omp_clause_is_device_ptr): New functions. (c_parser_omp_clause_ordered): Parse optional parameter. (c_parser_omp_clause_reduction): Handle array reductions. (c_parser_omp_clause_schedule): Parse optional simd modifier. (c_parser_omp_clause_nogroup, c_parser_omp_clause_orderedkind): New functions. (c_parser_omp_clause_linear): Parse linear clause modifiers. (c_parser_omp_clause_depend_sink): New function. (c_parser_omp_clause_depend): Parse source/sink depend kinds. (c_parser_omp_clause_map): Parse release/delete map kinds and optional always modifier. (c_parser_oacc_all_clauses): Adjust c_parser_omp_clause_if and c_finish_omp_clauses callers. (c_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses. Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive. (c_parser_oacc_cache): Adjust c_finish_omp_clauses caller. (OMP_CRITICAL_CLAUSE_MASK): Define. (c_parser_omp_critical): Parse critical clauses. (c_parser_omp_for_loop): Handle doacross loops, adjust c_finish_omp_for and c_finish_omp_clauses callers. (OMP_SIMD_CLAUSE_MASK): Add simdlen clause. (c_parser_omp_simd): Allow ordered clause if it has no parameter. (OMP_FOR_CLAUSE_MASK): Add linear clause. (c_parser_omp_for): Disallow ordered clause when combined with distribute. Disallow linear clause when combined with distribute and not combined with simd. (OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define. (c_parser_omp_ordered): Add CONTEXT argument, remove LOC argument, parse clauses and if depend clause is found, don't parse a body. (c_parser_omp_parallel): Disallow copyin clause on target parallel. Allow target parallel without for after it. (OMP_TASK_CLAUSE_MASK): Add priority clause. (OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause. (c_parser_omp_target_data): Diagnose no map clauses or clauses with invalid kinds. (OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses. (OMP_TARGET_ENTER_DATA_CLAUSE_MASK, OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define. (c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): New functions. (OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate, defaultmap and is_device_ptr clauses. (c_parser_omp_target): Parse target parallel and target simd. Set OMP_TARGET_COMBINED on combined constructs. Parse target enter data and target exit data. Diagnose invalid map kinds. (OMP_DECLARE_TARGET_CLAUSE_MASK): Define. (c_parser_omp_declare_target): Parse OpenMP 4.5 forms of this construct. (c_parser_omp_declare_reduction): Use STRIP_NOPS when checking for &omp_priv. (OMP_TASKLOOP_CLAUSE_MASK): Define. (c_parser_omp_taskloop): New function. (c_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here, handle PRAGMA_OMP_TASKLOOP. (c_parser_cilk_for): Adjust c_finish_omp_clauses callers. * c-tree.h (c_finish_omp_clauses): Add two new arguments. * c-typeck.c (handle_omp_array_sections_1): Fix comment typo. Add IS_OMP argument, handle structure element bases, diagnose bitfields, pass IS_OMP recursively, diagnose known zero length array sections in depend clauses, handle array sections in reduction clause, diagnose negative length even for pointers. (handle_omp_array_sections): Add IS_OMP argument, use auto_vec for types, pass IS_OMP down to handle_omp_array_sections_1, handle array sections in reduction clause, set OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP. (c_finish_omp_clauses): Add IS_OMP and DECLARE_SIMD arguments. Handle new OpenMP 4.5 clauses and new restrictions for the old ones. gcc/cp/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> * class.c (finish_struct_1): Call finish_omp_declare_simd_methods. * cp-gimplify.c (cp_gimplify_expr): Handle OMP_TASKLOOP. (cp_genericize_r): Likewise. (cxx_omp_finish_clause): Don't diagnose references. (cxx_omp_disregard_value_expr): New function. * cp-objcp-common.h (LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR): Redefine. * cp-tree.h (OMP_FOR_GIMPLIFYING_P): Document for OMP_TASKLOOP. (DECL_OMP_PRIVATIZED_MEMBER): Define. (finish_omp_declare_simd_methods, push_omp_privatization_clauses, pop_omp_privatization_clauses, save_omp_privatization_clauses, restore_omp_privatization_clauses, omp_privatize_field, cxx_omp_disregard_value_expr): New prototypes. (finish_omp_clauses): Add two new arguments. (finish_omp_for): Add ORIG_DECLV argument. * parser.c (cp_parser_lambda_body): Call save_omp_privatization_clauses and restore_omp_privatization_clauses. (cp_parser_omp_clause_name): Handle OpenMP 4.5 clauses. (cp_parser_omp_var_list_no_open): Handle structure elements for map, to and from clauses. Handle array sections in reduction clause. Parse this keyword. Formatting fixes. (cp_parser_omp_clause_if): Add IS_OMP argument, handle parsing of if clause modifiers. (cp_parser_omp_clause_num_tasks, cp_parser_omp_clause_grainsize, cp_parser_omp_clause_priority, cp_parser_omp_clause_hint, cp_parser_omp_clause_defaultmap): New functions. (cp_parser_omp_clause_ordered): Parse optional parameter. (cp_parser_omp_clause_reduction): Handle array reductions. (cp_parser_omp_clause_schedule): Parse optional simd modifier. (cp_parser_omp_clause_nogroup, cp_parser_omp_clause_orderedkind): New functions. (cp_parser_omp_clause_linear): Parse linear clause modifiers. (cp_parser_omp_clause_depend_sink): New function. (cp_parser_omp_clause_depend): Parse source/sink depend kinds. (cp_parser_omp_clause_map): Parse release/delete map kinds and optional always modifier. (cp_parser_oacc_all_clauses): Adjust cp_parser_omp_clause_if and finish_omp_clauses callers. (cp_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses. Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive. (OMP_CRITICAL_CLAUSE_MASK): Define. (cp_parser_omp_critical): Parse critical clauses. (cp_parser_omp_for_incr): Use cp_tree_equal if processing_template_decl. (cp_parser_omp_for_loop_init): Return tree instead of bool. Handle non-static data member iterators. (cp_parser_omp_for_loop): Handle doacross loops, adjust finish_omp_for and finish_omp_clauses callers. (cp_omp_split_clauses): Adjust finish_omp_clauses caller. (OMP_SIMD_CLAUSE_MASK): Add simdlen clause. (cp_parser_omp_simd): Allow ordered clause if it has no parameter. (OMP_FOR_CLAUSE_MASK): Add linear clause. (cp_parser_omp_for): Disallow ordered clause when combined with distribute. Disallow linear clause when combined with distribute and not combined with simd. (OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define. (cp_parser_omp_ordered): Add CONTEXT argument, return bool instead of tree, parse clauses and if depend clause is found, don't parse a body. (cp_parser_omp_parallel): Disallow copyin clause on target parallel. Allow target parallel without for after it. (OMP_TASK_CLAUSE_MASK): Add priority clause. (OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause. (cp_parser_omp_target_data): Diagnose no map clauses or clauses with invalid kinds. (OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses. (OMP_TARGET_ENTER_DATA_CLAUSE_MASK, OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define. (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data): New functions. (OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate, defaultmap and is_device_ptr clauses. (cp_parser_omp_target): Parse target parallel and target simd. Set OMP_TARGET_COMBINED on combined constructs. Parse target enter data and target exit data. Diagnose invalid map kinds. (cp_parser_oacc_cache): Adjust finish_omp_clauses caller. (OMP_DECLARE_TARGET_CLAUSE_MASK): Define. (cp_parser_omp_declare_target): Parse OpenMP 4.5 forms of this construct. (OMP_TASKLOOP_CLAUSE_MASK): Define. (cp_parser_omp_taskloop): New function. (cp_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here, handle PRAGMA_OMP_TASKLOOP. (cp_parser_pragma): Handle PRAGMA_OMP_ORDERED here directly, handle PRAGMA_OMP_TASKLOOP, call push_omp_privatization_clauses and pop_omp_privatization_clauses around parsing calls. (cp_parser_cilk_for): Adjust finish_omp_clauses caller. * pt.c (apply_late_template_attributes): Adjust tsubst_omp_clauses and finish_omp_clauses callers. (tsubst_omp_clause_decl): Return NULL if decl is NULL. For TREE_LIST, copy over OMP_CLAUSE_DEPEND_SINK_NEGATIVE bit. Use tsubst_expr instead of tsubst_copy, undo convert_from_reference effects. (tsubst_omp_clauses): Add ALLOW_FIELDS argument. Handle new OpenMP 4.5 clauses. Use tsubst_omp_clause_decl for more clauses. If ALLOW_FIELDS, handle non-static data members in the clauses. Clear OMP_CLAUSE_LINEAR_STEP if it has been cleared before. (omp_parallel_combined_clauses): New variable. (tsubst_omp_for_iterator): Add ORIG_DECLV argument, recur on OMP_FOR_ORIG_DECLS, handle non-static data member iterators. Improve handling of clauses on combined constructs. (tsubst_expr): Call push_omp_privatization_clauses and pop_omp_privatization_clauses around instantiation of certain OpenMP constructs, improve handling of clauses on combined constructs, handle OMP_TASKLOOP, adjust tsubst_omp_for_iterator, tsubst_omp_clauses and finish_omp_for callers, handle clauses on critical and ordered, handle OMP_TARGET_{ENTER,EXIT}_DATA. (instantiate_decl): Call save_omp_privatization_clauses and restore_omp_privatization_clauses around instantiation. (dependent_omp_for_p): Fix up comment typo. Handle SCOPE_REF. * semantics.c (omp_private_member_map, omp_private_member_vec, omp_private_member_ignore_next): New variables. (finish_non_static_data_member): Return dummy decl for privatized non-static data members. (omp_clause_decl_field, omp_clause_printable_decl, omp_note_field_privatization, omp_privatize_field): New functions. (handle_omp_array_sections_1): Fix comment typo. Add IS_OMP argument, handle structure element bases, diagnose bitfields, pass IS_OMP recursively, diagnose known zero length array sections in depend clauses, handle array sections in reduction clause, diagnose negative length even for pointers. (handle_omp_array_sections): Add IS_OMP argument, use auto_vec for types, pass IS_OMP down to handle_omp_array_sections_1, handle array sections in reduction clause, set OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP. (finish_omp_reduction_clause): Handle array sections and arrays. Use omp_clause_printable_decl. (finish_omp_declare_simd_methods, cp_finish_omp_clause_depend_sink): New functions. (finish_omp_clauses): Add ALLOW_FIELDS and DECLARE_SIMD arguments. Handle new OpenMP 4.5 clauses and new restrictions for the old ones, handle non-static data members, reject this keyword when not allowed. (push_omp_privatization_clauses, pop_omp_privatization_clauses, save_omp_privatization_clauses, restore_omp_privatization_clauses): New functions. (handle_omp_for_class_iterator): Handle OMP_TASKLOOP class iterators. Add collapse and ordered arguments. Fix handling of lastprivate iterators in doacross loops. (finish_omp_for): Add ORIG_DECLV argument, handle doacross loops, adjust c_finish_omp_for, handle_omp_for_class_iterator and finish_omp_clauses callers. Fill in OMP_CLAUSE_LINEAR_STEP on simd loops with non-static data member iterators. gcc/fortran/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * f95-lang.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, DEF_FUNCTION_TYPE_11, DEF_FUNCTION_TYPE_VAR_1): Define. * trans-openmp.c (gfc_trans_omp_clauses): Set OMP_CLAUSE_IF_MODIFIER to ERROR_MARK, OMP_CLAUSE_ORDERED_EXPR to NULL. (gfc_trans_omp_critical): Adjust for addition of clauses. (gfc_trans_omp_ordered): Likewise. * types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR, BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR, BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR, BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR, BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL, BT_FN_VOID_LONG_VAR, BT_FN_VOID_ULL_VAR): New. (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR, BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): Remove. gcc/lto/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> * lto-lang.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, DEF_FUNCTION_TYPE_11): Define. gcc/jit/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, DEF_FUNCTION_TYPE_11): Define. * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, DEF_FUNCTION_TYPE_11): Define. gcc/ada/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> * gcc-interface/utils.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, DEF_FUNCTION_TYPE_11): Define. gcc/testsuite/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> * c-c++-common/gomp/cancel-1.c (f2): Add map clause to target data. * c-c++-common/gomp/clauses-1.c: New test. * c-c++-common/gomp/clauses-2.c: New test. * c-c++-common/gomp/clauses-3.c: New test. * c-c++-common/gomp/clauses-4.c: New test. * c-c++-common/gomp/declare-target-1.c: New test. * c-c++-common/gomp/declare-target-2.c: New test. * c-c++-common/gomp/depend-3.c: New test. * c-c++-common/gomp/depend-4.c: New test. * c-c++-common/gomp/doacross-1.c: New test. * c-c++-common/gomp/if-1.c: New test. * c-c++-common/gomp/if-2.c: New test. * c-c++-common/gomp/linear-1.c: New test. * c-c++-common/gomp/map-2.c: New test. * c-c++-common/gomp/map-3.c: New test. * c-c++-common/gomp/nesting-1.c (f_omp_parallel, f_omp_target_data): Add map clause to target data. * c-c++-common/gomp/nesting-warn-1.c (f_omp_target): Likewise. * c-c++-common/gomp/ordered-1.c: New test. * c-c++-common/gomp/ordered-2.c: New test. * c-c++-common/gomp/ordered-3.c: New test. * c-c++-common/gomp/pr61486-1.c (foo): Remove linear clause on non-iterator. * c-c++-common/gomp/pr61486-2.c (test, test2): Remove ordered clause and ordered construct where no longer allowed. * c-c++-common/gomp/priority-1.c: New test. * c-c++-common/gomp/reduction-1.c: New test. * c-c++-common/gomp/schedule-simd-1.c: New test. * c-c++-common/gomp/sink-1.c: New test. * c-c++-common/gomp/sink-2.c: New test. * c-c++-common/gomp/sink-3.c: New test. * c-c++-common/gomp/sink-4.c: New test. * c-c++-common/gomp/udr-1.c: New test. * c-c++-common/taskloop-1.c: New test. * c-c++-common/cpp/openmp-define-3.c: Adjust for the new value of _OPENMP macro. * c-c++-common/cilk-plus/PS/body.c (foo): Adjust expected diagnostics. * c-c++-common/goacc-gomp/nesting-fail-1.c (f_acc_parallel, f_acc_kernels, f_acc_data, f_acc_loop): Add map clause to target data. * gcc.dg/gomp/clause-1.c: * gcc.dg/gomp/reduction-1.c: New test. * gcc.dg/gomp/sink-fold-1.c: New test. * gcc.dg/gomp/sink-fold-2.c: New test. * gcc.dg/gomp/sink-fold-3.c: New test. * gcc.dg/vect/vect-simd-clone-15.c: New test. * g++.dg/gomp/clause-1.C (T::test): Remove dg-error on privatization of non-static data members. * g++.dg/gomp/clause-3.C (foo): Remove one dg-error directive. Add some linear clause tests. * g++.dg/gomp/declare-simd-3.C: New test. * g++.dg/gomp/linear-1.C: New test. * g++.dg/gomp/member-1.C: New test. * g++.dg/gomp/member-2.C: New test. * g++.dg/gomp/pr66571-2.C: New test. * g++.dg/gomp/pr67504.C (foo): Add test for ordered clause with dependent argument. * g++.dg/gomp/pr67522.C (foo): Add test for invalid array section in reduction clause. * g++.dg/gomp/reference-1.C: New test. * g++.dg/gomp/sink-1.C: New test. * g++.dg/gomp/sink-2.C: New test. * g++.dg/gomp/sink-3.C: New test. * g++.dg/gomp/task-1.C: Remove both dg-error directives. * g++.dg/gomp/this-1.C: New test. * g++.dg/gomp/this-2.C: New test. * g++.dg/vect/simd-clone-2.cc: New test. * g++.dg/vect/simd-clone-2.h: New test. * g++.dg/vect/simd-clone-3.cc: New test. * g++.dg/vect/simd-clone-4.cc: New test. * g++.dg/vect/simd-clone-4.h: New test. * g++.dg/vect/simd-clone-5.cc: New test. include/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * gomp-constants.h (GOMP_MAP_FLAG_ALWAYS): Define. (enum gomp_map_kind): Add GOMP_MAP_FIRSTPRIVATE, GOMP_MAP_FIRSTPRIVATE_INT, GOMP_MAP_USE_DEVICE_PTR, GOMP_MAP_ZERO_LEN_ARRAY_SECTION, GOMP_MAP_ALWAYS_TO, GOMP_MAP_ALWAYS_FROM, GOMP_MAP_ALWAYS_TOFROM, GOMP_MAP_STRUCT, GOMP_MAP_DELETE_ZERO_LEN_ARRAY_SECTION, GOMP_MAP_DELETE, GOMP_MAP_RELEASE, GOMP_MAP_FIRSTPRIVATE_POINTER. (GOMP_MAP_ALWAYS_TO_P, GOMP_MAP_ALWAYS_FROM_P): Define. (GOMP_TASK_FLAG_UNTIED, GOMP_TASK_FLAG_FINAL, GOMP_TASK_FLAG_MERGEABLE, GOMP_TASK_FLAG_DEPEND, GOMP_TASK_FLAG_PRIORITY, GOMP_TASK_FLAG_UP, GOMP_TASK_FLAG_GRAINSIZE, GOMP_TASK_FLAG_IF, GOMP_TASK_FLAG_NOGROUP, GOMP_TARGET_FLAG_NOWAIT, GOMP_TARGET_FLAG_EXIT_DATA, GOMP_TARGET_FLAG_UPDATE): Define. libgomp/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * config/linux/affinity.c (omp_get_place_num_procs, omp_get_place_proc_ids, gomp_get_place_proc_ids_8): New functions. * config/linux/doacross.h: New file. * config/posix/affinity.c (omp_get_place_num_procs, omp_get_place_proc_ids, gomp_get_place_proc_ids_8): New functions. * config/posix/doacross.h: New file. * env.c: Include gomp-constants.h. (struct gomp_task_icv): Rename run_sched_modifier to run_sched_chunk_size. (gomp_max_task_priority_var): New variable. (parse_schedule): Rename run_sched_modifier to run_sched_chunk_size. (handle_omp_display_env): Change _OPENMP value from 201307 to 201511. Print OMP_MAX_TASK_PRIORITY. (initialize_env): Parse OMP_MAX_TASK_PRIORITY. (omp_set_schedule, omp_get_schedule): Rename modifier argument to chunk_size and run_sched_modifier to run_sched_chunk_size. (omp_get_max_task_priority, omp_get_initial_device, omp_get_num_places, omp_get_place_num, omp_get_partition_num_places, omp_get_partition_place_nums): New functions. * fortran.c (omp_set_schedule_, omp_set_schedule_8_, omp_get_schedule_, omp_get_schedule_8_): Rename modifier argument to chunk_size. (omp_get_num_places_, omp_get_place_num_procs_, omp_get_place_num_procs_8_, omp_get_place_proc_ids_, omp_get_place_proc_ids_8_, omp_get_place_num_, omp_get_partition_num_places_, omp_get_partition_place_nums_, omp_get_partition_place_nums_8_, omp_get_initial_device_, omp_get_max_task_priority_): New functions. * libgomp_g.h (GOMP_loop_doacross_static_start, GOMP_loop_doacross_dynamic_start, GOMP_loop_doacross_guided_start, GOMP_loop_doacross_runtime_start, GOMP_loop_ull_doacross_static_start, GOMP_loop_ull_doacross_dynamic_start, GOMP_loop_ull_doacross_guided_start, GOMP_loop_ull_doacross_runtime_start, GOMP_doacross_post, GOMP_doacross_wait, GOMP_doacross_ull_post, GOMP_doacross_wait, GOMP_taskloop, GOMP_taskloop_ull, GOMP_target_41, GOMP_target_data_41, GOMP_target_update_41, GOMP_target_enter_exit_data): New prototypes. (GOMP_task): Add prototype argument. * libgomp.h (_LIBGOMP_CHECKING_): Define to 0 if not yet defined. (struct gomp_doacross_work_share): New type. (struct gomp_work_share): Add doacross field. (struct gomp_task_icv): Rename run_sched_modifier to run_sched_chunk_size. (enum gomp_task_kind): Rename GOMP_TASK_IFFALSE to GOMP_TASK_UNDEFERRED. Add comments. (struct gomp_task_depend_entry): Add comments. (struct gomp_task): Likewise. (struct gomp_taskgroup): Likewise. (struct gomp_target_task): New type. (struct gomp_team): Add comment. (gomp_get_place_proc_ids_8, gomp_doacross_init, gomp_doacross_ull_init, gomp_task_maybe_wait_for_dependencies, gomp_create_target_task, gomp_target_task_fn): New prototypes. (struct target_var_desc): New type. (struct target_mem_desc): Adjust comment. Use struct target_var_desc instead of splay_tree_key for list. (REFCOUNT_INFINITY): Define. (struct splay_tree_key_s): Remove copy_from field. (struct gomp_device_descr): Add dev2dev_func field. (enum gomp_map_vars_kind): New enum. (gomp_map_vars): Add one argument. * libgomp.map (OMP_4.5): Export omp_get_max_task_priority, omp_get_max_task_priority_, omp_get_num_places, omp_get_num_places_, omp_get_place_num_procs, omp_get_place_num_procs_, omp_get_place_num_procs_8_, omp_get_place_proc_ids, omp_get_place_proc_ids_, omp_get_place_proc_ids_8_, omp_get_place_num, omp_get_place_num_, omp_get_partition_num_places, omp_get_partition_num_places_, omp_get_partition_place_nums, omp_get_partition_place_nums_, omp_get_partition_place_nums_8_, omp_get_initial_device, omp_get_initial_device_, omp_target_alloc, omp_target_free, omp_target_is_present, omp_target_memcpy, omp_target_memcpy_rect, omp_target_associate_ptr and omp_target_disassociate_ptr. (GOMP_4.0.2): Renamed to ... (GOMP_4.5): ... this. Export GOMP_target_41, GOMP_target_data_41, GOMP_target_update_41, GOMP_target_enter_exit_data, GOMP_taskloop, GOMP_taskloop_ull, GOMP_loop_doacross_dynamic_start, GOMP_loop_doacross_guided_start, GOMP_loop_doacross_runtime_start, GOMP_loop_doacross_static_start, GOMP_doacross_post, GOMP_doacross_wait, GOMP_loop_ull_doacross_dynamic_start, GOMP_loop_ull_doacross_guided_start, GOMP_loop_ull_doacross_runtime_start, GOMP_loop_ull_doacross_static_start, GOMP_doacross_ull_post and GOMP_doacross_ull_wait. * libgomp.texi: Document omp_get_max_task_priority. Rename modifier argument to chunk_size for omp_set_schedule and omp_get_schedule. Document OMP_MAX_TASK_PRIORITY env var. * loop.c (GOMP_loop_runtime_start): Adjust for run_sched_modifier to run_sched_chunk_size renaming. (GOMP_loop_ordered_runtime_start): Likewise. (gomp_loop_doacross_static_start, gomp_loop_doacross_dynamic_start, gomp_loop_doacross_guided_start, GOMP_loop_doacross_runtime_start, GOMP_parallel_loop_runtime_start): New functions. (GOMP_parallel_loop_runtime): Adjust for run_sched_modifier to run_sched_chunk_size renaming. (GOMP_loop_doacross_static_start, GOMP_loop_doacross_dynamic_start, GOMP_loop_doacross_guided_start): New functions or aliases. * loop_ull.c (GOMP_loop_ull_runtime_start): Adjust for run_sched_modifier to run_sched_chunk_size renaming. (GOMP_loop_ull_ordered_runtime_start): Likewise. (gomp_loop_ull_doacross_static_start, gomp_loop_ull_doacross_dynamic_start, gomp_loop_ull_doacross_guided_start, GOMP_loop_ull_doacross_runtime_start): New functions. (GOMP_loop_ull_doacross_static_start, GOMP_loop_ull_doacross_dynamic_start, GOMP_loop_ull_doacross_guided_start): New functions or aliases. * oacc-mem.c (acc_map_data, present_create_copy, gomp_acc_insert_pointer): Pass GOMP_MAP_VARS_OPENACC instead of false to gomp_map_vars. (gomp_acc_remove_pointer): Use copy_from from target_var_desc. * oacc-parallel.c (GOACC_data_start): Pass GOMP_MAP_VARS_OPENACC instead of false to gomp_map_vars. (GOACC_parallel_keyed): Likewise. Use copy_from from target_var_desc. * omp.h.in (omp_lock_hint_t): New type. (omp_init_lock_with_hint, omp_init_nest_lock_with_hint, omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids, omp_get_place_num, omp_get_partition_num_places, omp_get_partition_place_nums, omp_get_initial_device, omp_get_max_task_priority, omp_target_alloc, omp_target_free, omp_target_is_present, omp_target_memcpy, omp_target_memcpy_rect, omp_target_associate_ptr, omp_target_disassociate_ptr): New prototypes. * omp_lib.f90.in (omp_lock_hint_kind): New parameter. (omp_lock_hint_none, omp_lock_hint_uncontended, omp_lock_hint_contended, omp_lock_hint_nonspeculative, omp_lock_hint_speculative): New parameters. (omp_init_lock_with_hint, omp_init_nest_lock_with_hint, omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids, omp_get_place_num, omp_get_partition_num_places, omp_get_partition_place_nums, omp_get_initial_device, omp_get_max_task_priority): New interfaces. (omp_set_schedule, omp_get_schedule): Rename modifier argument to chunk_size. * omp_lib.h.in (omp_lock_hint_kind): New parameter. (omp_lock_hint_none, omp_lock_hint_uncontended, omp_lock_hint_contended, omp_lock_hint_nonspeculative, omp_lock_hint_speculative): New parameters. (omp_init_lock_with_hint, omp_init_nest_lock_with_hint, omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids, omp_get_place_num, omp_get_partition_num_places, omp_get_partition_place_nums, omp_get_initial_device, omp_get_max_task_priority): New functions and subroutines. * ordered.c: Include stdarg.h and string.h. (MAX_COLLAPSED_BITS): Define. (gomp_doacross_init, GOMP_doacross_post, GOMP_doacross_wait, gomp_doacross_ull_init, GOMP_doacross_ull_post, GOMP_doacross_ull_wait): New functions. * target.c: Include errno.h. (resolve_device): If device is not initialized, call gomp_init_device on it. (gomp_map_lookup): New function. (gomp_map_vars_existing): Add tgt_var argument, fill it in. Don't bump refcount if REFCOUNT_INFINITY. Handle GOMP_MAP_ALWAYS_TO_P. (get_kind): Rename is_openacc argument to short_mapkind. (gomp_map_pointer): Use gomp_map_lookup. (gomp_map_fields_existing): New function. (gomp_map_vars): Rename is_openacc argument to short_mapkind and is_target to pragma_kind. Handle GOMP_MAP_VARS_ENTER_DATA, handle GOMP_MAP_FIRSTPRIVATE_INT, GOMP_MAP_STRUCT, GOMP_MAP_USE_DEVICE_PTR, GOMP_MAP_ZERO_LEN_ARRAY_SECTION. Adjust for tgt->list changed type and copy_from living in there. (gomp_copy_from_async): Adjust for tgt->list changed type and copy_from living in there. (gomp_unmap_vars): Likewise. (gomp_update): Likewise. Rename is_openacc argument to short_mapkind. Don't fail if object is not mapped. (gomp_load_image_to_device): Initialize refcount to REFCOUNT_INFINITY. (gomp_target_fallback): New function. (gomp_get_target_fn_addr): Likewise. (GOMP_target): Adjust gomp_map_vars caller, use gomp_get_target_fn_addr and gomp_target_fallback. (GOMP_target_41): New function. (gomp_target_data_fallback): New function. (GOMP_target_data): Use it, adjust gomp_map_vars caller. (GOMP_target_data_41): New function. (GOMP_target_update): Adjust gomp_update caller. (GOMP_target_update_41): New function. (gomp_exit_data, GOMP_target_enter_exit_data, gomp_target_task_fn, omp_target_alloc, omp_target_free, omp_target_is_present, omp_target_memcpy, omp_target_memcpy_rect_worker, omp_target_memcpy_rect, omp_target_associate_ptr, omp_target_disassociate_ptr, gomp_load_plugin_for_device): New functions. * task.c: Include gomp-constants.h. Include taskloop.c twice to get GOMP_taskloop and GOMP_taskloop_ull definitions. (gomp_task_handle_depend): New function. (GOMP_task): Use it. Add priority argument. Use gomp-constant.h constants instead of hardcoded numbers. Rename GOMP_TASK_IFFALSE to GOMP_TASK_UNDEFERRED. (gomp_create_target_task): New function. (verify_children_queue, verify_taskgroup_queue, verify_task_queue): New functions. (gomp_task_run_pre): Call verify_*_queue functions. If an upcoming tied task is about to leave the sibling or taskgroup queues in an invalid state, adjust appropriately. Remove taskgroup argument. Add comments. (gomp_task_run_post_handle_dependers): Add comments. (gomp_task_run_post_remove_parent): Likewise. (gomp_barrier_handle_tasks): Adjust gomp_task_run_pre caller. (GOMP_taskwait): Likewise. Add comments. (gomp_task_maybe_wait_for_dependencies): Fix scheduling problem such that the first non parent_depends_on task does not end up at the end of the children queue. (GOMP_taskgroup_start): Rename GOMP_TASK_IFFALSE to GOMP_TASK_UNDEFERRED. (GOMP_taskgroup_end): Adjust gomp_task_run_pre caller. * taskloop.c: New file. * testsuite/lib/libgomp.exp (check_effective_target_offload_device_nonshared_as): New proc. * testsuite/libgomp.c/affinity-2.c: New test. * testsuite/libgomp.c/doacross-1.c: New test. * testsuite/libgomp.c/doacross-2.c: New test. * testsuite/libgomp.c/examples-4/declare_target-1.c (fib_wrapper): Add map clause to target. * testsuite/libgomp.c/examples-4/declare_target-4.c (accum): Likewise. * testsuite/libgomp.c/examples-4/declare_target-5.c (accum): Likewise. * testsuite/libgomp.c/examples-4/device-1.c (main): Likewise. * testsuite/libgomp.c/examples-4/device-3.c (main): Likewise. * testsuite/libgomp.c/examples-4/target_data-3.c (gramSchmidt): Likewise. * testsuite/libgomp.c/examples-4/teams-2.c (dotprod): Likewise. * testsuite/libgomp.c/examples-4/teams-3.c (dotprod): Likewise. * testsuite/libgomp.c/examples-4/teams-4.c (dotprod): Likewise. * testsuite/libgomp.c/for-2.h (OMPTGT, OMPTO, OMPFROM): Define if not defined. Use those where needed. * testsuite/libgomp.c/for-4.c: New test. * testsuite/libgomp.c/for-5.c: New test. * testsuite/libgomp.c/for-6.c: New test. * testsuite/libgomp.c/linear-1.c: New test. * testsuite/libgomp.c/ordered-4.c: New test. * testsuite/libgomp.c/pr66199-2.c (f2): Adjust for linear clause only allowed on the loop iterator. * testsuite/libgomp.c/pr66199-3.c: New test. * testsuite/libgomp.c/pr66199-4.c: New test. * testsuite/libgomp.c/reduction-7.c: New test. * testsuite/libgomp.c/reduction-8.c: New test. * testsuite/libgomp.c/reduction-9.c: New test. * testsuite/libgomp.c/reduction-10.c: New test. * testsuite/libgomp.c/target-1.c (fn2, fn3, fn4): Add map(tofrom:s). * testsuite/libgomp.c/target-2.c (fn2, fn3, fn4): Likewise. * testsuite/libgomp.c/target-7.c (foo): Add map(h) where needed. * testsuite/libgomp.c/target-11.c: New test. * testsuite/libgomp.c/target-12.c: New test. * testsuite/libgomp.c/target-13.c: New test. * testsuite/libgomp.c/target-14.c: New test. * testsuite/libgomp.c/target-15.c: New test. * testsuite/libgomp.c/target-16.c: New test. * testsuite/libgomp.c/target-17.c: New test. * testsuite/libgomp.c/target-18.c: New test. * testsuite/libgomp.c/target-19.c: New test. * testsuite/libgomp.c/target-20.c: New test. * testsuite/libgomp.c/target-21.c: New test. * testsuite/libgomp.c/target-22.c: New test. * testsuite/libgomp.c/target-23.c: New test. * testsuite/libgomp.c/target-24.c: New test. * testsuite/libgomp.c/target-25.c: New test. * testsuite/libgomp.c/target-26.c: New test. * testsuite/libgomp.c/target-27.c: New test. * testsuite/libgomp.c/taskloop-1.c: New test. * testsuite/libgomp.c/taskloop-2.c: New test. * testsuite/libgomp.c/taskloop-3.c: New test. * testsuite/libgomp.c/taskloop-4.c: New test. * testsuite/libgomp.c++/ctor-13.C: New test. * testsuite/libgomp.c++/doacross-1.C: New test. * testsuite/libgomp.c++/examples-4/declare_target-2.C: Replace offload_device with offload_device_nonshared_as. * testsuite/libgomp.c++/for-12.C: New test. * testsuite/libgomp.c++/for-13.C: New test. * testsuite/libgomp.c++/for-14.C: New test. * testsuite/libgomp.c++/linear-1.C: New test. * testsuite/libgomp.c++/member-1.C: New test. * testsuite/libgomp.c++/member-2.C: New test. * testsuite/libgomp.c++/member-3.C: New test. * testsuite/libgomp.c++/member-4.C: New test. * testsuite/libgomp.c++/member-5.C: New test. * testsuite/libgomp.c++/ordered-1.C: New test. * testsuite/libgomp.c++/reduction-5.C: New test. * testsuite/libgomp.c++/reduction-6.C: New test. * testsuite/libgomp.c++/reduction-7.C: New test. * testsuite/libgomp.c++/reduction-8.C: New test. * testsuite/libgomp.c++/reduction-9.C: New test. * testsuite/libgomp.c++/reduction-10.C: New test. * testsuite/libgomp.c++/reference-1.C: New test. * testsuite/libgomp.c++/simd14.C: New test. * testsuite/libgomp.c++/target-2.C (fn2): Add map(tofrom: s) clause. * testsuite/libgomp.c++/target-5.C: New test. * testsuite/libgomp.c++/target-6.C: New test. * testsuite/libgomp.c++/target-7.C: New test. * testsuite/libgomp.c++/target-8.C: New test. * testsuite/libgomp.c++/target-9.C: New test. * testsuite/libgomp.c++/target-10.C: New test. * testsuite/libgomp.c++/target-11.C: New test. * testsuite/libgomp.c++/target-12.C: New test. * testsuite/libgomp.c++/taskloop-1.C: New test. * testsuite/libgomp.c++/taskloop-2.C: New test. * testsuite/libgomp.c++/taskloop-3.C: New test. * testsuite/libgomp.c++/taskloop-4.C: New test. * testsuite/libgomp.c++/taskloop-5.C: New test. * testsuite/libgomp.c++/taskloop-6.C: New test. * testsuite/libgomp.c++/taskloop-7.C: New test. * testsuite/libgomp.c++/taskloop-8.C: New test. * testsuite/libgomp.c++/taskloop-9.C: New test. * testsuite/libgomp.fortran/affinity1.f90: New test. * testsuite/libgomp.fortran/affinity2.f90: New test. liboffloadmic/ 2015-10-13 Ilya Verbin <ilya.verbin@intel.com> * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_dev2dev): New function. * plugin/offload_target_main.cpp (__offload_target_tgt2tgt): New static function, register it in liboffloadmic. From-SVN: r228777
2015-10-13 21:06:23 +02:00
case SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP:
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
if (arginfo[i].dt == vect_constant_def
|| arginfo[i].dt == vect_external_def
|| (arginfo[i].linear_step
!= n->simdclone->args[i].linear_step))
i = -1;
break;
case SIMD_CLONE_ARG_TYPE_LINEAR_VARIABLE_STEP:
builtin-types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR, [...]): New. gcc/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * builtin-types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR, BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR, BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR, BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR, BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL, BT_FN_VOID_LONG_VAR, BT_FN_VOID_ULL_VAR): New. (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR, BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): Remove. * cgraph.h (enum cgraph_simd_clone_arg_type): Add SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP, SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP and SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP. (struct cgraph_simd_clone_arg): Adjust comment. * coretypes.h (struct gomp_ordered): New forward decl. * gimple.c (gimple_build_omp_critical): Add CLAUSES argument, set critical clauses to it. (gimple_build_omp_ordered): Return gomp_ordered * instead of gimple *. Add CLAUSES argument, set ordered clauses to it. (gimple_copy): Unshare clauses on GIMPLE_OMP_CRITICAL and GIMPLE_OMP_ORDERED. * gimple.def (GIMPLE_OMP_ORDERED): Change from GSS_OMP to GSS_OMP_SINGLE_LAYOUT, move it after GIMPLE_OMP_TEAMS. * gimple.h (enum gf_mask): Add GF_OMP_TASK_TASKLOOP. Add another bit to GF_OMP_FOR_KIND_MASK mask. Add GF_OMP_FOR_KIND_TASKLOOP, renumber GF_OMP_FOR_KIND_CILKFOR and GF_OMP_FOR_KIND_OACC_LOOP. Adjust GF_OMP_FOR_SIMD, GF_OMP_FOR_COMBINED and GF_OMP_FOR_COMBINED_INTO. Add another bit to GF_OMP_TARGET_KIND_MASK mask. Add GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA, renumber GF_OMP_TARGET_KIND_OACC_{PARALLEL,KERNELS,DATA,UPDATE,ENTER_EXIT_DATA}. (gomp_critical): Add clauses field. (gomp_ordered): New struct. (is_a_helper <gomp_ordered *>::test): New inline. (gimple_build_omp_critical): Add CLAUSES argument. (gimple_build_omp_ordered): Likewise. Return gomp_ordered * instead of gimple *. (gimple_omp_critical_clauses, gimple_omp_critical_clauses_ptr, gimple_omp_critical_set_clauses, gimple_omp_ordered_clauses, gimple_omp_ordered_clauses_ptr, gimple_omp_ordered_set_clauses, gimple_omp_task_taskloop_p, gimple_omp_task_set_taskloop_p): New inline functions. * gimple-pretty-print.c (dump_gimple_omp_for): Handle taskloop. (dump_gimple_omp_target): Handle enter data and exit data. (dump_gimple_omp_block): Don't handle GIMPLE_OMP_ORDERED here. (dump_gimple_omp_critical): Print clauses. (dump_gimple_omp_ordered): New function. (dump_gimple_omp_task): Handle taskloop. (pp_gimple_stmt_1): Use dump_gimple_omp_ordered for GIMPLE_OMP_ORDERED. * gimple-walk.c (walk_gimple_op): Walk clauses on GIMPLE_OMP_CRITICAL and GIMPLE_OMP_ORDERED. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_0LEN_ARRAY. (enum omp_region_type): Add ORT_COMBINED_TARGET and ORT_NONE. (struct gimplify_omp_ctx): Add loop_iter_var, target_map_scalars_firstprivate, target_map_pointers_as_0len_arrays and target_firstprivatize_array_bases fields. (delete_omp_context): Release loop_iter_var. (gimplify_bind_expr): Handle ORT_NONE. (maybe_fold_stmt): Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. (is_gimple_stmt): Return true for OMP_TASKLOOP, OMP_TEAMS and OMP_TARGET{,_DATA,_UPDATE,_ENTER_DATA,_EXIT_DATA}. (omp_firstprivatize_variable): Handle ORT_NONE. Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. Handle ctx->target_map_scalars_firstprivate. (omp_add_variable): Handle ORT_NONE. Allow map clause together with data sharing clauses. For data sharing clause with VLA decl on omp target/target data don't add firstprivate for the pointer. Call omp_notice_variable on TYPE_SIZE_UNIT only if it is a DECL_P. (omp_notice_threadprivate_variable): Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. (omp_notice_variable): Handle ORT_NONE. Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. Handle implicit mapping of pointers as zero length array sections and ctx->target_map_scalars_firstprivate mapping of scalars as firstprivate data sharing. (omp_check_private): Handle omp_member_access_dummy_var vars. (find_decl_expr): New function. (gimplify_scan_omp_clauses): Add CODE argument. For OMP_CLAUSE_IF complain if OMP_CLAUSE_IF_MODIFIER is present and does not match code. Handle OMP_CLAUSE_GANG separately. Handle OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD,SIMDLEN} clauses. Diagnose linear clause on combined distribute {, parallel for} simd construct, unless it is the loop iterator. Handle struct element GOMP_MAP_FIRSTPRIVATE_POINTER. Handle map clauses with COMPONENT_REF. Initialize ctx->target_map_scalars_firstprivate, ctx->target_firstprivatize_array_bases and ctx->target_map_pointers_as_0len_arrays. Add firstprivate for linear clause even to target region if combined. Remove map clauses with GOMP_MAP_FIRSTPRIVATE_POINTER kind from OMP_TARGET_{,ENTER_,EXIT_}DATA. For GOMP_MAP_FIRSTPRIVATE_POINTER map kind with non-INTEGER_CST OMP_CLAUSE_SIZE firstprivatize the bias. Handle OMP_CLAUSE_DEPEND_{SINK,SOURCE}. Handle OMP_CLAUSE_{{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}. For linear clause on worksharing loop combined with parallel add shared clause on the parallel. Handle OMP_CLAUSE_REDUCTION with MEM_REF OMP_CLAUSE_DECL. Set DECL_NAME on omp_member_access_dummy_var vars. Add lastprivate clause to outer taskloop if needed. (gimplify_adjust_omp_clauses_1): Handle GOVD_MAP_0LEN_ARRAY. If gimplify_omp_ctxp->target_firstprivatize_array_bases, use GOMP_MAP_FIRSTPRIVATE_POINTER map kind instead of GOMP_MAP_POINTER. (gimplify_adjust_omp_clauses): Add CODE argument. Handle removal of GOMP_MAP_FIRSTPRIVATE_POINTER struct elements for struct not seen in target body. Handle removal of struct mapping if struct is not seen in target body. Remove GOMP_MAP_STRUCT map clause on OMP_TARGET_EXIT_DATA. Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. Use GOMP_MAP_FIRSTPRIVATE_POINTER instead of GOMP_MAP_POINTER if ctx->target_firstprivatize_array_bases for VLAs. Set OMP_CLAUSE_MAP_PRIVATE if both data sharing and map clause appear together. Handle OMP_CLAUSE_{{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}. Don't remove map clause if it has map-type-modifier always. Handle OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD,SIMDLEN} clauses. (gimplify_oacc_cache, gimplify_omp_parallel, gimplify_omp_task): Adjust gimplify_scan_omp_clauses and gimplify_adjust_omp_clauses callers. (gimplify_omp_for): Likewise. Handle OMP_TASKLOOP. Initialize loop_iter_var. Use OMP_FOR_ORIG_DECLS. Fix handling of lastprivate iterators in doacross loops. (gimplify_omp_workshare): Adjust gimplify_scan_omp_clauses and gimplify_adjust_omp_clauses callers. Use ORT_COMBINED_TARGET for OMP_TARGET_COMBINED. Adjust check for ORT_TARGET for the addition of ORT_COMBINED_TARGET. (gimplify_omp_target_update): Adjust gimplify_scan_omp_clauses and gimplify_adjust_omp_clauses callers. Handle OMP_TARGET_ENTER_DATA and OMP_TARGET_EXIT_DATA. (gimplify_omp_ordered): New function. (gimplify_expr): Handle OMP_TASKLOOP, OMP_TARGET_ENTER_DATA and OMP_TARGET_EXIT_DATA. Use gimplify_omp_ordered for OMP_ORDERED. Gimplify clauses on OMP_CRITICAL. * internal-fn.c (expand_GOMP_SIMD_ORDERED_START, expand_GOMP_SIMD_ORDERED_END): New functions. * internal-fn.def (GOMP_SIMD_ORDERED_START, GOMP_SIMD_ORDERED_END): New internal functions. * omp-builtins.def (BUILT_IN_GOMP_LOOP_DOACROSS_STATIC_START, BUILT_IN_GOMP_LOOP_DOACROSS_DYNAMIC_START, BUILT_IN_GOMP_LOOP_DOACROSS_GUIDED_START, BUILT_IN_GOMP_LOOP_DOACROSS_RUNTIME_START, BUILT_IN_GOMP_LOOP_ULL_DOACROSS_STATIC_START, BUILT_IN_GOMP_LOOP_ULL_DOACROSS_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ULL_DOACROSS_GUIDED_START, BUILT_IN_GOMP_LOOP_ULL_DOACROSS_RUNTIME_START, BUILT_IN_GOMP_DOACROSS_POST, BUILT_IN_GOMP_DOACROSS_WAIT, BUILT_IN_GOMP_DOACROSS_ULL_POST, BUILT_IN_GOMP_DOACROSS_ULL_WAIT, BUILT_IN_GOMP_TARGET_ENTER_EXIT_DATA, BUILT_IN_GOMP_TASKLOOP, BUILT_IN_GOMP_TASKLOOP_ULL): New built-ins. (BUILT_IN_GOMP_TASK): Add INT argument to the end. (BUILT_IN_GOMP_TARGET): Rename from GOMP_target to GOMP_target_41, adjust type. (BUILT_IN_GOMP_TARGET_DATA): Rename from GOMP_target_data to GOMP_target_data_41, adjust type. (BUILT_IN_GOMP_TARGET_UPDATE): Rename from GOMP_target_update to GOMP_target_update_41, adjust type. * omp-low.c (struct omp_region): Adjust comments, add ord_stmt field. (struct omp_for_data): Add ordered and simd_schedule fields. (omp_member_access_dummy_var, unshare_and_remap_1, unshare_and_remap, is_taskloop_ctx): New functions. (is_taskreg_ctx): Use is_parallel_ctx and is_task_ctx. (extract_omp_for_data): Handle taskloops and doacross loops and simd schedule modifier. (omp_adjust_chunk_size): New function. (get_ws_args_for): Use it. (lookup_sfield): Change first argument to splay_tree_key, add overload with first argument tree. (maybe_lookup_field): Likewise. (use_pointer_for_field): Handle omp_member_access_dummy_var. (omp_copy_decl_2): If var is TREE_ADDRESSABLE listed in task_shared_vars, clear TREE_ADDRESSABLE on the copy. (build_outer_var_ref): Add LASTPRIVATE argument, handle taskloops and omp_member_access_dummy_var vars. (build_sender_ref): Change first argument to splay_tree_key, add overload with first argument tree. (install_var_field): For mask & 8 use &DECL_UID as key instead of the tree itself. (fixup_child_record_type): Const qualify *.omp_data_i. (scan_sharing_clauses): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE, C/C++ array reductions, OMP_CLAUSE_{IS,USE}_DEVICE_PTR clauses, OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,SIMDLEN,THREADS,SIMD} and OMP_CLAUSE_{NOGROUP,DEFAULTMAP} clauses, OMP_CLAUSE__LOOPTEMP_ clause on taskloop, GOMP_MAP_FIRSTPRIVATE_POINTER, OMP_CLAUSE_MAP_PRIVATE. (create_omp_child_function): Set TREE_READONLY on .omp_data_i. (find_combined_for): Allow searching for different GIMPLE_OMP_FOR kinds. (add_taskreg_looptemp_clauses): New function. (scan_omp_parallel): Use it. (scan_omp_task): Likewise. (finish_taskreg_scan): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE. For taskloop, move fields for the first two _LOOPTEMP_ clauses first. (check_omp_nesting_restrictions): Handle GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA. Formatting fixes. Allow the sandwiched taskloop constructs. Type check OMP_CLAUSE_DEPEND_{KIND,SOURCE}. Allow ordered simd inside of simd region. Diagnose depend(source) or depend(sink:...) on target constructs or task/taskloop. (handle_simd_reference): Use get_name. (lower_rec_input_clauses): Likewise. Ignore all OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE clauses on taskloop construct. Allow _LOOPTEMP_ clause on GOMP_TASK. Unshare new_var before passing it to omp_clause_{default,copy}_ctor. Handle OMP_CLAUSE_REDUCTION with MEM_REF OMP_CLAUSE_DECL. Set lastprivate_firstprivate flag for linear that needs copyin and copyout. Use BUILT_IN_ALLOCA_WITH_ALIGN instead of BUILT_IN_ALLOCA. (lower_lastprivate_clauses): For OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE on taskloop lookup decl in outer context. Pass true to build_outer_var_ref lastprivate argument. Handle OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV lastprivate if the decl is global outside of outer taskloop for. (lower_reduction_clauses): Handle OMP_CLAUSE_REDUCTION with MEM_REF OMP_CLAUSE_DECL. (lower_send_clauses): Ignore first two _LOOPTEMP_ clauses in taskloop GOMP_TASK. Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE. Handle omp_member_access_dummy_var vars. Handle OMP_CLAUSE_REDUCTION with MEM_REF OMP_CLAUSE_DECL. Use new lookup_sfield overload. (lower_send_shared_vars): Ignore fields with NULL or FIELD_DECL abstract origin. Handle omp_member_access_dummy_var vars. (expand_parallel_call): Use expand_omp_build_assign. (expand_task_call): Handle taskloop construct expansion. Add REGION argument. Use GOMP_TASK_* defines instead of hardcoded integers. Add priority argument to GOMP_task* calls. Or in GOMP_TASK_FLAG_PRIORITY into flags if priority is present for GOMP_task call. (expand_omp_build_assign): Add prototype. Add AFTER argument, if true emit statements after *GSI_P and continue linking. (expand_omp_taskreg): Adjust expand_task_call caller. (expand_omp_for_init_counts): Rename zero_iter_bb argument to zero_iter1_bb and first_zero_iter to first_zero_iter1, add zero_iter2_bb and first_zero_iter2 arguments, handle computation of counts even for ordered loops. (expand_omp_for_init_vars): Handle GOMP_TASK inner_stmt. (expand_omp_ordered_source, expand_omp_ordered_sink, expand_omp_ordered_source_sink, expand_omp_for_ordered_loops): New functions. (expand_omp_for_generic): Use omp_adjust_chunk_size. Handle linear clauses on worksharing loop. Handle DOACROSS loop expansion. (expand_omp_for_static_nochunk): Handle linear clauses on worksharing loop. Adjust expand_omp_for_init_counts callers. (expand_omp_for_static_chunk): Likewise. Use omp_adjust_chunk_size. (expand_omp_simd): Handle addressable fd->loop.v. Adjust expand_omp_for_init_counts callers. (expand_omp_taskloop_for_outer, expand_omp_taskloop_for_inner): New functions. (expand_omp_for): Call expand_omp_taskloop_for_* for taskloop. Handle doacross loops. (expand_omp_target): Handle GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA. Pass flags and depend arguments to GOMP_target_{41,update_41,enter_exit_data} libcalls. (expand_omp): Don't expand ordered depend constructs here, record ord_stmt instead for later expand_omp_for_generic. (build_omp_regions_1): Handle GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA. Treat GIMPLE_OMP_ORDERED with depend clause as stand-alone directive. (lower_omp_ordered_clauses): New function. (lower_omp_ordered): Handle OMP_CLAUSE_SIMD, for OMP_CLAUSE_DEPEND don't lower anything. (lower_omp_for_lastprivate): Use last _looptemp_ clause on taskloop for comparison. (lower_omp_for): Handle taskloop constructs. Adjust OMP_CLAUSE_DECL and OMP_CLAUSE_LINEAR_STEP so that expand_omp_for_* can use it during expansion for linear adjustments. (create_task_copyfn): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE. (lower_depend_clauses): Assert not seeing sink/source depend kinds. Set TREE_ADDRESSABLE on array. Change first argument from gimple * to tree * pointing to the stmt's clauses. (lower_omp_taskreg): Adjust lower_depend_clauses caller. (lower_omp_target): Handle GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA, depend clauses, GOMP_MAP_{RELEASE,ALWAYS_{TO,FROM,TOFROM},FIRSTPRIVATE_POINTER,STRUCT} map kinds, OMP_CLAUSE_{FIRSTPRIVATE,PRIVATE,{IS,USE}_DEVICE_PTR clauses. Always use short kind and 8-bit align shift. (lower_omp_regimplify_p): Use IS_TYPE_OR_DECL_P macro. (struct lower_omp_regimplify_operands_data): New type. (lower_omp_regimplify_operands_p, lower_omp_regimplify_operands): New functions. (lower_omp_1): Use lower_omp_regimplify_operands instead of gimple_regimplify_operands. (make_gimple_omp_edges): Handle GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA. Treat GIMPLE_OMP_ORDERED with depend clause as stand-alone directive. (simd_clone_clauses_extract): Honor OMP_CLAUSE_LINEAR_KIND. (simd_clone_mangle): Mangle the various linear kinds per the new ABI. (simd_clone_adjust_argument_types): Handle SIMD_CLONE_ARG_TYPE_LINEAR_*_CONSTANT_STEP. (simd_clone_init_simd_arrays): Don't do anything for uval. (simd_clone_adjust): Handle SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP like SIMD_CLONE_ARG_TYPE_LINEAR_CONSTANT_STEP. Handle SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP. * omp-low.h (omp_member_access_dummy_var): New prototype. * passes.def (pass_simduid_cleanup): Schedule another copy of the pass after all optimizations. * tree.c (omp_clause_code_name): Add entries for OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT} and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD}. (omp_clause_num_ops): Likewise. Bump number of OMP_CLAUSE_REDUCTION arguments to 5 and for OMP_CLAUSE_ORDERED to 1. (walk_tree_1): Adjust for OMP_CLAUSE_ORDERED having 1 argument and OMP_CLAUSE_REDUCTION 5 arguments. Handle OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT} and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD} clauses. * tree-core.h (enum omp_clause_linear_kind): New. (struct tree_omp_clause): Change type of map_kind from unsigned char to unsigned int. Add subcode.if_modifier and subcode.linear_kind fields. (enum omp_clause_code): Add OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT} and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD}. (OMP_CLAUSE_REDUCTION): Document OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER. (enum omp_clause_depend_kind): Add OMP_CLAUSE_DEPEND_{SOURCE,SINK}. * tree.def (OMP_FOR): Add OMP_FOR_ORIG_DECLS operand. (OMP_CRITICAL): Move before OMP_SINGLE. Add OMP_CRITICAL_CLAUSES operand. (OMP_ORDERED): Move before OMP_SINGLE. Add OMP_ORDERED_CLAUSES operand. (OMP_TASKLOOP, OMP_TARGET_ENTER_DATA, OMP_TARGET_EXIT_DATA): New tree codes. * tree.h (OMP_BODY): Replace OMP_CRITICAL with OMP_TASKGROUP. (OMP_CLAUSE_SET_MAP_KIND): Cast to unsigned int rather than unsigned char. (OMP_CRITICAL_NAME): Adjust to be 3rd operand instead of 2nd. (OMP_CLAUSE_NUM_TASKS_EXPR): Formatting fix. (OMP_STANDALONE_CLAUSES): Adjust to cover OMP_TARGET_{ENTER,EXIT}_DATA. (OMP_CLAUSE_DEPEND_SINK_NEGATIVE, OMP_TARGET_COMBINED, OMP_CLAUSE_MAP_PRIVATE, OMP_FOR_ORIG_DECLS, OMP_CLAUSE_IF_MODIFIER, OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION, OMP_CRITICAL_CLAUSES, OMP_CLAUSE_PRIVATE_TASKLOOP_IV, OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV, OMP_CLAUSE_HINT_EXPR, OMP_CLAUSE_SCHEDULE_SIMD, OMP_CLAUSE_LINEAR_KIND, OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER, OMP_CLAUSE_SHARED_FIRSTPRIVATE, OMP_ORDERED_CLAUSES, OMP_TARGET_ENTER_DATA_CLAUSES, OMP_TARGET_EXIT_DATA_CLAUSES, OMP_CLAUSE_NUM_TASKS_EXPR, OMP_CLAUSE_GRAINSIZE_EXPR, OMP_CLAUSE_PRIORITY_EXPR, OMP_CLAUSE_ORDERED_EXPR): Define. * tree-inline.c (remap_gimple_stmt): Handle clauses on GIMPLE_OMP_ORDERED and GIMPLE_OMP_CRITICAL. For IFN_GOMP_SIMD_ORDERED_{START,END} set has_simduid_loops. * tree-nested.c (convert_nonlocal_omp_clauses): Handle OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,SIMDLEN,PRIORITY,SIMD} and OMP_CLAUSE_{GRAINSIZE,NUM_TASKS,HINT,NOGROUP,THREADS,DEFAULTMAP} clauses. Handle OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER. (convert_local_omp_clauses): Likewise. * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,SIMDLEN,PRIORITY,SIMD} and OMP_CLAUSE_{GRAINSIZE,NUM_TASKS,HINT,NOGROUP,THREADS,DEFAULTMAP} clauses. Handle OMP_CLAUSE_IF_MODIFIER, OMP_CLAUSE_ORDERED_EXPR, OMP_CLAUSE_SCHEDULE_SIMD, OMP_CLAUSE_LINEAR_KIND, OMP_CLAUSE_DEPEND_{SOURCE,SINK}. Use "delete" for GOMP_MAP_FORCE_DEALLOC. Handle GOMP_MAP_{ALWAYS_{TO,FROM,TOFROM},RELEASE,FIRSTPRIVATE_POINTER,STRUCT}. (dump_generic_node): Handle OMP_TASKLOOP, OMP_TARGET_{ENTER,EXIT}_DATA and clauses on OMP_ORDERED and OMP_CRITICAL. * tree-vectorizer.c (adjust_simduid_builtins): Adjust comment. Remove IFN_GOMP_SIMD_ORDERED_{START,END}. (vectorize_loops): Adjust comments. (pass_simduid_cleanup::execute): Likewise. * tree-vect-stmts.c (vectorizable_simd_clone_call): Handle SIMD_CLONE_ARG_TYPE_LINEAR_{REF,VAL,UVAL}_CONSTANT_STEP. * wide-int.h (wi::gcd): New. gcc/c-family/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> * c-common.c (enum c_builtin_type): Define DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10 and DEF_FUNCTION_TYPE_11. (c_define_builtins): Likewise. * c-common.h (enum c_omp_clause_split): Add C_OMP_CLAUSE_SPLIT_TASKLOOP. (c_finish_omp_critical, c_finish_omp_ordered): Add CLAUSES argument. (c_finish_omp_for): Add ORIG_DECLV argument. * c-cppbuiltin.c (c_cpp_builtins): Predefine _OPENMP as 201511 instead of 201307. * c-omp.c (c_finish_omp_critical): Add CLAUSES argument, set OMP_CRITICAL_CLAUSES to it. (c_finish_omp_ordered): Add CLAUSES argument, set OMP_ORDERED_CLAUSES to it. (c_finish_omp_for): Add ORIG_DECLV argument, set OMP_FOR_ORIG_DECLS to it if OMP_FOR. Clear DECL_INITIAL on the IVs. (c_omp_split_clauses): Handle OpenMP 4.5 combined/composite constructs and new OpenMP 4.5 clauses. Clear OMP_CLAUSE_SCHEDULE_SIMD if not combined with OMP_SIMD. Add verification code. * c-pragma.c (omp_pragmas_simd): Add taskloop. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_TASKLOOP. (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_{DEFAULTMAP,GRAINSIZE,HINT,{IS,USE}_DEVICE_PTR} and PRAGMA_OMP_CLAUSE_{LINK,NOGROUP,NUM_TASKS,PRIORITY,SIMD,THREADS}. gcc/c/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> * c-parser.c (c_parser_pragma): Handle PRAGMA_OMP_ORDERED here. (c_parser_omp_clause_name): Handle OpenMP 4.5 clauses. (c_parser_omp_variable_list): Handle structure elements for map, to and from clauses. Handle array sections in reduction clause. Formatting fixes. (c_parser_omp_clause_if): Add IS_OMP argument, handle parsing of if clause modifiers. (c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize, c_parser_omp_clause_priority, c_parser_omp_clause_hint, c_parser_omp_clause_defaultmap, c_parser_omp_clause_use_device_ptr, c_parser_omp_clause_is_device_ptr): New functions. (c_parser_omp_clause_ordered): Parse optional parameter. (c_parser_omp_clause_reduction): Handle array reductions. (c_parser_omp_clause_schedule): Parse optional simd modifier. (c_parser_omp_clause_nogroup, c_parser_omp_clause_orderedkind): New functions. (c_parser_omp_clause_linear): Parse linear clause modifiers. (c_parser_omp_clause_depend_sink): New function. (c_parser_omp_clause_depend): Parse source/sink depend kinds. (c_parser_omp_clause_map): Parse release/delete map kinds and optional always modifier. (c_parser_oacc_all_clauses): Adjust c_parser_omp_clause_if and c_finish_omp_clauses callers. (c_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses. Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive. (c_parser_oacc_cache): Adjust c_finish_omp_clauses caller. (OMP_CRITICAL_CLAUSE_MASK): Define. (c_parser_omp_critical): Parse critical clauses. (c_parser_omp_for_loop): Handle doacross loops, adjust c_finish_omp_for and c_finish_omp_clauses callers. (OMP_SIMD_CLAUSE_MASK): Add simdlen clause. (c_parser_omp_simd): Allow ordered clause if it has no parameter. (OMP_FOR_CLAUSE_MASK): Add linear clause. (c_parser_omp_for): Disallow ordered clause when combined with distribute. Disallow linear clause when combined with distribute and not combined with simd. (OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define. (c_parser_omp_ordered): Add CONTEXT argument, remove LOC argument, parse clauses and if depend clause is found, don't parse a body. (c_parser_omp_parallel): Disallow copyin clause on target parallel. Allow target parallel without for after it. (OMP_TASK_CLAUSE_MASK): Add priority clause. (OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause. (c_parser_omp_target_data): Diagnose no map clauses or clauses with invalid kinds. (OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses. (OMP_TARGET_ENTER_DATA_CLAUSE_MASK, OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define. (c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): New functions. (OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate, defaultmap and is_device_ptr clauses. (c_parser_omp_target): Parse target parallel and target simd. Set OMP_TARGET_COMBINED on combined constructs. Parse target enter data and target exit data. Diagnose invalid map kinds. (OMP_DECLARE_TARGET_CLAUSE_MASK): Define. (c_parser_omp_declare_target): Parse OpenMP 4.5 forms of this construct. (c_parser_omp_declare_reduction): Use STRIP_NOPS when checking for &omp_priv. (OMP_TASKLOOP_CLAUSE_MASK): Define. (c_parser_omp_taskloop): New function. (c_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here, handle PRAGMA_OMP_TASKLOOP. (c_parser_cilk_for): Adjust c_finish_omp_clauses callers. * c-tree.h (c_finish_omp_clauses): Add two new arguments. * c-typeck.c (handle_omp_array_sections_1): Fix comment typo. Add IS_OMP argument, handle structure element bases, diagnose bitfields, pass IS_OMP recursively, diagnose known zero length array sections in depend clauses, handle array sections in reduction clause, diagnose negative length even for pointers. (handle_omp_array_sections): Add IS_OMP argument, use auto_vec for types, pass IS_OMP down to handle_omp_array_sections_1, handle array sections in reduction clause, set OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP. (c_finish_omp_clauses): Add IS_OMP and DECLARE_SIMD arguments. Handle new OpenMP 4.5 clauses and new restrictions for the old ones. gcc/cp/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> * class.c (finish_struct_1): Call finish_omp_declare_simd_methods. * cp-gimplify.c (cp_gimplify_expr): Handle OMP_TASKLOOP. (cp_genericize_r): Likewise. (cxx_omp_finish_clause): Don't diagnose references. (cxx_omp_disregard_value_expr): New function. * cp-objcp-common.h (LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR): Redefine. * cp-tree.h (OMP_FOR_GIMPLIFYING_P): Document for OMP_TASKLOOP. (DECL_OMP_PRIVATIZED_MEMBER): Define. (finish_omp_declare_simd_methods, push_omp_privatization_clauses, pop_omp_privatization_clauses, save_omp_privatization_clauses, restore_omp_privatization_clauses, omp_privatize_field, cxx_omp_disregard_value_expr): New prototypes. (finish_omp_clauses): Add two new arguments. (finish_omp_for): Add ORIG_DECLV argument. * parser.c (cp_parser_lambda_body): Call save_omp_privatization_clauses and restore_omp_privatization_clauses. (cp_parser_omp_clause_name): Handle OpenMP 4.5 clauses. (cp_parser_omp_var_list_no_open): Handle structure elements for map, to and from clauses. Handle array sections in reduction clause. Parse this keyword. Formatting fixes. (cp_parser_omp_clause_if): Add IS_OMP argument, handle parsing of if clause modifiers. (cp_parser_omp_clause_num_tasks, cp_parser_omp_clause_grainsize, cp_parser_omp_clause_priority, cp_parser_omp_clause_hint, cp_parser_omp_clause_defaultmap): New functions. (cp_parser_omp_clause_ordered): Parse optional parameter. (cp_parser_omp_clause_reduction): Handle array reductions. (cp_parser_omp_clause_schedule): Parse optional simd modifier. (cp_parser_omp_clause_nogroup, cp_parser_omp_clause_orderedkind): New functions. (cp_parser_omp_clause_linear): Parse linear clause modifiers. (cp_parser_omp_clause_depend_sink): New function. (cp_parser_omp_clause_depend): Parse source/sink depend kinds. (cp_parser_omp_clause_map): Parse release/delete map kinds and optional always modifier. (cp_parser_oacc_all_clauses): Adjust cp_parser_omp_clause_if and finish_omp_clauses callers. (cp_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses. Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive. (OMP_CRITICAL_CLAUSE_MASK): Define. (cp_parser_omp_critical): Parse critical clauses. (cp_parser_omp_for_incr): Use cp_tree_equal if processing_template_decl. (cp_parser_omp_for_loop_init): Return tree instead of bool. Handle non-static data member iterators. (cp_parser_omp_for_loop): Handle doacross loops, adjust finish_omp_for and finish_omp_clauses callers. (cp_omp_split_clauses): Adjust finish_omp_clauses caller. (OMP_SIMD_CLAUSE_MASK): Add simdlen clause. (cp_parser_omp_simd): Allow ordered clause if it has no parameter. (OMP_FOR_CLAUSE_MASK): Add linear clause. (cp_parser_omp_for): Disallow ordered clause when combined with distribute. Disallow linear clause when combined with distribute and not combined with simd. (OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define. (cp_parser_omp_ordered): Add CONTEXT argument, return bool instead of tree, parse clauses and if depend clause is found, don't parse a body. (cp_parser_omp_parallel): Disallow copyin clause on target parallel. Allow target parallel without for after it. (OMP_TASK_CLAUSE_MASK): Add priority clause. (OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause. (cp_parser_omp_target_data): Diagnose no map clauses or clauses with invalid kinds. (OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses. (OMP_TARGET_ENTER_DATA_CLAUSE_MASK, OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define. (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data): New functions. (OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate, defaultmap and is_device_ptr clauses. (cp_parser_omp_target): Parse target parallel and target simd. Set OMP_TARGET_COMBINED on combined constructs. Parse target enter data and target exit data. Diagnose invalid map kinds. (cp_parser_oacc_cache): Adjust finish_omp_clauses caller. (OMP_DECLARE_TARGET_CLAUSE_MASK): Define. (cp_parser_omp_declare_target): Parse OpenMP 4.5 forms of this construct. (OMP_TASKLOOP_CLAUSE_MASK): Define. (cp_parser_omp_taskloop): New function. (cp_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here, handle PRAGMA_OMP_TASKLOOP. (cp_parser_pragma): Handle PRAGMA_OMP_ORDERED here directly, handle PRAGMA_OMP_TASKLOOP, call push_omp_privatization_clauses and pop_omp_privatization_clauses around parsing calls. (cp_parser_cilk_for): Adjust finish_omp_clauses caller. * pt.c (apply_late_template_attributes): Adjust tsubst_omp_clauses and finish_omp_clauses callers. (tsubst_omp_clause_decl): Return NULL if decl is NULL. For TREE_LIST, copy over OMP_CLAUSE_DEPEND_SINK_NEGATIVE bit. Use tsubst_expr instead of tsubst_copy, undo convert_from_reference effects. (tsubst_omp_clauses): Add ALLOW_FIELDS argument. Handle new OpenMP 4.5 clauses. Use tsubst_omp_clause_decl for more clauses. If ALLOW_FIELDS, handle non-static data members in the clauses. Clear OMP_CLAUSE_LINEAR_STEP if it has been cleared before. (omp_parallel_combined_clauses): New variable. (tsubst_omp_for_iterator): Add ORIG_DECLV argument, recur on OMP_FOR_ORIG_DECLS, handle non-static data member iterators. Improve handling of clauses on combined constructs. (tsubst_expr): Call push_omp_privatization_clauses and pop_omp_privatization_clauses around instantiation of certain OpenMP constructs, improve handling of clauses on combined constructs, handle OMP_TASKLOOP, adjust tsubst_omp_for_iterator, tsubst_omp_clauses and finish_omp_for callers, handle clauses on critical and ordered, handle OMP_TARGET_{ENTER,EXIT}_DATA. (instantiate_decl): Call save_omp_privatization_clauses and restore_omp_privatization_clauses around instantiation. (dependent_omp_for_p): Fix up comment typo. Handle SCOPE_REF. * semantics.c (omp_private_member_map, omp_private_member_vec, omp_private_member_ignore_next): New variables. (finish_non_static_data_member): Return dummy decl for privatized non-static data members. (omp_clause_decl_field, omp_clause_printable_decl, omp_note_field_privatization, omp_privatize_field): New functions. (handle_omp_array_sections_1): Fix comment typo. Add IS_OMP argument, handle structure element bases, diagnose bitfields, pass IS_OMP recursively, diagnose known zero length array sections in depend clauses, handle array sections in reduction clause, diagnose negative length even for pointers. (handle_omp_array_sections): Add IS_OMP argument, use auto_vec for types, pass IS_OMP down to handle_omp_array_sections_1, handle array sections in reduction clause, set OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP. (finish_omp_reduction_clause): Handle array sections and arrays. Use omp_clause_printable_decl. (finish_omp_declare_simd_methods, cp_finish_omp_clause_depend_sink): New functions. (finish_omp_clauses): Add ALLOW_FIELDS and DECLARE_SIMD arguments. Handle new OpenMP 4.5 clauses and new restrictions for the old ones, handle non-static data members, reject this keyword when not allowed. (push_omp_privatization_clauses, pop_omp_privatization_clauses, save_omp_privatization_clauses, restore_omp_privatization_clauses): New functions. (handle_omp_for_class_iterator): Handle OMP_TASKLOOP class iterators. Add collapse and ordered arguments. Fix handling of lastprivate iterators in doacross loops. (finish_omp_for): Add ORIG_DECLV argument, handle doacross loops, adjust c_finish_omp_for, handle_omp_for_class_iterator and finish_omp_clauses callers. Fill in OMP_CLAUSE_LINEAR_STEP on simd loops with non-static data member iterators. gcc/fortran/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * f95-lang.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, DEF_FUNCTION_TYPE_11, DEF_FUNCTION_TYPE_VAR_1): Define. * trans-openmp.c (gfc_trans_omp_clauses): Set OMP_CLAUSE_IF_MODIFIER to ERROR_MARK, OMP_CLAUSE_ORDERED_EXPR to NULL. (gfc_trans_omp_critical): Adjust for addition of clauses. (gfc_trans_omp_ordered): Likewise. * types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR, BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR, BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR, BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR, BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL, BT_FN_VOID_LONG_VAR, BT_FN_VOID_ULL_VAR): New. (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR, BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): Remove. gcc/lto/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> * lto-lang.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, DEF_FUNCTION_TYPE_11): Define. gcc/jit/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> * jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, DEF_FUNCTION_TYPE_11): Define. * jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, DEF_FUNCTION_TYPE_11): Define. gcc/ada/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> * gcc-interface/utils.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10, DEF_FUNCTION_TYPE_11): Define. gcc/testsuite/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> * c-c++-common/gomp/cancel-1.c (f2): Add map clause to target data. * c-c++-common/gomp/clauses-1.c: New test. * c-c++-common/gomp/clauses-2.c: New test. * c-c++-common/gomp/clauses-3.c: New test. * c-c++-common/gomp/clauses-4.c: New test. * c-c++-common/gomp/declare-target-1.c: New test. * c-c++-common/gomp/declare-target-2.c: New test. * c-c++-common/gomp/depend-3.c: New test. * c-c++-common/gomp/depend-4.c: New test. * c-c++-common/gomp/doacross-1.c: New test. * c-c++-common/gomp/if-1.c: New test. * c-c++-common/gomp/if-2.c: New test. * c-c++-common/gomp/linear-1.c: New test. * c-c++-common/gomp/map-2.c: New test. * c-c++-common/gomp/map-3.c: New test. * c-c++-common/gomp/nesting-1.c (f_omp_parallel, f_omp_target_data): Add map clause to target data. * c-c++-common/gomp/nesting-warn-1.c (f_omp_target): Likewise. * c-c++-common/gomp/ordered-1.c: New test. * c-c++-common/gomp/ordered-2.c: New test. * c-c++-common/gomp/ordered-3.c: New test. * c-c++-common/gomp/pr61486-1.c (foo): Remove linear clause on non-iterator. * c-c++-common/gomp/pr61486-2.c (test, test2): Remove ordered clause and ordered construct where no longer allowed. * c-c++-common/gomp/priority-1.c: New test. * c-c++-common/gomp/reduction-1.c: New test. * c-c++-common/gomp/schedule-simd-1.c: New test. * c-c++-common/gomp/sink-1.c: New test. * c-c++-common/gomp/sink-2.c: New test. * c-c++-common/gomp/sink-3.c: New test. * c-c++-common/gomp/sink-4.c: New test. * c-c++-common/gomp/udr-1.c: New test. * c-c++-common/taskloop-1.c: New test. * c-c++-common/cpp/openmp-define-3.c: Adjust for the new value of _OPENMP macro. * c-c++-common/cilk-plus/PS/body.c (foo): Adjust expected diagnostics. * c-c++-common/goacc-gomp/nesting-fail-1.c (f_acc_parallel, f_acc_kernels, f_acc_data, f_acc_loop): Add map clause to target data. * gcc.dg/gomp/clause-1.c: * gcc.dg/gomp/reduction-1.c: New test. * gcc.dg/gomp/sink-fold-1.c: New test. * gcc.dg/gomp/sink-fold-2.c: New test. * gcc.dg/gomp/sink-fold-3.c: New test. * gcc.dg/vect/vect-simd-clone-15.c: New test. * g++.dg/gomp/clause-1.C (T::test): Remove dg-error on privatization of non-static data members. * g++.dg/gomp/clause-3.C (foo): Remove one dg-error directive. Add some linear clause tests. * g++.dg/gomp/declare-simd-3.C: New test. * g++.dg/gomp/linear-1.C: New test. * g++.dg/gomp/member-1.C: New test. * g++.dg/gomp/member-2.C: New test. * g++.dg/gomp/pr66571-2.C: New test. * g++.dg/gomp/pr67504.C (foo): Add test for ordered clause with dependent argument. * g++.dg/gomp/pr67522.C (foo): Add test for invalid array section in reduction clause. * g++.dg/gomp/reference-1.C: New test. * g++.dg/gomp/sink-1.C: New test. * g++.dg/gomp/sink-2.C: New test. * g++.dg/gomp/sink-3.C: New test. * g++.dg/gomp/task-1.C: Remove both dg-error directives. * g++.dg/gomp/this-1.C: New test. * g++.dg/gomp/this-2.C: New test. * g++.dg/vect/simd-clone-2.cc: New test. * g++.dg/vect/simd-clone-2.h: New test. * g++.dg/vect/simd-clone-3.cc: New test. * g++.dg/vect/simd-clone-4.cc: New test. * g++.dg/vect/simd-clone-4.h: New test. * g++.dg/vect/simd-clone-5.cc: New test. include/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * gomp-constants.h (GOMP_MAP_FLAG_ALWAYS): Define. (enum gomp_map_kind): Add GOMP_MAP_FIRSTPRIVATE, GOMP_MAP_FIRSTPRIVATE_INT, GOMP_MAP_USE_DEVICE_PTR, GOMP_MAP_ZERO_LEN_ARRAY_SECTION, GOMP_MAP_ALWAYS_TO, GOMP_MAP_ALWAYS_FROM, GOMP_MAP_ALWAYS_TOFROM, GOMP_MAP_STRUCT, GOMP_MAP_DELETE_ZERO_LEN_ARRAY_SECTION, GOMP_MAP_DELETE, GOMP_MAP_RELEASE, GOMP_MAP_FIRSTPRIVATE_POINTER. (GOMP_MAP_ALWAYS_TO_P, GOMP_MAP_ALWAYS_FROM_P): Define. (GOMP_TASK_FLAG_UNTIED, GOMP_TASK_FLAG_FINAL, GOMP_TASK_FLAG_MERGEABLE, GOMP_TASK_FLAG_DEPEND, GOMP_TASK_FLAG_PRIORITY, GOMP_TASK_FLAG_UP, GOMP_TASK_FLAG_GRAINSIZE, GOMP_TASK_FLAG_IF, GOMP_TASK_FLAG_NOGROUP, GOMP_TARGET_FLAG_NOWAIT, GOMP_TARGET_FLAG_EXIT_DATA, GOMP_TARGET_FLAG_UPDATE): Define. libgomp/ 2015-10-13 Jakub Jelinek <jakub@redhat.com> Aldy Hernandez <aldyh@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * config/linux/affinity.c (omp_get_place_num_procs, omp_get_place_proc_ids, gomp_get_place_proc_ids_8): New functions. * config/linux/doacross.h: New file. * config/posix/affinity.c (omp_get_place_num_procs, omp_get_place_proc_ids, gomp_get_place_proc_ids_8): New functions. * config/posix/doacross.h: New file. * env.c: Include gomp-constants.h. (struct gomp_task_icv): Rename run_sched_modifier to run_sched_chunk_size. (gomp_max_task_priority_var): New variable. (parse_schedule): Rename run_sched_modifier to run_sched_chunk_size. (handle_omp_display_env): Change _OPENMP value from 201307 to 201511. Print OMP_MAX_TASK_PRIORITY. (initialize_env): Parse OMP_MAX_TASK_PRIORITY. (omp_set_schedule, omp_get_schedule): Rename modifier argument to chunk_size and run_sched_modifier to run_sched_chunk_size. (omp_get_max_task_priority, omp_get_initial_device, omp_get_num_places, omp_get_place_num, omp_get_partition_num_places, omp_get_partition_place_nums): New functions. * fortran.c (omp_set_schedule_, omp_set_schedule_8_, omp_get_schedule_, omp_get_schedule_8_): Rename modifier argument to chunk_size. (omp_get_num_places_, omp_get_place_num_procs_, omp_get_place_num_procs_8_, omp_get_place_proc_ids_, omp_get_place_proc_ids_8_, omp_get_place_num_, omp_get_partition_num_places_, omp_get_partition_place_nums_, omp_get_partition_place_nums_8_, omp_get_initial_device_, omp_get_max_task_priority_): New functions. * libgomp_g.h (GOMP_loop_doacross_static_start, GOMP_loop_doacross_dynamic_start, GOMP_loop_doacross_guided_start, GOMP_loop_doacross_runtime_start, GOMP_loop_ull_doacross_static_start, GOMP_loop_ull_doacross_dynamic_start, GOMP_loop_ull_doacross_guided_start, GOMP_loop_ull_doacross_runtime_start, GOMP_doacross_post, GOMP_doacross_wait, GOMP_doacross_ull_post, GOMP_doacross_wait, GOMP_taskloop, GOMP_taskloop_ull, GOMP_target_41, GOMP_target_data_41, GOMP_target_update_41, GOMP_target_enter_exit_data): New prototypes. (GOMP_task): Add prototype argument. * libgomp.h (_LIBGOMP_CHECKING_): Define to 0 if not yet defined. (struct gomp_doacross_work_share): New type. (struct gomp_work_share): Add doacross field. (struct gomp_task_icv): Rename run_sched_modifier to run_sched_chunk_size. (enum gomp_task_kind): Rename GOMP_TASK_IFFALSE to GOMP_TASK_UNDEFERRED. Add comments. (struct gomp_task_depend_entry): Add comments. (struct gomp_task): Likewise. (struct gomp_taskgroup): Likewise. (struct gomp_target_task): New type. (struct gomp_team): Add comment. (gomp_get_place_proc_ids_8, gomp_doacross_init, gomp_doacross_ull_init, gomp_task_maybe_wait_for_dependencies, gomp_create_target_task, gomp_target_task_fn): New prototypes. (struct target_var_desc): New type. (struct target_mem_desc): Adjust comment. Use struct target_var_desc instead of splay_tree_key for list. (REFCOUNT_INFINITY): Define. (struct splay_tree_key_s): Remove copy_from field. (struct gomp_device_descr): Add dev2dev_func field. (enum gomp_map_vars_kind): New enum. (gomp_map_vars): Add one argument. * libgomp.map (OMP_4.5): Export omp_get_max_task_priority, omp_get_max_task_priority_, omp_get_num_places, omp_get_num_places_, omp_get_place_num_procs, omp_get_place_num_procs_, omp_get_place_num_procs_8_, omp_get_place_proc_ids, omp_get_place_proc_ids_, omp_get_place_proc_ids_8_, omp_get_place_num, omp_get_place_num_, omp_get_partition_num_places, omp_get_partition_num_places_, omp_get_partition_place_nums, omp_get_partition_place_nums_, omp_get_partition_place_nums_8_, omp_get_initial_device, omp_get_initial_device_, omp_target_alloc, omp_target_free, omp_target_is_present, omp_target_memcpy, omp_target_memcpy_rect, omp_target_associate_ptr and omp_target_disassociate_ptr. (GOMP_4.0.2): Renamed to ... (GOMP_4.5): ... this. Export GOMP_target_41, GOMP_target_data_41, GOMP_target_update_41, GOMP_target_enter_exit_data, GOMP_taskloop, GOMP_taskloop_ull, GOMP_loop_doacross_dynamic_start, GOMP_loop_doacross_guided_start, GOMP_loop_doacross_runtime_start, GOMP_loop_doacross_static_start, GOMP_doacross_post, GOMP_doacross_wait, GOMP_loop_ull_doacross_dynamic_start, GOMP_loop_ull_doacross_guided_start, GOMP_loop_ull_doacross_runtime_start, GOMP_loop_ull_doacross_static_start, GOMP_doacross_ull_post and GOMP_doacross_ull_wait. * libgomp.texi: Document omp_get_max_task_priority. Rename modifier argument to chunk_size for omp_set_schedule and omp_get_schedule. Document OMP_MAX_TASK_PRIORITY env var. * loop.c (GOMP_loop_runtime_start): Adjust for run_sched_modifier to run_sched_chunk_size renaming. (GOMP_loop_ordered_runtime_start): Likewise. (gomp_loop_doacross_static_start, gomp_loop_doacross_dynamic_start, gomp_loop_doacross_guided_start, GOMP_loop_doacross_runtime_start, GOMP_parallel_loop_runtime_start): New functions. (GOMP_parallel_loop_runtime): Adjust for run_sched_modifier to run_sched_chunk_size renaming. (GOMP_loop_doacross_static_start, GOMP_loop_doacross_dynamic_start, GOMP_loop_doacross_guided_start): New functions or aliases. * loop_ull.c (GOMP_loop_ull_runtime_start): Adjust for run_sched_modifier to run_sched_chunk_size renaming. (GOMP_loop_ull_ordered_runtime_start): Likewise. (gomp_loop_ull_doacross_static_start, gomp_loop_ull_doacross_dynamic_start, gomp_loop_ull_doacross_guided_start, GOMP_loop_ull_doacross_runtime_start): New functions. (GOMP_loop_ull_doacross_static_start, GOMP_loop_ull_doacross_dynamic_start, GOMP_loop_ull_doacross_guided_start): New functions or aliases. * oacc-mem.c (acc_map_data, present_create_copy, gomp_acc_insert_pointer): Pass GOMP_MAP_VARS_OPENACC instead of false to gomp_map_vars. (gomp_acc_remove_pointer): Use copy_from from target_var_desc. * oacc-parallel.c (GOACC_data_start): Pass GOMP_MAP_VARS_OPENACC instead of false to gomp_map_vars. (GOACC_parallel_keyed): Likewise. Use copy_from from target_var_desc. * omp.h.in (omp_lock_hint_t): New type. (omp_init_lock_with_hint, omp_init_nest_lock_with_hint, omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids, omp_get_place_num, omp_get_partition_num_places, omp_get_partition_place_nums, omp_get_initial_device, omp_get_max_task_priority, omp_target_alloc, omp_target_free, omp_target_is_present, omp_target_memcpy, omp_target_memcpy_rect, omp_target_associate_ptr, omp_target_disassociate_ptr): New prototypes. * omp_lib.f90.in (omp_lock_hint_kind): New parameter. (omp_lock_hint_none, omp_lock_hint_uncontended, omp_lock_hint_contended, omp_lock_hint_nonspeculative, omp_lock_hint_speculative): New parameters. (omp_init_lock_with_hint, omp_init_nest_lock_with_hint, omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids, omp_get_place_num, omp_get_partition_num_places, omp_get_partition_place_nums, omp_get_initial_device, omp_get_max_task_priority): New interfaces. (omp_set_schedule, omp_get_schedule): Rename modifier argument to chunk_size. * omp_lib.h.in (omp_lock_hint_kind): New parameter. (omp_lock_hint_none, omp_lock_hint_uncontended, omp_lock_hint_contended, omp_lock_hint_nonspeculative, omp_lock_hint_speculative): New parameters. (omp_init_lock_with_hint, omp_init_nest_lock_with_hint, omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids, omp_get_place_num, omp_get_partition_num_places, omp_get_partition_place_nums, omp_get_initial_device, omp_get_max_task_priority): New functions and subroutines. * ordered.c: Include stdarg.h and string.h. (MAX_COLLAPSED_BITS): Define. (gomp_doacross_init, GOMP_doacross_post, GOMP_doacross_wait, gomp_doacross_ull_init, GOMP_doacross_ull_post, GOMP_doacross_ull_wait): New functions. * target.c: Include errno.h. (resolve_device): If device is not initialized, call gomp_init_device on it. (gomp_map_lookup): New function. (gomp_map_vars_existing): Add tgt_var argument, fill it in. Don't bump refcount if REFCOUNT_INFINITY. Handle GOMP_MAP_ALWAYS_TO_P. (get_kind): Rename is_openacc argument to short_mapkind. (gomp_map_pointer): Use gomp_map_lookup. (gomp_map_fields_existing): New function. (gomp_map_vars): Rename is_openacc argument to short_mapkind and is_target to pragma_kind. Handle GOMP_MAP_VARS_ENTER_DATA, handle GOMP_MAP_FIRSTPRIVATE_INT, GOMP_MAP_STRUCT, GOMP_MAP_USE_DEVICE_PTR, GOMP_MAP_ZERO_LEN_ARRAY_SECTION. Adjust for tgt->list changed type and copy_from living in there. (gomp_copy_from_async): Adjust for tgt->list changed type and copy_from living in there. (gomp_unmap_vars): Likewise. (gomp_update): Likewise. Rename is_openacc argument to short_mapkind. Don't fail if object is not mapped. (gomp_load_image_to_device): Initialize refcount to REFCOUNT_INFINITY. (gomp_target_fallback): New function. (gomp_get_target_fn_addr): Likewise. (GOMP_target): Adjust gomp_map_vars caller, use gomp_get_target_fn_addr and gomp_target_fallback. (GOMP_target_41): New function. (gomp_target_data_fallback): New function. (GOMP_target_data): Use it, adjust gomp_map_vars caller. (GOMP_target_data_41): New function. (GOMP_target_update): Adjust gomp_update caller. (GOMP_target_update_41): New function. (gomp_exit_data, GOMP_target_enter_exit_data, gomp_target_task_fn, omp_target_alloc, omp_target_free, omp_target_is_present, omp_target_memcpy, omp_target_memcpy_rect_worker, omp_target_memcpy_rect, omp_target_associate_ptr, omp_target_disassociate_ptr, gomp_load_plugin_for_device): New functions. * task.c: Include gomp-constants.h. Include taskloop.c twice to get GOMP_taskloop and GOMP_taskloop_ull definitions. (gomp_task_handle_depend): New function. (GOMP_task): Use it. Add priority argument. Use gomp-constant.h constants instead of hardcoded numbers. Rename GOMP_TASK_IFFALSE to GOMP_TASK_UNDEFERRED. (gomp_create_target_task): New function. (verify_children_queue, verify_taskgroup_queue, verify_task_queue): New functions. (gomp_task_run_pre): Call verify_*_queue functions. If an upcoming tied task is about to leave the sibling or taskgroup queues in an invalid state, adjust appropriately. Remove taskgroup argument. Add comments. (gomp_task_run_post_handle_dependers): Add comments. (gomp_task_run_post_remove_parent): Likewise. (gomp_barrier_handle_tasks): Adjust gomp_task_run_pre caller. (GOMP_taskwait): Likewise. Add comments. (gomp_task_maybe_wait_for_dependencies): Fix scheduling problem such that the first non parent_depends_on task does not end up at the end of the children queue. (GOMP_taskgroup_start): Rename GOMP_TASK_IFFALSE to GOMP_TASK_UNDEFERRED. (GOMP_taskgroup_end): Adjust gomp_task_run_pre caller. * taskloop.c: New file. * testsuite/lib/libgomp.exp (check_effective_target_offload_device_nonshared_as): New proc. * testsuite/libgomp.c/affinity-2.c: New test. * testsuite/libgomp.c/doacross-1.c: New test. * testsuite/libgomp.c/doacross-2.c: New test. * testsuite/libgomp.c/examples-4/declare_target-1.c (fib_wrapper): Add map clause to target. * testsuite/libgomp.c/examples-4/declare_target-4.c (accum): Likewise. * testsuite/libgomp.c/examples-4/declare_target-5.c (accum): Likewise. * testsuite/libgomp.c/examples-4/device-1.c (main): Likewise. * testsuite/libgomp.c/examples-4/device-3.c (main): Likewise. * testsuite/libgomp.c/examples-4/target_data-3.c (gramSchmidt): Likewise. * testsuite/libgomp.c/examples-4/teams-2.c (dotprod): Likewise. * testsuite/libgomp.c/examples-4/teams-3.c (dotprod): Likewise. * testsuite/libgomp.c/examples-4/teams-4.c (dotprod): Likewise. * testsuite/libgomp.c/for-2.h (OMPTGT, OMPTO, OMPFROM): Define if not defined. Use those where needed. * testsuite/libgomp.c/for-4.c: New test. * testsuite/libgomp.c/for-5.c: New test. * testsuite/libgomp.c/for-6.c: New test. * testsuite/libgomp.c/linear-1.c: New test. * testsuite/libgomp.c/ordered-4.c: New test. * testsuite/libgomp.c/pr66199-2.c (f2): Adjust for linear clause only allowed on the loop iterator. * testsuite/libgomp.c/pr66199-3.c: New test. * testsuite/libgomp.c/pr66199-4.c: New test. * testsuite/libgomp.c/reduction-7.c: New test. * testsuite/libgomp.c/reduction-8.c: New test. * testsuite/libgomp.c/reduction-9.c: New test. * testsuite/libgomp.c/reduction-10.c: New test. * testsuite/libgomp.c/target-1.c (fn2, fn3, fn4): Add map(tofrom:s). * testsuite/libgomp.c/target-2.c (fn2, fn3, fn4): Likewise. * testsuite/libgomp.c/target-7.c (foo): Add map(h) where needed. * testsuite/libgomp.c/target-11.c: New test. * testsuite/libgomp.c/target-12.c: New test. * testsuite/libgomp.c/target-13.c: New test. * testsuite/libgomp.c/target-14.c: New test. * testsuite/libgomp.c/target-15.c: New test. * testsuite/libgomp.c/target-16.c: New test. * testsuite/libgomp.c/target-17.c: New test. * testsuite/libgomp.c/target-18.c: New test. * testsuite/libgomp.c/target-19.c: New test. * testsuite/libgomp.c/target-20.c: New test. * testsuite/libgomp.c/target-21.c: New test. * testsuite/libgomp.c/target-22.c: New test. * testsuite/libgomp.c/target-23.c: New test. * testsuite/libgomp.c/target-24.c: New test. * testsuite/libgomp.c/target-25.c: New test. * testsuite/libgomp.c/target-26.c: New test. * testsuite/libgomp.c/target-27.c: New test. * testsuite/libgomp.c/taskloop-1.c: New test. * testsuite/libgomp.c/taskloop-2.c: New test. * testsuite/libgomp.c/taskloop-3.c: New test. * testsuite/libgomp.c/taskloop-4.c: New test. * testsuite/libgomp.c++/ctor-13.C: New test. * testsuite/libgomp.c++/doacross-1.C: New test. * testsuite/libgomp.c++/examples-4/declare_target-2.C: Replace offload_device with offload_device_nonshared_as. * testsuite/libgomp.c++/for-12.C: New test. * testsuite/libgomp.c++/for-13.C: New test. * testsuite/libgomp.c++/for-14.C: New test. * testsuite/libgomp.c++/linear-1.C: New test. * testsuite/libgomp.c++/member-1.C: New test. * testsuite/libgomp.c++/member-2.C: New test. * testsuite/libgomp.c++/member-3.C: New test. * testsuite/libgomp.c++/member-4.C: New test. * testsuite/libgomp.c++/member-5.C: New test. * testsuite/libgomp.c++/ordered-1.C: New test. * testsuite/libgomp.c++/reduction-5.C: New test. * testsuite/libgomp.c++/reduction-6.C: New test. * testsuite/libgomp.c++/reduction-7.C: New test. * testsuite/libgomp.c++/reduction-8.C: New test. * testsuite/libgomp.c++/reduction-9.C: New test. * testsuite/libgomp.c++/reduction-10.C: New test. * testsuite/libgomp.c++/reference-1.C: New test. * testsuite/libgomp.c++/simd14.C: New test. * testsuite/libgomp.c++/target-2.C (fn2): Add map(tofrom: s) clause. * testsuite/libgomp.c++/target-5.C: New test. * testsuite/libgomp.c++/target-6.C: New test. * testsuite/libgomp.c++/target-7.C: New test. * testsuite/libgomp.c++/target-8.C: New test. * testsuite/libgomp.c++/target-9.C: New test. * testsuite/libgomp.c++/target-10.C: New test. * testsuite/libgomp.c++/target-11.C: New test. * testsuite/libgomp.c++/target-12.C: New test. * testsuite/libgomp.c++/taskloop-1.C: New test. * testsuite/libgomp.c++/taskloop-2.C: New test. * testsuite/libgomp.c++/taskloop-3.C: New test. * testsuite/libgomp.c++/taskloop-4.C: New test. * testsuite/libgomp.c++/taskloop-5.C: New test. * testsuite/libgomp.c++/taskloop-6.C: New test. * testsuite/libgomp.c++/taskloop-7.C: New test. * testsuite/libgomp.c++/taskloop-8.C: New test. * testsuite/libgomp.c++/taskloop-9.C: New test. * testsuite/libgomp.fortran/affinity1.f90: New test. * testsuite/libgomp.fortran/affinity2.f90: New test. liboffloadmic/ 2015-10-13 Ilya Verbin <ilya.verbin@intel.com> * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_dev2dev): New function. * plugin/offload_target_main.cpp (__offload_target_tgt2tgt): New static function, register it in liboffloadmic. From-SVN: r228777
2015-10-13 21:06:23 +02:00
case SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP:
case SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP:
gcc/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * builtin-types.def (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR): Remove. (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): New. * cgraph.h (enum cgraph_simd_clone_arg_type): Add SIMD_CLONE_ARG_TYPE_LINEAR_REF_VARIABLE_STEP, SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_VARIABLE_STEP and SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP. (struct cgraph_simd_clone_arg): Adjust comment. * omp-builtins.def (BUILT_IN_GOMP_TARGET): Rename GOMP_target_41 to GOMP_target_ext. Add num_teams and thread_limit arguments. (BUILT_IN_GOMP_TARGET_DATA): Rename GOMP_target_data_41 to GOMP_target_data_ext. (BUILT_IN_GOMP_TARGET_UPDATE): Rename GOMP_target_update_41 to GOMP_target_update_ext. (BUILT_IN_GOMP_LOOP_NONMONOTONIC_DYNAMIC_START, BUILT_IN_GOMP_LOOP_NONMONOTONIC_GUIDED_START, BUILT_IN_GOMP_LOOP_NONMONOTONIC_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_NONMONOTONIC_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_GUIDED_START, BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_GUIDED_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_DYNAMIC, BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_GUIDED): New built-ins. * tree-core.h (enum omp_clause_schedule_kind): Add OMP_CLAUSE_SCHEDULE_MASK, OMP_CLAUSE_SCHEDULE_MONOTONIC, OMP_CLAUSE_SCHEDULE_NONMONOTONIC and change OMP_CLAUSE_SCHEDULE_LAST value. * tree.def (OMP_SIMD, CILK_SIMD, CILK_FOR, OMP_DISTRIBUTE, OMP_TASKLOOP, OACC_LOOP): Add OMP_FOR_ORIG_DECLS argument. * tree.h (OMP_FOR_ORIG_DECLS): Use OMP_LOOP_CHECK instead of OMP_FOR_CHECK. Remove comment. * tree-pretty-print.c (dump_omp_clause): Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE and GOMP_MAP_ALWAYS_POINTER. Simplify. Print schedule clause modifiers. * tree-vect-stmts.c (vectorizable_simd_clone_call): Add SIMD_CLONE_ARG_TYPE_LINEAR_{REF,VAL,UVAL}_VARIABLE_STEP cases. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_ALWAYS_TO. (omp_default_clause): Tweak for private/firstprivate/is_device_ptr variables on target construct and use_device_ptr on target data. (omp_check_private): Likewise. (omp_notice_variable): For references check whether what it refers to has mappable type, rather than the reference itself. (omp_is_private): Diagnose linear iteration variables on non-simd constructs. (omp_no_lastprivate): Return true only for Fortran. (gimplify_scan_omp_clauses): Or in GOVD_MAP_ALWAYS_TO for GOMP_MAP_ALWAYS_TO or GOMP_MAP_ALWAYS_TOFROM kinds. Add support for GOMP_MAP_FIRSTPRIVATE_REFERENCE and GOMP_MAP_ALWAYS_POINTER, remove old handling of structure element based array sections. Use GOMP_MAP_ALWAYS_P. Fix up handling of lastprivate and linear when combined with distribute. Gimplify variable low-bound for array reduction. Look through POINTER_PLUS_EXPR when looking for ADDR_EXPR for array section reductions. (gimplify_adjust_omp_clauses_1): For implicit references to variables with reference type and when not ref to scalar or ref to pointer, map what they refer to using tofrom and use GOMP_MAP_FIRSTPRIVATE_REFERENCE for the reference. (gimplify_adjust_omp_clauses): Remove GOMP_MAP_ALWAYS_POINTER from target exit data. Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE. Drop OMP_CLAUSE_MAP_PRIVATE support. Use GOMP_MAP_ALWAYS_P. Diagnose the same var on both firstprivate and lastprivate on distribute construct. (gimplify_omp_for): Fix up handling of predetermined lastprivate or linear iter vars when combined with distribute. (find_omp_teams, computable_teams_clause, optimize_target_teams): New functions. (gimplify_omp_workshare): Call optimize_target_teams. * omp-low.c (struct omp_region): Add sched_modifiers field. (struct omp_for_data): Likewise. (omp_any_child_fn_dumped): New variable. (extract_omp_for_data): Fill in sched_modifiers, and mask out OMP_CLAUSE_SCHEDULE_KIND bits outside of OMP_CLAUSE_SCHEDULE_MASK from sched_kind. (determine_parallel_type): Use only OMP_CLAUSE_SCHEDULE_MASK bits of OMP_CLAUSE_SCHED_KIND. (scan_sharing_clauses): Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE, drop OMP_CLAUSE_MAP_PRIVATE support. Look through POINTER_PLUS_EXPR for array section reductions. (add_taskreg_looptemp_clauses): Add one extra _looptemp_ clause even for distribute parallel for, if there are lastprivate clauses on the for. (lower_rec_input_clauses): Handle non-zero low-bound on array section reductions. (lower_reduction_clauses): Likewise. (lower_send_clauses): Look through POINTER_PLUS_EXPR for array section reductions. (expand_parallel_call): Use nonmonotonic entrypoints for nonmonotonic: dynamic/guided. (expand_omp_taskreg): Call assign_assembler_name_if_neeeded on child_fn if current_function_decl has assembler name set, but child_fn does not. Dump the header and IL of the child function when not in SSA form. (expand_omp_target): Likewise. Pass num_teams and thread_limit arguments to BUILT_IN_GOMP_TARGET. (expand_omp_for_static_nochunk, expand_omp_for_static_chunk): Initialize the extra _looptemp_ clause to fd->loop.n2. (expand_omp_for): Use nonmonotonic entrypoints for nonmonotonic: dynamic/guided. Initialize region->sched_modifiers. (expand_omp): Clear omp_any_child_fn_dumped. Dump function header again if we have dumped any child functions. (lower_omp_for_lastprivate): Determine the right count variable for distribute simd, or distribute parallel for{, simd}. (lower_omp_target): Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE and GOMP_MAP_ALWAYS_POINTER. Drop OMP_CLAUSE_MAP_PRIVATE support. (simd_clone_clauses_extract): Handle variable step for references and arguments passed by reference. (simd_clone_mangle): Mangle ref/uval/val variable steps. (simd_clone_adjust_argument_types): Handle SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_VARIABLE_STEP like SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP and SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP like SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP. (simd_clone_linear_addend): New function. (simd_clone_adjust): Handle variable step like similarly to constant step, use simd_clone_linear_addend to determine the actual step at runtime. gcc/c-family/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> * c-common.h (c_finish_omp_atomic): Add TEST argument. (c_omp_check_loop_iv, c_omp_check_loop_iv_exprs): New prototypes. * c-omp.c (c_finish_omp_atomic): Add TEST argument. Don't call save_expr or create_tmp_var* if TEST is true. (c_finish_omp_for): Store OMP_FOR_ORIG_DECLS always. Don't call add_stmt here. (struct c_omp_check_loop_iv_data): New type. (c_omp_check_loop_iv_r, c_omp_check_loop_iv, c_omp_check_loop_iv_exprs): New functions. (c_omp_split_clauses): Adjust for lastprivate being allowed on distribute. (c_omp_declare_simd_clauses_to_numbers): Change OMP_CLAUSE_LINEAR_VARIABLE_STRIDE OMP_CLAUSE_LINEAR_STEP into numbers. (c_omp_declare_simd_clauses_to_decls): Similarly change those from numbers to PARM_DECLs. gcc/c/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * c-parser.c: Include context.h and gimple-expr.h. (c_parser_omp_clause_schedule): Parse schedule modifiers, diagnose monotonic together with nonmonotonic. (c_parser_omp_for_loop): Call c_omp_check_loop_iv. Call add_stmt here. (OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause. (c_parser_omp_target_data, c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER. (c_parser_omp_target): Likewise. Evaluate num_teams and thread_limit expressions on combined target teams before the target. (c_parser_omp_declare_target): If decl has "omp declare target" or "omp declare target link" attribute, and cgraph or varpool node already exists, then set corresponding flags. Call c_finish_omp_clauses in the parenthesized extended-list syntax case. * c-decl.c (c_decl_attributes): Don't diagnose block scope vars inside declare target. * c-typeck.c (handle_omp_array_sections_1): Allow non-zero low-bound on OMP_CLAUSE_REDUCTION array sections. (handle_omp_array_sections): Encode low-bound into the MEM_REF, either into the constant offset, or for variable low-bound using POINTER_PLUS_EXPR. For structure element based array sections use GOMP_MAP_ALWAYS_POINTER instead of GOMP_MAP_FIRSTPRIVATE_POINTER. (c_finish_omp_clauses): Drop generic_field_head, structure elements are now always mapped even as array section bases, diagnose same var in data sharing and mapping clauses. Diagnose if linear step on declare simd is neither a constant nor a uniform parameter. Look through POINTER_PLUS_EXPR for array section reductions. Diagnose the same var or function appearing multiple times on the same directive. Fix up wording for the to clause if t is neither a FUNCTION_DECL nor a VAR_DECL. Diagnose nonmonotonic modifier on kinds other than dynamic or guided or nonmonotonic modifier together with ordered clause. gcc/cp/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * cp-tree.h (finish_omp_for): Add ORIG_INITS argument. (omp_privatize_field): Add SHARED argument. * parser.c: Include context.h. (cp_parser_omp_clause_schedule): Parse schedule modifiers, diagnose monotonic together with nonmonotonic. (cp_parser_omp_clause_linear): Add DECLARE_SIMD argument. Parse parameter name as linear step as id-expression rather than expression. (cp_parser_omp_all_clauses): Adjust caller. (cp_parser_omp_for_loop_init): Add ORIG_INIT argument, initialize it. Adjust omp_privatize_field caller. (cp_parser_omp_for_loop): Compute orig_inits, pass it's address to finish_omp_for. (OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause. (cp_parser_omp_target_data, cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER and GOMP_MAP_FIRSTPRIVATE_REFERENCE. (cp_parser_omp_target): Likewise. Evaluate num_teams and thread_limit expressions on combined target teams before the target. (cp_parser_omp_declare_target): If decl has "omp declare target" or "omp declare target link" attribute, and cgraph or varpool node already exists, then set corresponding flags. Call finish_omp_clauses in the parenthesized extended-list syntax case. Call cp_parser_require_pragma_eol instead of cp_parser_skip_to_pragma_eol. (cp_parser_omp_end_declare_target): Call cp_parser_require_pragma_eol instead of cp_parser_skip_to_pragma_eol. * decl2.c (cplus_decl_attributes): Don't diagnose block scope vars inside declare target. * pt.c (tsubst_omp_clauses): If OMP_CLAUSE_LINEAR_VARIABLE_STRIDE, use tsubst_omp_clause_decl instead of tsubst_expr on OMP_CLAUSE_LINEAR_STEP. Handle non-static data members in shared clauses. (tsubst_omp_for_iterator): Adjust omp_privatize_field caller. (tsubst_find_omp_teams): New function. (tsubst_expr): Evaluate num_teams and thread_limit expressions on combined target teams before the target. Use OMP_FOR_ORIG_DECLS for all OpenMP/OpenACC/Cilk+ looping constructs. Adjust finish_omp_for caller. * semantics.c (omp_privatize_field): Add SHARED argument, if true, always create artificial var and never put it into the hash table or vector. (handle_omp_array_sections_1): Adjust omp_privatize_field caller. Allow non-zero low-bound on OMP_CLAUSE_REDUCTION array sections. (handle_omp_array_sections): For structure element based array sections use GOMP_MAP_ALWAYS_POINTER instead of GOMP_MAP_FIRSTPRIVATE_POINTER. Encode low-bound into the MEM_REF, either into the constant offset, or for variable low-bound using POINTER_PLUS_EXPR. (finish_omp_clauses): Adjust omp_privatize_field caller. Drop generic_field_head, structure elements are now always mapped even as array section bases, diagnose same var in data sharing and mapping clauses. For references map what they refer to using GOMP_MAP_ALWAYS_POINTER for structure elements and GOMP_MAP_FIRSTPRIVATE_REFERENCE otherwise. Diagnose if linear step on declare simd is neither a constant nor a uniform parameter. Allow non-static data members on shared clauses. Look through POINTER_PLUS_EXPR for array section reductions. Diagnose nonmonotonic modifier on kinds other than dynamic or guided or nonmonotonic modifier together with ordered clause. Diagnose the same var or function appearing multiple times on the same directive. Fix up wording for the to clause if t is neither a FUNCTION_DECL nor a VAR_DECL, use special wording for OVERLOADs and TEMPLATE_ID_EXPR. (handle_omp_for_class_iterator): Add ORIG_DECLS argument. Call c_omp_check_loop_iv_exprs on cond. (finish_omp_for): Add ORIG_INITS argument. Call c_omp_check_loop_iv_exprs on ORIG_INITS elements. Adjust handle_omp_for_class_iterator caller. Call c_omp_check_loop_iv. Call add_stmt. (finish_omp_atomic): Adjust c_finish_omp_atomic caller. gcc/fortran/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> * types.def (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR): Remove. (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): New. gcc/testsuite/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> * c-c++-common/gomp/clauses-2.c (foo): Adjust for diagnostics of variables in both data sharing and mapping clauses and for structure element based array sections being mapped rather than privatized. * c-c++-common/gomp/declare-target-2.c: Add various new tests. Adjust expected diagnostics wording in one case. * c-c++-common/gomp/distribute-1.c: New test. * c-c++-common/gomp/element-1.c: New test. * c-c++-common/gomp/pr61486-2.c: Add #pragma omp declare target and #pragma omp end declare target pair around the function. Change s from a parameter to a file scope variable. * c-c++-common/gomp/pr67521.c: Add dg-error directives. * c-c++-common/gomp/reduction-1.c (foo): Don't expect diagnostics on non-zero low-bound in reduction array sections. Add further tests. * c-c++-common/gomp/schedule-modifiers-1.c: New test. * c-c++-common/gomp/target-teams-1.c: New test. * gcc.dg/gomp/declare-simd-1.c: Add scan-assembler-times directives for expected mangling on x86_64/i?86. * gcc.dg/gomp/declare-simd-3.c: New test. * gcc.dg/gomp/declare-simd-4.c: New test. * gcc.dg/gomp/for-20.c: New test. * gcc.dg/gomp/for-21.c: New test. * gcc.dg/gomp/for-22.c: New test. * gcc.dg/gomp/for-23.c: New test. * gcc.dg/gomp/for-24.c: New test. * gcc.dg/gomp/linear-1.c: New test. * gcc.dg/gomp/loop-1.c: New test. * g++.dg/gomp/atomic-17.C: New test. * g++.dg/gomp/clause-1.C (T::test): Don't expect error on non-static data member in shared clause. Add single construct. * g++.dg/gomp/declare-simd-1.C: Add dg-options. Add scan-assembler-times directives for expected mangling on x86_64/i?86. * g++.dg/gomp/declare-simd-3.C: Likewise. * g++.dg/gomp/declare-simd-4.C: New test. * g++.dg/gomp/declare-simd-5.C: New test. * g++.dg/gomp/declare-target-1.C: New test. * g++.dg/gomp/linear-2.C: New test. * g++.dg/gomp/loop-1.C: New test. * g++.dg/gomp/loop-2.C: New test. * g++.dg/gomp/loop-3.C: New test. * g++.dg/gomp/member-2.C (B::m2, B::m4): Don't expect error on non-static data member in shared clause. * g++.dg/gomp/member-3.C: New test. * g++.dg/gomp/member-4.C: New test. * g++.dg/gomp/pr38639.C (foo): Adjust dg-error. (bar): Remove dg-message. * g++.dg/gomp/target-teams-1.C: New test. include/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * gomp-constants.h (GOMP_MAP_FLAG_SPECIAL_2): Define. (GOMP_MAP_FLAG_ALWAYS): Remove. (enum gomp_map_kind): Use GOMP_MAP_FLAG_SPECIAL_2 instead of GOMP_MAP_FLAG_ALWAYS for GOMP_MAP_ALWAYS_TO, GOMP_MAP_ALWAYS_FROM, GOMP_MAP_ALWAYS_TOFROM, GOMP_MAP_STRUCT, GOMP_MAP_RELEASE. Add GOMP_MAP_ALWAYS_POINTER and GOMP_MAP_FIRSTPRIVATE_REFERENCE. (GOMP_MAP_ALWAYS_P): Define. (GOMP_TARGET_FLAG_NOWAIT): Adjust comment. libgomp/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * libgomp_g.h (GOMP_loop_nonmonotonic_dynamic_next, GOMP_loop_nonmonotonic_dynamic_start, GOMP_loop_nonmonotonic_guided_next, GOMP_loop_nonmonotonic_guided_start, GOMP_loop_ull_nonmonotonic_dynamic_next, GOMP_loop_ull_nonmonotonic_dynamic_start, GOMP_loop_ull_nonmonotonic_guided_next, GOMP_loop_ull_nonmonotonic_guided_start, GOMP_parallel_loop_nonmonotonic_dynamic, GOMP_parallel_loop_nonmonotonic_guided): New prototypes. (GOMP_target_41): Renamed to ... (GOMP_target_ext): ... this. Add num_teams and thread_limit arguments. (GOMP_target_data_41): Renamed to ... (GOMP_target_data_ext): ... this. (GOMP_target_update_41): Renamed to ... (GOMP_target_update_ext): ... this. * libgomp.map (GOMP_4.5): Export GOMP_target_ext, GOMP_target_data_ext and GOMP_target_update_ext instead of GOMP_target_41, GOMP_target_data_41 and GOMP_target_update_41. Export GOMP_loop_nonmonotonic_dynamic_next, GOMP_loop_nonmonotonic_dynamic_start, GOMP_loop_nonmonotonic_guided_next, GOMP_loop_nonmonotonic_guided_start, GOMP_loop_ull_nonmonotonic_dynamic_next, GOMP_loop_ull_nonmonotonic_dynamic_start, GOMP_loop_ull_nonmonotonic_guided_next, GOMP_loop_ull_nonmonotonic_guided_start, GOMP_parallel_loop_nonmonotonic_dynamic and GOMP_parallel_loop_nonmonotonic_guided. * loop.c (GOMP_parallel_loop_nonmonotonic_dynamic, GOMP_parallel_loop_nonmonotonic_guided, GOMP_loop_nonmonotonic_dynamic_start, GOMP_loop_nonmonotonic_guided_start, GOMP_loop_nonmonotonic_dynamic_next, GOMP_loop_nonmonotonic_guided_next): New aliases or functions. * loop_ull.c (GOMP_loop_ull_nonmonotonic_dynamic_start, GOMP_loop_ull_nonmonotonic_guided_start, GOMP_loop_ull_nonmonotonic_dynamic_next, GOMP_loop_ull_nonmonotonic_guided_next): Likewise. * target.c (gomp_map_0len_lookup, gomp_map_val): New inline functions. (gomp_map_vars): Handle GOMP_MAP_ALWAYS_POINTER. For GOMP_MAP_ZERO_LEN_ARRAY_SECTION use gomp_map_0len_lookup. Use gomp_map_val function. (gomp_target_fallback_firstprivate): New static function. (GOMP_target_41): Renamed to ... (GOMP_target_ext): ... this. Add num_teams and thread_limit arguments. Move firstprivate fallback handling into a new function. (GOMP_target_data_41): Renamed to ... (GOMP_target_data_ext): ... this. (GOMP_target_update_41): Renamed to ... (GOMP_target_update_ext): ... this. (gomp_exit_data): For GOMP_MAP_*ZERO_LEN* use gomp_map_0len_lookup instead of gomp_map_lookup. (omp_target_is_present): Use gomp_map_0len_lookup instead of gomp_map_lookup. * testsuite/libgomp.c/target-28.c: Likewise. * testsuite/libgomp.c/monotonic-1.c: New test. * testsuite/libgomp.c/monotonic-2.c: New test. * testsuite/libgomp.c/nonmonotonic-1.c: New test. * testsuite/libgomp.c/nonmonotonic-2.c: New test. * testsuite/libgomp.c/pr66199-5.c: New test. * testsuite/libgomp.c/pr66199-6.c: New test. * testsuite/libgomp.c/pr66199-7.c: New test. * testsuite/libgomp.c/pr66199-8.c: New test. * testsuite/libgomp.c/pr66199-9.c: New test. * testsuite/libgomp.c/reduction-11.c: New test. * testsuite/libgomp.c/reduction-12.c: New test. * testsuite/libgomp.c/reduction-13.c: New test. * testsuite/libgomp.c/reduction-14.c: New test. * testsuite/libgomp.c/reduction-15.c: New test. * testsuite/libgomp.c/target-12.c (main): Adjust for omp_target_is_present change for one-past-last element. * testsuite/libgomp.c/target-17.c (foo): Drop tests where the same var is both mapped and privatized. * testsuite/libgomp.c/target-19.c (foo): Adjust for different handling of zero-length array sections. * testsuite/libgomp.c/target-28.c: New test. * testsuite/libgomp.c/target-29.c: New test. * testsuite/libgomp.c/target-30.c: New test. * testsuite/libgomp.c/target-teams-1.c: New test. * testsuite/libgomp.c++/member-6.C: New test. * testsuite/libgomp.c++/member-7.C: New test. * testsuite/libgomp.c++/monotonic-1.C: New test. * testsuite/libgomp.c++/monotonic-2.C: New test. * testsuite/libgomp.c++/nonmonotonic-1.C: New test. * testsuite/libgomp.c++/nonmonotonic-2.C: New test. * testsuite/libgomp.c++/pr66199-3.C: New test. * testsuite/libgomp.c++/pr66199-4.C: New test. * testsuite/libgomp.c++/pr66199-5.C: New test. * testsuite/libgomp.c++/pr66199-6.C: New test. * testsuite/libgomp.c++/pr66199-7.C: New test. * testsuite/libgomp.c++/pr66199-8.C: New test. * testsuite/libgomp.c++/pr66199-9.C: New test. * testsuite/libgomp.c++/reduction-11.C: New test. * testsuite/libgomp.c++/reduction-12.C: New test. * testsuite/libgomp.c++/target-13.C: New test. * testsuite/libgomp.c++/target-14.C: New test. * testsuite/libgomp.c++/target-15.C: New test. * testsuite/libgomp.c++/target-16.C: New test. * testsuite/libgomp.c++/target-17.C: New test. * testsuite/libgomp.c++/target-18.C: New test. * testsuite/libgomp.c++/target-19.C: New test. Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com> From-SVN: r229814
2015-11-05 16:08:08 +01:00
case SIMD_CLONE_ARG_TYPE_LINEAR_REF_VARIABLE_STEP:
case SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP:
case SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_VARIABLE_STEP:
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
/* FORNOW */
i = -1;
break;
case SIMD_CLONE_ARG_TYPE_MASK:
gcc_unreachable ();
}
if (i == (size_t) -1)
break;
if (n->simdclone->args[i].alignment > arginfo[i].align)
{
i = -1;
break;
}
if (arginfo[i].align)
this_badness += (exact_log2 (arginfo[i].align)
- exact_log2 (n->simdclone->args[i].alignment));
}
if (i == (size_t) -1)
continue;
if (bestn == NULL || this_badness < badness)
{
bestn = n;
badness = this_badness;
}
}
if (bestn == NULL)
return false;
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
for (i = 0; i < nargs; i++)
if ((arginfo[i].dt == vect_constant_def
|| arginfo[i].dt == vect_external_def)
&& bestn->simdclone->args[i].arg_type == SIMD_CLONE_ARG_TYPE_VECTOR)
{
arginfo[i].vectype
= get_vectype_for_scalar_type (TREE_TYPE (gimple_call_arg (stmt,
i)));
if (arginfo[i].vectype == NULL
|| (TYPE_VECTOR_SUBPARTS (arginfo[i].vectype)
> bestn->simdclone->simdlen))
return false;
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
}
fndecl = bestn->decl;
nunits = bestn->simdclone->simdlen;
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
/* If the function isn't const, only allow it in simd loops where user
has asserted that at least nunits consecutive iterations can be
performed using SIMD instructions. */
if ((loop == NULL || (unsigned) loop->safelen < nunits)
&& gimple_vuse (stmt))
return false;
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
/* Sanity check: make sure that at least one copy of the vectorized stmt
needs to be generated. */
gcc_assert (ncopies >= 1);
if (!vec_stmt) /* transformation not required. */
{
STMT_VINFO_SIMD_CLONE_INFO (stmt_info).safe_push (bestn->decl);
for (i = 0; i < nargs; i++)
if ((bestn->simdclone->args[i].arg_type
== SIMD_CLONE_ARG_TYPE_LINEAR_CONSTANT_STEP)
|| (bestn->simdclone->args[i].arg_type
== SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP))
{
STMT_VINFO_SIMD_CLONE_INFO (stmt_info).safe_grow_cleared (i * 3
+ 1);
STMT_VINFO_SIMD_CLONE_INFO (stmt_info).safe_push (arginfo[i].op);
tree lst = POINTER_TYPE_P (TREE_TYPE (arginfo[i].op))
? size_type_node : TREE_TYPE (arginfo[i].op);
tree ls = build_int_cst (lst, arginfo[i].linear_step);
STMT_VINFO_SIMD_CLONE_INFO (stmt_info).safe_push (ls);
tree sll = arginfo[i].simd_lane_linear
? boolean_true_node : boolean_false_node;
STMT_VINFO_SIMD_CLONE_INFO (stmt_info).safe_push (sll);
}
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
STMT_VINFO_TYPE (stmt_info) = call_simd_clone_vec_info_type;
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location,
"=== vectorizable_simd_clone_call ===\n");
/* vect_model_simple_cost (stmt_info, ncopies, dt, NULL, NULL); */
return true;
}
/** Transform. **/
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location, "transform call.\n");
/* Handle def. */
scalar_dest = gimple_call_lhs (stmt);
vec_dest = NULL_TREE;
rtype = NULL_TREE;
ratype = NULL_TREE;
if (scalar_dest)
{
vec_dest = vect_create_destination_var (scalar_dest, vectype);
rtype = TREE_TYPE (TREE_TYPE (fndecl));
if (TREE_CODE (rtype) == ARRAY_TYPE)
{
ratype = rtype;
rtype = TREE_TYPE (ratype);
}
}
prev_stmt_info = NULL;
for (j = 0; j < ncopies; ++j)
{
/* Build argument list for the vectorized call. */
if (j == 0)
vargs.create (nargs);
else
vargs.truncate (0);
for (i = 0; i < nargs; i++)
{
unsigned int k, l, m, o;
tree atype;
op = gimple_call_arg (stmt, i);
switch (bestn->simdclone->args[i].arg_type)
{
case SIMD_CLONE_ARG_TYPE_VECTOR:
atype = bestn->simdclone->args[i].vector_type;
o = nunits / TYPE_VECTOR_SUBPARTS (atype);
for (m = j * o; m < (j + 1) * o; m++)
{
if (TYPE_VECTOR_SUBPARTS (atype)
< TYPE_VECTOR_SUBPARTS (arginfo[i].vectype))
{
unsigned int prec = GET_MODE_BITSIZE (TYPE_MODE (atype));
k = (TYPE_VECTOR_SUBPARTS (arginfo[i].vectype)
/ TYPE_VECTOR_SUBPARTS (atype));
gcc_assert ((k & (k - 1)) == 0);
if (m == 0)
vec_oprnd0
= vect_get_vec_def_for_operand (op, stmt);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
else
{
vec_oprnd0 = arginfo[i].op;
if ((m & (k - 1)) == 0)
vec_oprnd0
= vect_get_vec_def_for_stmt_copy (arginfo[i].dt,
vec_oprnd0);
}
arginfo[i].op = vec_oprnd0;
vec_oprnd0
= build3 (BIT_FIELD_REF, atype, vec_oprnd0,
size_int (prec),
bitsize_int ((m & (k - 1)) * prec));
new_stmt
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
= gimple_build_assign (make_ssa_name (atype),
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
vec_oprnd0);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
vargs.safe_push (gimple_assign_lhs (new_stmt));
}
else
{
k = (TYPE_VECTOR_SUBPARTS (atype)
/ TYPE_VECTOR_SUBPARTS (arginfo[i].vectype));
gcc_assert ((k & (k - 1)) == 0);
vec<constructor_elt, va_gc> *ctor_elts;
if (k != 1)
vec_alloc (ctor_elts, k);
else
ctor_elts = NULL;
for (l = 0; l < k; l++)
{
if (m == 0 && l == 0)
vec_oprnd0
= vect_get_vec_def_for_operand (op, stmt);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
else
vec_oprnd0
= vect_get_vec_def_for_stmt_copy (arginfo[i].dt,
arginfo[i].op);
arginfo[i].op = vec_oprnd0;
if (k == 1)
break;
CONSTRUCTOR_APPEND_ELT (ctor_elts, NULL_TREE,
vec_oprnd0);
}
if (k == 1)
vargs.safe_push (vec_oprnd0);
else
{
vec_oprnd0 = build_constructor (atype, ctor_elts);
new_stmt
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
= gimple_build_assign (make_ssa_name (atype),
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
vec_oprnd0);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
vargs.safe_push (gimple_assign_lhs (new_stmt));
}
}
}
break;
case SIMD_CLONE_ARG_TYPE_UNIFORM:
vargs.safe_push (op);
break;
case SIMD_CLONE_ARG_TYPE_LINEAR_CONSTANT_STEP:
case SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP:
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
if (j == 0)
{
gimple_seq stmts;
arginfo[i].op
= force_gimple_operand (arginfo[i].op, &stmts, true,
NULL_TREE);
if (stmts != NULL)
{
basic_block new_bb;
edge pe = loop_preheader_edge (loop);
new_bb = gsi_insert_seq_on_edge_immediate (pe, stmts);
gcc_assert (!new_bb);
}
if (arginfo[i].simd_lane_linear)
{
vargs.safe_push (arginfo[i].op);
break;
}
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
tree phi_res = copy_ssa_name (op);
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 *new_phi = create_phi_node (phi_res, loop->header);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
set_vinfo_for_stmt (new_phi,
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
new_stmt_vec_info (new_phi, loop_vinfo));
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
add_phi_arg (new_phi, arginfo[i].op,
loop_preheader_edge (loop), UNKNOWN_LOCATION);
enum tree_code code
= POINTER_TYPE_P (TREE_TYPE (op))
? POINTER_PLUS_EXPR : PLUS_EXPR;
tree type = POINTER_TYPE_P (TREE_TYPE (op))
? sizetype : TREE_TYPE (op);
2014-05-06 18:25:05 +02:00
widest_int cst
= wi::mul (bestn->simdclone->args[i].linear_step,
ncopies * nunits);
tree tcst = wide_int_to_tree (type, cst);
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
tree phi_arg = copy_ssa_name (op);
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 (phi_arg, code, phi_res, tcst);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
gimple_stmt_iterator si = gsi_after_labels (loop->header);
gsi_insert_after (&si, new_stmt, GSI_NEW_STMT);
set_vinfo_for_stmt (new_stmt,
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
new_stmt_vec_info (new_stmt, loop_vinfo));
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
add_phi_arg (new_phi, phi_arg, loop_latch_edge (loop),
UNKNOWN_LOCATION);
arginfo[i].op = phi_res;
vargs.safe_push (phi_res);
}
else
{
enum tree_code code
= POINTER_TYPE_P (TREE_TYPE (op))
? POINTER_PLUS_EXPR : PLUS_EXPR;
tree type = POINTER_TYPE_P (TREE_TYPE (op))
? sizetype : TREE_TYPE (op);
2014-05-06 18:25:05 +02:00
widest_int cst
= wi::mul (bestn->simdclone->args[i].linear_step,
j * nunits);
tree tcst = wide_int_to_tree (type, cst);
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
new_temp = make_ssa_name (TREE_TYPE (op));
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 (new_temp, code,
arginfo[i].op, tcst);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
vargs.safe_push (new_temp);
}
break;
case SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP:
case SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP:
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
case SIMD_CLONE_ARG_TYPE_LINEAR_VARIABLE_STEP:
gcc/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * builtin-types.def (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR): Remove. (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): New. * cgraph.h (enum cgraph_simd_clone_arg_type): Add SIMD_CLONE_ARG_TYPE_LINEAR_REF_VARIABLE_STEP, SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_VARIABLE_STEP and SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP. (struct cgraph_simd_clone_arg): Adjust comment. * omp-builtins.def (BUILT_IN_GOMP_TARGET): Rename GOMP_target_41 to GOMP_target_ext. Add num_teams and thread_limit arguments. (BUILT_IN_GOMP_TARGET_DATA): Rename GOMP_target_data_41 to GOMP_target_data_ext. (BUILT_IN_GOMP_TARGET_UPDATE): Rename GOMP_target_update_41 to GOMP_target_update_ext. (BUILT_IN_GOMP_LOOP_NONMONOTONIC_DYNAMIC_START, BUILT_IN_GOMP_LOOP_NONMONOTONIC_GUIDED_START, BUILT_IN_GOMP_LOOP_NONMONOTONIC_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_NONMONOTONIC_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_GUIDED_START, BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_GUIDED_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_DYNAMIC, BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_GUIDED): New built-ins. * tree-core.h (enum omp_clause_schedule_kind): Add OMP_CLAUSE_SCHEDULE_MASK, OMP_CLAUSE_SCHEDULE_MONOTONIC, OMP_CLAUSE_SCHEDULE_NONMONOTONIC and change OMP_CLAUSE_SCHEDULE_LAST value. * tree.def (OMP_SIMD, CILK_SIMD, CILK_FOR, OMP_DISTRIBUTE, OMP_TASKLOOP, OACC_LOOP): Add OMP_FOR_ORIG_DECLS argument. * tree.h (OMP_FOR_ORIG_DECLS): Use OMP_LOOP_CHECK instead of OMP_FOR_CHECK. Remove comment. * tree-pretty-print.c (dump_omp_clause): Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE and GOMP_MAP_ALWAYS_POINTER. Simplify. Print schedule clause modifiers. * tree-vect-stmts.c (vectorizable_simd_clone_call): Add SIMD_CLONE_ARG_TYPE_LINEAR_{REF,VAL,UVAL}_VARIABLE_STEP cases. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_ALWAYS_TO. (omp_default_clause): Tweak for private/firstprivate/is_device_ptr variables on target construct and use_device_ptr on target data. (omp_check_private): Likewise. (omp_notice_variable): For references check whether what it refers to has mappable type, rather than the reference itself. (omp_is_private): Diagnose linear iteration variables on non-simd constructs. (omp_no_lastprivate): Return true only for Fortran. (gimplify_scan_omp_clauses): Or in GOVD_MAP_ALWAYS_TO for GOMP_MAP_ALWAYS_TO or GOMP_MAP_ALWAYS_TOFROM kinds. Add support for GOMP_MAP_FIRSTPRIVATE_REFERENCE and GOMP_MAP_ALWAYS_POINTER, remove old handling of structure element based array sections. Use GOMP_MAP_ALWAYS_P. Fix up handling of lastprivate and linear when combined with distribute. Gimplify variable low-bound for array reduction. Look through POINTER_PLUS_EXPR when looking for ADDR_EXPR for array section reductions. (gimplify_adjust_omp_clauses_1): For implicit references to variables with reference type and when not ref to scalar or ref to pointer, map what they refer to using tofrom and use GOMP_MAP_FIRSTPRIVATE_REFERENCE for the reference. (gimplify_adjust_omp_clauses): Remove GOMP_MAP_ALWAYS_POINTER from target exit data. Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE. Drop OMP_CLAUSE_MAP_PRIVATE support. Use GOMP_MAP_ALWAYS_P. Diagnose the same var on both firstprivate and lastprivate on distribute construct. (gimplify_omp_for): Fix up handling of predetermined lastprivate or linear iter vars when combined with distribute. (find_omp_teams, computable_teams_clause, optimize_target_teams): New functions. (gimplify_omp_workshare): Call optimize_target_teams. * omp-low.c (struct omp_region): Add sched_modifiers field. (struct omp_for_data): Likewise. (omp_any_child_fn_dumped): New variable. (extract_omp_for_data): Fill in sched_modifiers, and mask out OMP_CLAUSE_SCHEDULE_KIND bits outside of OMP_CLAUSE_SCHEDULE_MASK from sched_kind. (determine_parallel_type): Use only OMP_CLAUSE_SCHEDULE_MASK bits of OMP_CLAUSE_SCHED_KIND. (scan_sharing_clauses): Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE, drop OMP_CLAUSE_MAP_PRIVATE support. Look through POINTER_PLUS_EXPR for array section reductions. (add_taskreg_looptemp_clauses): Add one extra _looptemp_ clause even for distribute parallel for, if there are lastprivate clauses on the for. (lower_rec_input_clauses): Handle non-zero low-bound on array section reductions. (lower_reduction_clauses): Likewise. (lower_send_clauses): Look through POINTER_PLUS_EXPR for array section reductions. (expand_parallel_call): Use nonmonotonic entrypoints for nonmonotonic: dynamic/guided. (expand_omp_taskreg): Call assign_assembler_name_if_neeeded on child_fn if current_function_decl has assembler name set, but child_fn does not. Dump the header and IL of the child function when not in SSA form. (expand_omp_target): Likewise. Pass num_teams and thread_limit arguments to BUILT_IN_GOMP_TARGET. (expand_omp_for_static_nochunk, expand_omp_for_static_chunk): Initialize the extra _looptemp_ clause to fd->loop.n2. (expand_omp_for): Use nonmonotonic entrypoints for nonmonotonic: dynamic/guided. Initialize region->sched_modifiers. (expand_omp): Clear omp_any_child_fn_dumped. Dump function header again if we have dumped any child functions. (lower_omp_for_lastprivate): Determine the right count variable for distribute simd, or distribute parallel for{, simd}. (lower_omp_target): Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE and GOMP_MAP_ALWAYS_POINTER. Drop OMP_CLAUSE_MAP_PRIVATE support. (simd_clone_clauses_extract): Handle variable step for references and arguments passed by reference. (simd_clone_mangle): Mangle ref/uval/val variable steps. (simd_clone_adjust_argument_types): Handle SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_VARIABLE_STEP like SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP and SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP like SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP. (simd_clone_linear_addend): New function. (simd_clone_adjust): Handle variable step like similarly to constant step, use simd_clone_linear_addend to determine the actual step at runtime. gcc/c-family/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> * c-common.h (c_finish_omp_atomic): Add TEST argument. (c_omp_check_loop_iv, c_omp_check_loop_iv_exprs): New prototypes. * c-omp.c (c_finish_omp_atomic): Add TEST argument. Don't call save_expr or create_tmp_var* if TEST is true. (c_finish_omp_for): Store OMP_FOR_ORIG_DECLS always. Don't call add_stmt here. (struct c_omp_check_loop_iv_data): New type. (c_omp_check_loop_iv_r, c_omp_check_loop_iv, c_omp_check_loop_iv_exprs): New functions. (c_omp_split_clauses): Adjust for lastprivate being allowed on distribute. (c_omp_declare_simd_clauses_to_numbers): Change OMP_CLAUSE_LINEAR_VARIABLE_STRIDE OMP_CLAUSE_LINEAR_STEP into numbers. (c_omp_declare_simd_clauses_to_decls): Similarly change those from numbers to PARM_DECLs. gcc/c/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * c-parser.c: Include context.h and gimple-expr.h. (c_parser_omp_clause_schedule): Parse schedule modifiers, diagnose monotonic together with nonmonotonic. (c_parser_omp_for_loop): Call c_omp_check_loop_iv. Call add_stmt here. (OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause. (c_parser_omp_target_data, c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER. (c_parser_omp_target): Likewise. Evaluate num_teams and thread_limit expressions on combined target teams before the target. (c_parser_omp_declare_target): If decl has "omp declare target" or "omp declare target link" attribute, and cgraph or varpool node already exists, then set corresponding flags. Call c_finish_omp_clauses in the parenthesized extended-list syntax case. * c-decl.c (c_decl_attributes): Don't diagnose block scope vars inside declare target. * c-typeck.c (handle_omp_array_sections_1): Allow non-zero low-bound on OMP_CLAUSE_REDUCTION array sections. (handle_omp_array_sections): Encode low-bound into the MEM_REF, either into the constant offset, or for variable low-bound using POINTER_PLUS_EXPR. For structure element based array sections use GOMP_MAP_ALWAYS_POINTER instead of GOMP_MAP_FIRSTPRIVATE_POINTER. (c_finish_omp_clauses): Drop generic_field_head, structure elements are now always mapped even as array section bases, diagnose same var in data sharing and mapping clauses. Diagnose if linear step on declare simd is neither a constant nor a uniform parameter. Look through POINTER_PLUS_EXPR for array section reductions. Diagnose the same var or function appearing multiple times on the same directive. Fix up wording for the to clause if t is neither a FUNCTION_DECL nor a VAR_DECL. Diagnose nonmonotonic modifier on kinds other than dynamic or guided or nonmonotonic modifier together with ordered clause. gcc/cp/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * cp-tree.h (finish_omp_for): Add ORIG_INITS argument. (omp_privatize_field): Add SHARED argument. * parser.c: Include context.h. (cp_parser_omp_clause_schedule): Parse schedule modifiers, diagnose monotonic together with nonmonotonic. (cp_parser_omp_clause_linear): Add DECLARE_SIMD argument. Parse parameter name as linear step as id-expression rather than expression. (cp_parser_omp_all_clauses): Adjust caller. (cp_parser_omp_for_loop_init): Add ORIG_INIT argument, initialize it. Adjust omp_privatize_field caller. (cp_parser_omp_for_loop): Compute orig_inits, pass it's address to finish_omp_for. (OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause. (cp_parser_omp_target_data, cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER and GOMP_MAP_FIRSTPRIVATE_REFERENCE. (cp_parser_omp_target): Likewise. Evaluate num_teams and thread_limit expressions on combined target teams before the target. (cp_parser_omp_declare_target): If decl has "omp declare target" or "omp declare target link" attribute, and cgraph or varpool node already exists, then set corresponding flags. Call finish_omp_clauses in the parenthesized extended-list syntax case. Call cp_parser_require_pragma_eol instead of cp_parser_skip_to_pragma_eol. (cp_parser_omp_end_declare_target): Call cp_parser_require_pragma_eol instead of cp_parser_skip_to_pragma_eol. * decl2.c (cplus_decl_attributes): Don't diagnose block scope vars inside declare target. * pt.c (tsubst_omp_clauses): If OMP_CLAUSE_LINEAR_VARIABLE_STRIDE, use tsubst_omp_clause_decl instead of tsubst_expr on OMP_CLAUSE_LINEAR_STEP. Handle non-static data members in shared clauses. (tsubst_omp_for_iterator): Adjust omp_privatize_field caller. (tsubst_find_omp_teams): New function. (tsubst_expr): Evaluate num_teams and thread_limit expressions on combined target teams before the target. Use OMP_FOR_ORIG_DECLS for all OpenMP/OpenACC/Cilk+ looping constructs. Adjust finish_omp_for caller. * semantics.c (omp_privatize_field): Add SHARED argument, if true, always create artificial var and never put it into the hash table or vector. (handle_omp_array_sections_1): Adjust omp_privatize_field caller. Allow non-zero low-bound on OMP_CLAUSE_REDUCTION array sections. (handle_omp_array_sections): For structure element based array sections use GOMP_MAP_ALWAYS_POINTER instead of GOMP_MAP_FIRSTPRIVATE_POINTER. Encode low-bound into the MEM_REF, either into the constant offset, or for variable low-bound using POINTER_PLUS_EXPR. (finish_omp_clauses): Adjust omp_privatize_field caller. Drop generic_field_head, structure elements are now always mapped even as array section bases, diagnose same var in data sharing and mapping clauses. For references map what they refer to using GOMP_MAP_ALWAYS_POINTER for structure elements and GOMP_MAP_FIRSTPRIVATE_REFERENCE otherwise. Diagnose if linear step on declare simd is neither a constant nor a uniform parameter. Allow non-static data members on shared clauses. Look through POINTER_PLUS_EXPR for array section reductions. Diagnose nonmonotonic modifier on kinds other than dynamic or guided or nonmonotonic modifier together with ordered clause. Diagnose the same var or function appearing multiple times on the same directive. Fix up wording for the to clause if t is neither a FUNCTION_DECL nor a VAR_DECL, use special wording for OVERLOADs and TEMPLATE_ID_EXPR. (handle_omp_for_class_iterator): Add ORIG_DECLS argument. Call c_omp_check_loop_iv_exprs on cond. (finish_omp_for): Add ORIG_INITS argument. Call c_omp_check_loop_iv_exprs on ORIG_INITS elements. Adjust handle_omp_for_class_iterator caller. Call c_omp_check_loop_iv. Call add_stmt. (finish_omp_atomic): Adjust c_finish_omp_atomic caller. gcc/fortran/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> * types.def (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR): Remove. (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): New. gcc/testsuite/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> * c-c++-common/gomp/clauses-2.c (foo): Adjust for diagnostics of variables in both data sharing and mapping clauses and for structure element based array sections being mapped rather than privatized. * c-c++-common/gomp/declare-target-2.c: Add various new tests. Adjust expected diagnostics wording in one case. * c-c++-common/gomp/distribute-1.c: New test. * c-c++-common/gomp/element-1.c: New test. * c-c++-common/gomp/pr61486-2.c: Add #pragma omp declare target and #pragma omp end declare target pair around the function. Change s from a parameter to a file scope variable. * c-c++-common/gomp/pr67521.c: Add dg-error directives. * c-c++-common/gomp/reduction-1.c (foo): Don't expect diagnostics on non-zero low-bound in reduction array sections. Add further tests. * c-c++-common/gomp/schedule-modifiers-1.c: New test. * c-c++-common/gomp/target-teams-1.c: New test. * gcc.dg/gomp/declare-simd-1.c: Add scan-assembler-times directives for expected mangling on x86_64/i?86. * gcc.dg/gomp/declare-simd-3.c: New test. * gcc.dg/gomp/declare-simd-4.c: New test. * gcc.dg/gomp/for-20.c: New test. * gcc.dg/gomp/for-21.c: New test. * gcc.dg/gomp/for-22.c: New test. * gcc.dg/gomp/for-23.c: New test. * gcc.dg/gomp/for-24.c: New test. * gcc.dg/gomp/linear-1.c: New test. * gcc.dg/gomp/loop-1.c: New test. * g++.dg/gomp/atomic-17.C: New test. * g++.dg/gomp/clause-1.C (T::test): Don't expect error on non-static data member in shared clause. Add single construct. * g++.dg/gomp/declare-simd-1.C: Add dg-options. Add scan-assembler-times directives for expected mangling on x86_64/i?86. * g++.dg/gomp/declare-simd-3.C: Likewise. * g++.dg/gomp/declare-simd-4.C: New test. * g++.dg/gomp/declare-simd-5.C: New test. * g++.dg/gomp/declare-target-1.C: New test. * g++.dg/gomp/linear-2.C: New test. * g++.dg/gomp/loop-1.C: New test. * g++.dg/gomp/loop-2.C: New test. * g++.dg/gomp/loop-3.C: New test. * g++.dg/gomp/member-2.C (B::m2, B::m4): Don't expect error on non-static data member in shared clause. * g++.dg/gomp/member-3.C: New test. * g++.dg/gomp/member-4.C: New test. * g++.dg/gomp/pr38639.C (foo): Adjust dg-error. (bar): Remove dg-message. * g++.dg/gomp/target-teams-1.C: New test. include/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * gomp-constants.h (GOMP_MAP_FLAG_SPECIAL_2): Define. (GOMP_MAP_FLAG_ALWAYS): Remove. (enum gomp_map_kind): Use GOMP_MAP_FLAG_SPECIAL_2 instead of GOMP_MAP_FLAG_ALWAYS for GOMP_MAP_ALWAYS_TO, GOMP_MAP_ALWAYS_FROM, GOMP_MAP_ALWAYS_TOFROM, GOMP_MAP_STRUCT, GOMP_MAP_RELEASE. Add GOMP_MAP_ALWAYS_POINTER and GOMP_MAP_FIRSTPRIVATE_REFERENCE. (GOMP_MAP_ALWAYS_P): Define. (GOMP_TARGET_FLAG_NOWAIT): Adjust comment. libgomp/ 2015-11-05 Jakub Jelinek <jakub@redhat.com> Ilya Verbin <ilya.verbin@intel.com> * libgomp_g.h (GOMP_loop_nonmonotonic_dynamic_next, GOMP_loop_nonmonotonic_dynamic_start, GOMP_loop_nonmonotonic_guided_next, GOMP_loop_nonmonotonic_guided_start, GOMP_loop_ull_nonmonotonic_dynamic_next, GOMP_loop_ull_nonmonotonic_dynamic_start, GOMP_loop_ull_nonmonotonic_guided_next, GOMP_loop_ull_nonmonotonic_guided_start, GOMP_parallel_loop_nonmonotonic_dynamic, GOMP_parallel_loop_nonmonotonic_guided): New prototypes. (GOMP_target_41): Renamed to ... (GOMP_target_ext): ... this. Add num_teams and thread_limit arguments. (GOMP_target_data_41): Renamed to ... (GOMP_target_data_ext): ... this. (GOMP_target_update_41): Renamed to ... (GOMP_target_update_ext): ... this. * libgomp.map (GOMP_4.5): Export GOMP_target_ext, GOMP_target_data_ext and GOMP_target_update_ext instead of GOMP_target_41, GOMP_target_data_41 and GOMP_target_update_41. Export GOMP_loop_nonmonotonic_dynamic_next, GOMP_loop_nonmonotonic_dynamic_start, GOMP_loop_nonmonotonic_guided_next, GOMP_loop_nonmonotonic_guided_start, GOMP_loop_ull_nonmonotonic_dynamic_next, GOMP_loop_ull_nonmonotonic_dynamic_start, GOMP_loop_ull_nonmonotonic_guided_next, GOMP_loop_ull_nonmonotonic_guided_start, GOMP_parallel_loop_nonmonotonic_dynamic and GOMP_parallel_loop_nonmonotonic_guided. * loop.c (GOMP_parallel_loop_nonmonotonic_dynamic, GOMP_parallel_loop_nonmonotonic_guided, GOMP_loop_nonmonotonic_dynamic_start, GOMP_loop_nonmonotonic_guided_start, GOMP_loop_nonmonotonic_dynamic_next, GOMP_loop_nonmonotonic_guided_next): New aliases or functions. * loop_ull.c (GOMP_loop_ull_nonmonotonic_dynamic_start, GOMP_loop_ull_nonmonotonic_guided_start, GOMP_loop_ull_nonmonotonic_dynamic_next, GOMP_loop_ull_nonmonotonic_guided_next): Likewise. * target.c (gomp_map_0len_lookup, gomp_map_val): New inline functions. (gomp_map_vars): Handle GOMP_MAP_ALWAYS_POINTER. For GOMP_MAP_ZERO_LEN_ARRAY_SECTION use gomp_map_0len_lookup. Use gomp_map_val function. (gomp_target_fallback_firstprivate): New static function. (GOMP_target_41): Renamed to ... (GOMP_target_ext): ... this. Add num_teams and thread_limit arguments. Move firstprivate fallback handling into a new function. (GOMP_target_data_41): Renamed to ... (GOMP_target_data_ext): ... this. (GOMP_target_update_41): Renamed to ... (GOMP_target_update_ext): ... this. (gomp_exit_data): For GOMP_MAP_*ZERO_LEN* use gomp_map_0len_lookup instead of gomp_map_lookup. (omp_target_is_present): Use gomp_map_0len_lookup instead of gomp_map_lookup. * testsuite/libgomp.c/target-28.c: Likewise. * testsuite/libgomp.c/monotonic-1.c: New test. * testsuite/libgomp.c/monotonic-2.c: New test. * testsuite/libgomp.c/nonmonotonic-1.c: New test. * testsuite/libgomp.c/nonmonotonic-2.c: New test. * testsuite/libgomp.c/pr66199-5.c: New test. * testsuite/libgomp.c/pr66199-6.c: New test. * testsuite/libgomp.c/pr66199-7.c: New test. * testsuite/libgomp.c/pr66199-8.c: New test. * testsuite/libgomp.c/pr66199-9.c: New test. * testsuite/libgomp.c/reduction-11.c: New test. * testsuite/libgomp.c/reduction-12.c: New test. * testsuite/libgomp.c/reduction-13.c: New test. * testsuite/libgomp.c/reduction-14.c: New test. * testsuite/libgomp.c/reduction-15.c: New test. * testsuite/libgomp.c/target-12.c (main): Adjust for omp_target_is_present change for one-past-last element. * testsuite/libgomp.c/target-17.c (foo): Drop tests where the same var is both mapped and privatized. * testsuite/libgomp.c/target-19.c (foo): Adjust for different handling of zero-length array sections. * testsuite/libgomp.c/target-28.c: New test. * testsuite/libgomp.c/target-29.c: New test. * testsuite/libgomp.c/target-30.c: New test. * testsuite/libgomp.c/target-teams-1.c: New test. * testsuite/libgomp.c++/member-6.C: New test. * testsuite/libgomp.c++/member-7.C: New test. * testsuite/libgomp.c++/monotonic-1.C: New test. * testsuite/libgomp.c++/monotonic-2.C: New test. * testsuite/libgomp.c++/nonmonotonic-1.C: New test. * testsuite/libgomp.c++/nonmonotonic-2.C: New test. * testsuite/libgomp.c++/pr66199-3.C: New test. * testsuite/libgomp.c++/pr66199-4.C: New test. * testsuite/libgomp.c++/pr66199-5.C: New test. * testsuite/libgomp.c++/pr66199-6.C: New test. * testsuite/libgomp.c++/pr66199-7.C: New test. * testsuite/libgomp.c++/pr66199-8.C: New test. * testsuite/libgomp.c++/pr66199-9.C: New test. * testsuite/libgomp.c++/reduction-11.C: New test. * testsuite/libgomp.c++/reduction-12.C: New test. * testsuite/libgomp.c++/target-13.C: New test. * testsuite/libgomp.c++/target-14.C: New test. * testsuite/libgomp.c++/target-15.C: New test. * testsuite/libgomp.c++/target-16.C: New test. * testsuite/libgomp.c++/target-17.C: New test. * testsuite/libgomp.c++/target-18.C: New test. * testsuite/libgomp.c++/target-19.C: New test. Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com> From-SVN: r229814
2015-11-05 16:08:08 +01:00
case SIMD_CLONE_ARG_TYPE_LINEAR_REF_VARIABLE_STEP:
case SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP:
case SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_VARIABLE_STEP:
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
default:
gcc_unreachable ();
}
}
new_stmt = gimple_build_call_vec (fndecl, vargs);
if (vec_dest)
{
gcc_assert (ratype || TYPE_VECTOR_SUBPARTS (rtype) == nunits);
if (ratype)
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
new_temp = create_tmp_var (ratype);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
else if (TYPE_VECTOR_SUBPARTS (vectype)
== TYPE_VECTOR_SUBPARTS (rtype))
new_temp = make_ssa_name (vec_dest, new_stmt);
else
new_temp = make_ssa_name (rtype, new_stmt);
gimple_call_set_lhs (new_stmt, new_temp);
}
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (vec_dest)
{
if (TYPE_VECTOR_SUBPARTS (vectype) < nunits)
{
unsigned int k, l;
unsigned int prec = GET_MODE_BITSIZE (TYPE_MODE (vectype));
k = nunits / TYPE_VECTOR_SUBPARTS (vectype);
gcc_assert ((k & (k - 1)) == 0);
for (l = 0; l < k; l++)
{
tree t;
if (ratype)
{
t = build_fold_addr_expr (new_temp);
t = build2 (MEM_REF, vectype, t,
build_int_cst (TREE_TYPE (t),
l * prec / BITS_PER_UNIT));
}
else
t = build3 (BIT_FIELD_REF, vectype, new_temp,
size_int (prec), bitsize_int (l * prec));
new_stmt
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
= gimple_build_assign (make_ssa_name (vectype), t);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (j == 0 && l == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
if (ratype)
{
tree clobber = build_constructor (ratype, NULL);
TREE_THIS_VOLATILE (clobber) = 1;
new_stmt = gimple_build_assign (new_temp, clobber);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
}
continue;
}
else if (TYPE_VECTOR_SUBPARTS (vectype) > nunits)
{
unsigned int k = (TYPE_VECTOR_SUBPARTS (vectype)
/ TYPE_VECTOR_SUBPARTS (rtype));
gcc_assert ((k & (k - 1)) == 0);
if ((j & (k - 1)) == 0)
vec_alloc (ret_ctor_elts, k);
if (ratype)
{
unsigned int m, o = nunits / TYPE_VECTOR_SUBPARTS (rtype);
for (m = 0; m < o; m++)
{
tree tem = build4 (ARRAY_REF, rtype, new_temp,
size_int (m), NULL_TREE, NULL_TREE);
new_stmt
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
= gimple_build_assign (make_ssa_name (rtype), tem);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
CONSTRUCTOR_APPEND_ELT (ret_ctor_elts, NULL_TREE,
gimple_assign_lhs (new_stmt));
}
tree clobber = build_constructor (ratype, NULL);
TREE_THIS_VOLATILE (clobber) = 1;
new_stmt = gimple_build_assign (new_temp, clobber);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
}
else
CONSTRUCTOR_APPEND_ELT (ret_ctor_elts, NULL_TREE, new_temp);
if ((j & (k - 1)) != k - 1)
continue;
vec_oprnd0 = build_constructor (vectype, ret_ctor_elts);
new_stmt
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
= gimple_build_assign (make_ssa_name (vec_dest), vec_oprnd0);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if ((unsigned) j == k - 1)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
continue;
}
else if (ratype)
{
tree t = build_fold_addr_expr (new_temp);
t = build2 (MEM_REF, vectype, t,
build_int_cst (TREE_TYPE (t), 0));
new_stmt
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
= gimple_build_assign (make_ssa_name (vec_dest), t);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
tree clobber = build_constructor (ratype, NULL);
TREE_THIS_VOLATILE (clobber) = 1;
vect_finish_stmt_generation (stmt,
gimple_build_assign (new_temp,
clobber), gsi);
}
}
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
vargs.release ();
/* The call in STMT might prevent it from being removed in dce.
We however cannot remove it here, due to the way the ssa name
it defines is mapped to the new definition. So just replace
rhs of the statement with something harmless. */
if (slp_node)
return true;
if (scalar_dest)
{
type = TREE_TYPE (scalar_dest);
if (is_pattern_stmt_p (stmt_info))
lhs = gimple_call_lhs (STMT_VINFO_RELATED_STMT (stmt_info));
else
lhs = gimple_call_lhs (stmt);
new_stmt = gimple_build_assign (lhs, build_zero_cst (type));
}
else
new_stmt = gimple_build_nop ();
set_vinfo_for_stmt (new_stmt, stmt_info);
set_vinfo_for_stmt (stmt, NULL);
STMT_VINFO_STMT (stmt_info) = new_stmt;
gsi_replace (gsi, new_stmt, true);
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
unlink_stmt_vdef (stmt);
return true;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function vect_gen_widened_results_half
Create a vector stmt whose code, type, number of arguments, and result
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
variable are CODE, OP_TYPE, and VEC_DEST, and its arguments are
VEC_OPRND0 and VEC_OPRND1. The new vector stmt is to be inserted at BSI.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
In the case that CODE is a CALL_EXPR, this means that a call to DECL
needs to be created (DECL is a function-decl of a target-builtin).
STMT is the original scalar stmt that we are vectorizing. */
static gimple *
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vect_gen_widened_results_half (enum tree_code code,
tree decl,
tree vec_oprnd0, tree vec_oprnd1, int op_type,
tree vec_dest, gimple_stmt_iterator *gsi,
gimple *stmt)
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
{
gimple *new_stmt;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree new_temp;
/* Generate half of the widened result: */
if (code == CALL_EXPR)
{
/* Target specific support */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (op_type == binary_op)
new_stmt = gimple_build_call (decl, 2, vec_oprnd0, vec_oprnd1);
else
new_stmt = gimple_build_call (decl, 1, vec_oprnd0);
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_call_set_lhs (new_stmt, new_temp);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
}
else
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Generic support */
gcc_assert (op_type == TREE_CODE_LENGTH (code));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (op_type != binary_op)
vec_oprnd1 = NULL;
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 (vec_dest, code, vec_oprnd0, vec_oprnd1);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_assign_set_lhs (new_stmt, new_temp);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
return new_stmt;
}
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
/* Get vectorized definitions for loop-based vectorization. For the first
operand we call vect_get_vec_def_for_operand() (with OPRND containing
scalar operand), and for the rest we get a copy with
vect_get_vec_def_for_stmt_copy() using the previous vector definition
(stored in OPRND). See vect_get_vec_def_for_stmt_copy() for details.
The vectors are collected into VEC_OPRNDS. */
static void
vect_get_loop_based_defs (tree *oprnd, gimple *stmt, enum vect_def_type dt,
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> *vec_oprnds, int multi_step_cvt)
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
tree vec_oprnd;
/* Get first vector operand. */
/* All the vector operands except the very first one (that is scalar oprnd)
are stmt copies. */
if (TREE_CODE (TREE_TYPE (*oprnd)) != VECTOR_TYPE)
vec_oprnd = vect_get_vec_def_for_operand (*oprnd, stmt);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
else
vec_oprnd = vect_get_vec_def_for_stmt_copy (dt, *oprnd);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds->quick_push (vec_oprnd);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
/* Get second vector operand. */
vec_oprnd = vect_get_vec_def_for_stmt_copy (dt, vec_oprnd);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds->quick_push (vec_oprnd);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
*oprnd = vec_oprnd;
/* For conversion in multiple steps, continue to get operands
recursively. */
if (multi_step_cvt)
vect_get_loop_based_defs (oprnd, stmt, dt, vec_oprnds, multi_step_cvt - 1);
}
/* Create vectorized demotion statements for vector operands from VEC_OPRNDS.
For multi-step conversions store the resulting vectors and call the function
recursively. */
static void
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vect_create_vectorized_demotion_stmts (vec<tree> *vec_oprnds,
int multi_step_cvt, gimple *stmt,
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> vec_dsts,
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
gimple_stmt_iterator *gsi,
slp_tree slp_node, enum tree_code code,
stmt_vec_info *prev_stmt_info)
{
unsigned int i;
tree vop0, vop1, new_tmp, vec_dest;
gimple *new_stmt;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_dest = vec_dsts.pop ();
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
for (i = 0; i < vec_oprnds->length (); i += 2)
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
/* Create demotion operation. */
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
vop0 = (*vec_oprnds)[i];
vop1 = (*vec_oprnds)[i + 1];
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 (vec_dest, code, vop0, vop1);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
new_tmp = make_ssa_name (vec_dest, new_stmt);
gimple_assign_set_lhs (new_stmt, new_tmp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (multi_step_cvt)
/* Store the resulting vector for next recursive call. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
(*vec_oprnds)[i/2] = new_tmp;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
else
{
/* This is the last step of the conversion sequence. Store the
vectors in SLP_NODE or in vector info of the scalar statement
(or in STMT_VINFO_RELATED_STMT chain). */
if (slp_node)
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
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
else
{
if (!*prev_stmt_info)
STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
else
STMT_VINFO_RELATED_STMT (*prev_stmt_info) = new_stmt;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
*prev_stmt_info = vinfo_for_stmt (new_stmt);
}
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
}
/* For multi-step demotion operations we first generate demotion operations
from the source type to the intermediate types, and then combine the
results (stored in VEC_OPRNDS) in demotion operation to the destination
type. */
if (multi_step_cvt)
{
/* At each level of recursion we have half of the operands we had at the
previous level. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds->truncate ((i+1)/2);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
vect_create_vectorized_demotion_stmts (vec_oprnds, multi_step_cvt - 1,
stmt, vec_dsts, gsi, slp_node,
VEC_PACK_TRUNC_EXPR,
prev_stmt_info);
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_dsts.quick_push (vec_dest);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
/* Create vectorized promotion statements for vector operands from VEC_OPRNDS0
and VEC_OPRNDS1 (for binary operations). For multi-step conversions store
the resulting vectors and call the function recursively. */
static void
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vect_create_vectorized_promotion_stmts (vec<tree> *vec_oprnds0,
vec<tree> *vec_oprnds1,
gimple *stmt, tree vec_dest,
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
gimple_stmt_iterator *gsi,
enum tree_code code1,
enum tree_code code2, tree decl1,
tree decl2, int op_type)
{
int i;
tree vop0, vop1, new_tmp1, new_tmp2;
gimple *new_stmt1, *new_stmt2;
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
vec<tree> vec_tmp = vNULL;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_tmp.create (vec_oprnds0->length () * 2);
FOR_EACH_VEC_ELT (*vec_oprnds0, i, vop0)
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
if (op_type == binary_op)
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
vop1 = (*vec_oprnds1)[i];
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
else
vop1 = NULL_TREE;
/* Generate the two halves of promotion operation. */
new_stmt1 = vect_gen_widened_results_half (code1, decl1, vop0, vop1,
op_type, vec_dest, gsi, stmt);
new_stmt2 = vect_gen_widened_results_half (code2, decl2, vop0, vop1,
op_type, vec_dest, gsi, stmt);
if (is_gimple_call (new_stmt1))
{
new_tmp1 = gimple_call_lhs (new_stmt1);
new_tmp2 = gimple_call_lhs (new_stmt2);
}
else
{
new_tmp1 = gimple_assign_lhs (new_stmt1);
new_tmp2 = gimple_assign_lhs (new_stmt2);
}
/* Store the results for the next step. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_tmp.quick_push (new_tmp1);
vec_tmp.quick_push (new_tmp2);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
vec_oprnds0->release ();
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
*vec_oprnds0 = vec_tmp;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Check if STMT performs a conversion operation, that can be vectorized.
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
stmt to replace it, put it in VEC_STMT, and insert it at GSI.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
static bool
vectorizable_conversion (gimple *stmt, gimple_stmt_iterator *gsi,
gimple **vec_stmt, slp_tree slp_node)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree vec_dest;
tree scalar_dest;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
tree op0, op1 = NULL_TREE;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree vec_oprnd0 = NULL_TREE, vec_oprnd1 = NULL_TREE;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
enum tree_code code, code1 = ERROR_MARK, code2 = ERROR_MARK;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
enum tree_code codecvt1 = ERROR_MARK, codecvt2 = ERROR_MARK;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree decl1 = NULL_TREE, decl2 = NULL_TREE;
tree new_temp;
gimple *def_stmt;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
gimple *new_stmt = NULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt_vec_info prev_stmt_info;
int nunits_in;
int nunits_out;
tree vectype_out, vectype_in;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
int ncopies, i, j;
tree lhs_type, rhs_type;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum { NARROW, NONE, WIDEN } modifier;
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
vec<tree> vec_oprnds0 = vNULL;
vec<tree> vec_oprnds1 = vNULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree vop0;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
vec_info *vinfo = stmt_info->vinfo;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
int multi_step_cvt = 0;
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
vec<tree> interm_types = vNULL;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
tree last_oprnd, intermediate_type, cvt_type = NULL_TREE;
int op_type;
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 rhs_mode;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
unsigned short fltsz;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Is STMT a vectorizable conversion? */
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& ! vec_stmt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
if (!is_gimple_assign (stmt))
return false;
if (TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
return false;
code = gimple_assign_rhs_code (stmt);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (!CONVERT_EXPR_CODE_P (code)
&& code != FIX_TRUNC_EXPR
&& code != FLOAT_EXPR
&& code != WIDEN_MULT_EXPR
&& code != WIDEN_LSHIFT_EXPR)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
op_type = TREE_CODE_LENGTH (code);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Check types of lhs and rhs. */
scalar_dest = gimple_assign_lhs (stmt);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
lhs_type = TREE_TYPE (scalar_dest);
vectype_out = STMT_VINFO_VECTYPE (stmt_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
op0 = gimple_assign_rhs1 (stmt);
rhs_type = TREE_TYPE (op0);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if ((code != FIX_TRUNC_EXPR && code != FLOAT_EXPR)
&& !((INTEGRAL_TYPE_P (lhs_type)
&& INTEGRAL_TYPE_P (rhs_type))
|| (SCALAR_FLOAT_TYPE_P (lhs_type)
&& SCALAR_FLOAT_TYPE_P (rhs_type))))
return false;
if (!VECTOR_BOOLEAN_TYPE_P (vectype_out)
&& ((INTEGRAL_TYPE_P (lhs_type)
&& (TYPE_PRECISION (lhs_type)
!= GET_MODE_PRECISION (TYPE_MODE (lhs_type))))
|| (INTEGRAL_TYPE_P (rhs_type)
&& (TYPE_PRECISION (rhs_type)
!= GET_MODE_PRECISION (TYPE_MODE (rhs_type))))))
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"type conversion to/from bit-precision unsupported."
"\n");
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
return false;
}
/* Check the operands of the operation. */
if (!vect_is_simple_use (op0, vinfo, &def_stmt, &dt[0], &vectype_in))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"use not simple.\n");
return false;
}
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (op_type == binary_op)
{
bool ok;
op1 = gimple_assign_rhs2 (stmt);
gcc_assert (code == WIDEN_MULT_EXPR || code == WIDEN_LSHIFT_EXPR);
/* For WIDEN_MULT_EXPR, if OP0 is a constant, use the type of
OP1. */
if (CONSTANT_CLASS_P (op0))
ok = vect_is_simple_use (op1, vinfo, &def_stmt, &dt[1], &vectype_in);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
else
ok = vect_is_simple_use (op1, vinfo, &def_stmt, &dt[1]);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (!ok)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"use not simple.\n");
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
return false;
}
}
/* If op0 is an external or constant defs use a vector type of
the same size as the output vector type. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (!vectype_in)
vectype_in = get_same_sized_vectype (rhs_type, vectype_out);
if (vec_stmt)
gcc_assert (vectype_in);
if (!vectype_in)
{
if (dump_enabled_p ())
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"no vectype for scalar type ");
dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, rhs_type);
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
return false;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (VECTOR_BOOLEAN_TYPE_P (vectype_out)
&& !VECTOR_BOOLEAN_TYPE_P (vectype_in))
{
if (dump_enabled_p ())
{
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"can't convert between boolean and non "
"boolean vectors");
dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, rhs_type);
dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (nunits_in < nunits_out)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
modifier = NARROW;
else if (nunits_out == nunits_in)
modifier = NONE;
else
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
modifier = WIDEN;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Multiple types in SLP are handled by creating the appropriate number of
vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
case of SLP. */
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
if (slp_node)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
ncopies = 1;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
else if (modifier == NARROW)
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_out;
else
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Sanity check: make sure that at least one copy of the vectorized stmt
needs to be generated. */
gcc_assert (ncopies >= 1);
/* Supportable by target? */
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
switch (modifier)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
case NONE:
if (code != FIX_TRUNC_EXPR && code != FLOAT_EXPR)
return false;
if (supportable_convert_operation (code, vectype_out, vectype_in,
&decl1, &code1))
break;
/* FALLTHRU */
unsupported:
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"conversion not supported by target.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
case WIDEN:
if (supportable_widening_operation (code, stmt, vectype_out, vectype_in,
&code1, &code2, &multi_step_cvt,
&interm_types))
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
/* Binary widening operation can only be supported directly by the
architecture. */
gcc_assert (!(multi_step_cvt && op_type == binary_op));
break;
}
if (code != FLOAT_EXPR
|| (GET_MODE_SIZE (TYPE_MODE (lhs_type))
<= GET_MODE_SIZE (TYPE_MODE (rhs_type))))
goto unsupported;
rhs_mode = TYPE_MODE (rhs_type);
fltsz = GET_MODE_SIZE (TYPE_MODE (lhs_type));
for (rhs_mode = GET_MODE_2XWIDER_MODE (TYPE_MODE (rhs_type));
rhs_mode != VOIDmode && GET_MODE_SIZE (rhs_mode) <= fltsz;
rhs_mode = GET_MODE_2XWIDER_MODE (rhs_mode))
{
cvt_type
= build_nonstandard_integer_type (GET_MODE_BITSIZE (rhs_mode), 0);
cvt_type = get_same_sized_vectype (cvt_type, vectype_in);
if (cvt_type == NULL_TREE)
goto unsupported;
if (GET_MODE_SIZE (rhs_mode) == fltsz)
{
if (!supportable_convert_operation (code, vectype_out,
cvt_type, &decl1, &codecvt1))
goto unsupported;
}
else if (!supportable_widening_operation (code, stmt, vectype_out,
cvt_type, &codecvt1,
&codecvt2, &multi_step_cvt,
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
&interm_types))
continue;
else
gcc_assert (multi_step_cvt == 0);
if (supportable_widening_operation (NOP_EXPR, stmt, cvt_type,
vectype_in, &code1, &code2,
&multi_step_cvt, &interm_types))
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
break;
}
if (rhs_mode == VOIDmode || GET_MODE_SIZE (rhs_mode) > fltsz)
goto unsupported;
if (GET_MODE_SIZE (rhs_mode) == fltsz)
codecvt2 = ERROR_MARK;
else
{
multi_step_cvt++;
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
interm_types.safe_push (cvt_type);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
cvt_type = NULL_TREE;
}
break;
case NARROW:
gcc_assert (op_type == unary_op);
if (supportable_narrowing_operation (code, vectype_out, vectype_in,
&code1, &multi_step_cvt,
&interm_types))
break;
if (code != FIX_TRUNC_EXPR
|| (GET_MODE_SIZE (TYPE_MODE (lhs_type))
>= GET_MODE_SIZE (TYPE_MODE (rhs_type))))
goto unsupported;
rhs_mode = TYPE_MODE (rhs_type);
cvt_type
= build_nonstandard_integer_type (GET_MODE_BITSIZE (rhs_mode), 0);
cvt_type = get_same_sized_vectype (cvt_type, vectype_in);
if (cvt_type == NULL_TREE)
goto unsupported;
if (!supportable_convert_operation (code, cvt_type, vectype_in,
&decl1, &codecvt1))
goto unsupported;
if (supportable_narrowing_operation (NOP_EXPR, vectype_out, cvt_type,
&code1, &multi_step_cvt,
&interm_types))
break;
goto unsupported;
default:
gcc_unreachable ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
if (!vec_stmt) /* transformation not required. */
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"=== vectorizable_conversion ===\n");
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (code == FIX_TRUNC_EXPR || code == FLOAT_EXPR)
{
STMT_VINFO_TYPE (stmt_info) = type_conversion_vec_info_type;
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
vect_model_simple_cost (stmt_info, ncopies, dt, NULL, NULL);
}
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
else if (modifier == NARROW)
{
STMT_VINFO_TYPE (stmt_info) = type_demotion_vec_info_type;
vect_model_promotion_demotion_cost (stmt_info, dt, multi_step_cvt);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
else
{
STMT_VINFO_TYPE (stmt_info) = type_promotion_vec_info_type;
vect_model_promotion_demotion_cost (stmt_info, dt, multi_step_cvt);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
interm_types.release ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
/** Transform. **/
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"transform conversion. ncopies = %d.\n", ncopies);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (op_type == binary_op)
{
if (CONSTANT_CLASS_P (op0))
op0 = fold_convert (TREE_TYPE (op1), op0);
else if (CONSTANT_CLASS_P (op1))
op1 = fold_convert (TREE_TYPE (op0), op1);
}
/* In case of multi-step conversion, we first generate conversion operations
to the intermediate types, and then from that types to the final one.
We create vector destinations for the intermediate type (TYPES) received
from supportable_*_operation, and store them in the correct order
for future use in vect_create_vectorized_*_stmts (). */
auto_vec<tree> vec_dsts (multi_step_cvt + 1);
vec_dest = vect_create_destination_var (scalar_dest,
(cvt_type && modifier == WIDEN)
? cvt_type : vectype_out);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_dsts.quick_push (vec_dest);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (multi_step_cvt)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
for (i = interm_types.length () - 1;
interm_types.iterate (i, &intermediate_type); i--)
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
vec_dest = vect_create_destination_var (scalar_dest,
intermediate_type);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_dsts.quick_push (vec_dest);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (cvt_type)
vec_dest = vect_create_destination_var (scalar_dest,
modifier == WIDEN
? vectype_out : cvt_type);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (!slp_node)
{
if (modifier == WIDEN)
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, 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-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.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-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.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-threadedge.c, tree-ssa-threadupdate.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-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
vec_oprnds0.create (multi_step_cvt ? vect_pow2 (multi_step_cvt) : 1);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (op_type == binary_op)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds1.create (1);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
else if (modifier == NARROW)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0.create (
2 * (multi_step_cvt ? vect_pow2 (multi_step_cvt) : 1));
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
else if (code == WIDEN_LSHIFT_EXPR)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds1.create (slp_node->vec_stmts_size);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
last_oprnd = op0;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
prev_stmt_info = NULL;
switch (modifier)
{
case NONE:
for (j = 0; j < ncopies; j++)
{
if (j == 0)
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
vect_get_vec_defs (op0, NULL, stmt, &vec_oprnds0, NULL, slp_node,
-1);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
vect_get_vec_defs_for_stmt_copy (dt, &vec_oprnds0, NULL);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (vec_oprnds0, i, vop0)
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
/* Arguments are ready, create the new vector stmt. */
if (code1 == CALL_EXPR)
{
new_stmt = gimple_build_call (decl1, 1, vop0);
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_call_set_lhs (new_stmt, new_temp);
}
else
{
gcc_assert (TREE_CODE_LENGTH (code1) == unary_op);
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 (vec_dest, code1, vop0);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_assign_set_lhs (new_stmt, new_temp);
}
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (slp_node)
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
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
else
{
if (!prev_stmt_info)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
break;
case WIDEN:
/* In case the vectorization factor (VF) is bigger than the number
of elements that we can fit in a vectype (nunits), we have to
generate more than one vector stmt - i.e - we need to "unroll"
the vector stmt by a factor VF/nunits. */
for (j = 0; j < ncopies; j++)
{
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
/* Handle uses. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (j == 0)
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
if (slp_node)
{
if (code == WIDEN_LSHIFT_EXPR)
{
unsigned int k;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
vec_oprnd1 = op1;
/* Store vec_oprnd1 for every vector stmt to be created
for SLP_NODE. We check during the analysis that all
the shift arguments are the same. */
for (k = 0; k < slp_node->vec_stmts_size - 1; k++)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds1.quick_push (vec_oprnd1);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
vect_get_vec_defs (op0, NULL_TREE, stmt, &vec_oprnds0, NULL,
slp_node, -1);
}
else
vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0,
&vec_oprnds1, slp_node, -1);
}
else
{
vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0.quick_push (vec_oprnd0);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (op_type == binary_op)
{
if (code == WIDEN_LSHIFT_EXPR)
vec_oprnd1 = op1;
else
vec_oprnd1 = vect_get_vec_def_for_operand (op1, stmt);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds1.quick_push (vec_oprnd1);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
}
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd0);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0.truncate (0);
vec_oprnds0.quick_push (vec_oprnd0);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (op_type == binary_op)
{
if (code == WIDEN_LSHIFT_EXPR)
vec_oprnd1 = op1;
else
vec_oprnd1 = vect_get_vec_def_for_stmt_copy (dt[1],
vec_oprnd1);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds1.truncate (0);
vec_oprnds1.quick_push (vec_oprnd1);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
/* Arguments are ready. Create the new vector stmts. */
for (i = multi_step_cvt; i >= 0; i--)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
tree this_dest = vec_dsts[i];
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
enum tree_code c1 = code1, c2 = code2;
if (i == 0 && codecvt2 != ERROR_MARK)
{
c1 = codecvt1;
c2 = codecvt2;
}
vect_create_vectorized_promotion_stmts (&vec_oprnds0,
&vec_oprnds1,
stmt, this_dest, gsi,
c1, c2, decl1, decl2,
op_type);
}
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 (vec_oprnds0, i, vop0)
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
if (cvt_type)
{
if (codecvt1 == CALL_EXPR)
{
new_stmt = gimple_build_call (decl1, 1, vop0);
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_call_set_lhs (new_stmt, new_temp);
}
else
{
gcc_assert (TREE_CODE_LENGTH (codecvt1) == unary_op);
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
new_temp = make_ssa_name (vec_dest);
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 (new_temp, codecvt1,
vop0);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
vect_finish_stmt_generation (stmt, new_stmt, gsi);
}
else
new_stmt = SSA_NAME_DEF_STMT (vop0);
if (slp_node)
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
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
else
{
if (!prev_stmt_info)
STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
case NARROW:
/* In case the vectorization factor (VF) is bigger than the number
of elements that we can fit in a vectype (nunits), we have to
generate more than one vector stmt - i.e - we need to "unroll"
the vector stmt by a factor VF/nunits. */
for (j = 0; j < ncopies; j++)
{
/* Handle uses. */
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (slp_node)
vect_get_vec_defs (op0, NULL_TREE, stmt, &vec_oprnds0, NULL,
slp_node, -1);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0.truncate (0);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
vect_get_loop_based_defs (&last_oprnd, stmt, dt[0], &vec_oprnds0,
vect_pow2 (multi_step_cvt) - 1);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
/* Arguments are ready. Create the new vector stmts. */
if (cvt_type)
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 (vec_oprnds0, i, vop0)
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
if (codecvt1 == CALL_EXPR)
{
new_stmt = gimple_build_call (decl1, 1, vop0);
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_call_set_lhs (new_stmt, new_temp);
}
else
{
gcc_assert (TREE_CODE_LENGTH (codecvt1) == unary_op);
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
new_temp = make_ssa_name (vec_dest);
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 (new_temp, codecvt1,
vop0);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0[i] = new_temp;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
vect_create_vectorized_demotion_stmts (&vec_oprnds0, multi_step_cvt,
stmt, vec_dsts, gsi,
slp_node, code1,
&prev_stmt_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
break;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0.release ();
vec_oprnds1.release ();
interm_types.release ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function vectorizable_assignment.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
Check if STMT performs an assignment (copy) that can be vectorized.
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt to replace it, put it in VEC_STMT, and insert it at BSI.
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
static bool
vectorizable_assignment (gimple *stmt, gimple_stmt_iterator *gsi,
gimple **vec_stmt, slp_tree slp_node)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree vec_dest;
tree scalar_dest;
tree op;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
tree new_temp;
gimple *def_stmt;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
int ncopies;
int i, j;
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
vec<tree> vec_oprnds = vNULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree vop;
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
vec_info *vinfo = stmt_info->vinfo;
gimple *new_stmt = NULL;
stmt_vec_info prev_stmt_info = NULL;
2010-05-27 15:23:45 +02:00
enum tree_code code;
tree vectype_in;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& ! vec_stmt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
/* Is vectorizable assignment? */
if (!is_gimple_assign (stmt))
return false;
scalar_dest = gimple_assign_lhs (stmt);
if (TREE_CODE (scalar_dest) != SSA_NAME)
return false;
2010-05-27 15:23:45 +02:00
code = gimple_assign_rhs_code (stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (gimple_assign_single_p (stmt)
2010-05-27 15:23:45 +02:00
|| code == PAREN_EXPR
|| CONVERT_EXPR_CODE_P (code))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
op = gimple_assign_rhs1 (stmt);
else
return false;
if (code == VIEW_CONVERT_EXPR)
op = TREE_OPERAND (op, 0);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
unsigned int nunits = TYPE_VECTOR_SUBPARTS (vectype);
/* Multiple types in SLP are handled by creating the appropriate number of
vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
case of SLP. */
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
if (slp_node)
ncopies = 1;
else
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
if (!vect_is_simple_use (op, vinfo, &def_stmt, &dt[0], &vectype_in))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"use not simple.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
2010-05-27 15:23:45 +02:00
/* We can handle NOP_EXPR conversions that do not change the number
of elements or the vector size. */
if ((CONVERT_EXPR_CODE_P (code)
|| code == VIEW_CONVERT_EXPR)
2010-05-27 15:23:45 +02:00
&& (!vectype_in
|| TYPE_VECTOR_SUBPARTS (vectype_in) != nunits
|| (GET_MODE_SIZE (TYPE_MODE (vectype))
!= GET_MODE_SIZE (TYPE_MODE (vectype_in)))))
return false;
/* We do not handle bit-precision changes. */
if ((CONVERT_EXPR_CODE_P (code)
|| code == VIEW_CONVERT_EXPR)
&& INTEGRAL_TYPE_P (TREE_TYPE (scalar_dest))
&& ((TYPE_PRECISION (TREE_TYPE (scalar_dest))
!= GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (scalar_dest))))
|| ((TYPE_PRECISION (TREE_TYPE (op))
!= GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (op))))))
/* But a conversion that does not change the bit-pattern is ok. */
&& !((TYPE_PRECISION (TREE_TYPE (scalar_dest))
> TYPE_PRECISION (TREE_TYPE (op)))
&& TYPE_UNSIGNED (TREE_TYPE (op)))
/* Conversion between boolean types of different sizes is
a simple assignment in case their vectypes are same
boolean vectors. */
&& (!VECTOR_BOOLEAN_TYPE_P (vectype)
|| !VECTOR_BOOLEAN_TYPE_P (vectype_in)))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"type conversion to/from bit-precision "
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"unsupported.\n");
return false;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (!vec_stmt) /* transformation not required. */
{
STMT_VINFO_TYPE (stmt_info) = assignment_vec_info_type;
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"=== vectorizable_assignment ===\n");
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
vect_model_simple_cost (stmt_info, ncopies, dt, NULL, NULL);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
/** Transform. **/
if (dump_enabled_p ())
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf_loc (MSG_NOTE, vect_location, "transform assignment.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Handle def. */
vec_dest = vect_create_destination_var (scalar_dest, vectype);
/* Handle use. */
for (j = 0; j < ncopies; j++)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
/* Handle uses. */
if (j == 0)
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
vect_get_vec_defs (op, NULL, stmt, &vec_oprnds, NULL, slp_node, -1);
else
vect_get_vec_defs_for_stmt_copy (dt, &vec_oprnds, NULL);
/* Arguments are ready. create the new vector stmt. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (vec_oprnds, i, vop)
{
if (CONVERT_EXPR_CODE_P (code)
|| code == VIEW_CONVERT_EXPR)
vop = build1 (VIEW_CONVERT_EXPR, vectype, vop);
new_stmt = gimple_build_assign (vec_dest, vop);
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_assign_set_lhs (new_stmt, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (slp_node)
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
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (slp_node)
continue;
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds.release ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
/* Return TRUE if CODE (a shift operation) is supported for SCALAR_TYPE
either as shift by a scalar or by a vector. */
bool
vect_supportable_shift (enum tree_code code, tree scalar_type)
{
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 vec_mode;
optab optab;
int icode;
tree vectype;
vectype = get_vectype_for_scalar_type (scalar_type);
if (!vectype)
return false;
optab = optab_for_tree_code (code, vectype, optab_scalar);
if (!optab
|| optab_handler (optab, TYPE_MODE (vectype)) == CODE_FOR_nothing)
{
optab = optab_for_tree_code (code, vectype, optab_vector);
if (!optab
|| (optab_handler (optab, TYPE_MODE (vectype))
== CODE_FOR_nothing))
return false;
}
vec_mode = TYPE_MODE (vectype);
icode = (int) optab_handler (optab, vec_mode);
if (icode == CODE_FOR_nothing)
return false;
return true;
}
/* Function vectorizable_shift.
Check if STMT performs a shift operation that can be vectorized.
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
stmt to replace it, put it in VEC_STMT, and insert it at BSI.
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
static bool
vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
gimple **vec_stmt, slp_tree slp_node)
{
tree vec_dest;
tree scalar_dest;
tree op0, op1 = NULL;
tree vec_oprnd1 = NULL_TREE;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tree vectype;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
enum tree_code code;
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 vec_mode;
tree new_temp;
optab optab;
int icode;
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 optab_op2_mode;
gimple *def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
gimple *new_stmt = NULL;
stmt_vec_info prev_stmt_info;
int nunits_in;
int nunits_out;
tree vectype_out;
tree op1_vectype;
int ncopies;
int j, i;
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
vec<tree> vec_oprnds0 = vNULL;
vec<tree> vec_oprnds1 = vNULL;
tree vop0, vop1;
unsigned int k;
bool scalar_shift_arg = true;
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
vec_info *vinfo = stmt_info->vinfo;
int vf;
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& ! vec_stmt)
return false;
/* Is STMT a vectorizable binary/unary operation? */
if (!is_gimple_assign (stmt))
return false;
if (TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
return false;
code = gimple_assign_rhs_code (stmt);
if (!(code == LSHIFT_EXPR || code == RSHIFT_EXPR || code == LROTATE_EXPR
|| code == RROTATE_EXPR))
return false;
scalar_dest = gimple_assign_lhs (stmt);
vectype_out = STMT_VINFO_VECTYPE (stmt_info);
if (TYPE_PRECISION (TREE_TYPE (scalar_dest))
!= GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (scalar_dest))))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"bit-precision shifts not supported.\n");
return false;
}
op0 = gimple_assign_rhs1 (stmt);
if (!vect_is_simple_use (op0, vinfo, &def_stmt, &dt[0], &vectype))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"use not simple.\n");
return false;
}
/* If op0 is an external or constant def use a vector type with
the same size as the output vector type. */
if (!vectype)
vectype = get_same_sized_vectype (TREE_TYPE (op0), vectype_out);
if (vec_stmt)
gcc_assert (vectype);
if (!vectype)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"no vectype for scalar type\n");
return false;
}
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
nunits_in = TYPE_VECTOR_SUBPARTS (vectype);
if (nunits_out != nunits_in)
return false;
op1 = gimple_assign_rhs2 (stmt);
if (!vect_is_simple_use (op1, vinfo, &def_stmt, &dt[1], &op1_vectype))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"use not simple.\n");
return false;
}
if (loop_vinfo)
vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
else
vf = 1;
/* Multiple types in SLP are handled by creating the appropriate number of
vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
case of SLP. */
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
if (slp_node)
ncopies = 1;
else
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
gcc_assert (ncopies >= 1);
/* Determine whether the shift amount is a vector, or scalar. If the
shift/rotate amount is a vector, use the vector/vector shift optabs. */
if ((dt[1] == vect_internal_def
|| dt[1] == vect_induction_def)
&& !slp_node)
scalar_shift_arg = false;
else if (dt[1] == vect_constant_def
|| dt[1] == vect_external_def
|| dt[1] == vect_internal_def)
{
/* In SLP, need to check whether the shift count is the same,
in loops if it is a constant or invariant, it is always
a scalar shift. */
if (slp_node)
{
vec<gimple *> stmts = SLP_TREE_SCALAR_STMTS (slp_node);
gimple *slpstmt;
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 (stmts, k, slpstmt)
if (!operand_equal_p (gimple_assign_rhs2 (slpstmt), op1, 0))
scalar_shift_arg = false;
}
/* If the shift amount is computed by a pattern stmt we cannot
use the scalar amount directly thus give up and use a vector
shift. */
if (dt[1] == vect_internal_def)
{
gimple *def = SSA_NAME_DEF_STMT (op1);
if (is_pattern_stmt_p (vinfo_for_stmt (def)))
scalar_shift_arg = false;
}
}
else
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"operand mode requires invariant argument.\n");
return false;
}
/* Vector shifted by vector. */
if (!scalar_shift_arg)
{
optab = optab_for_tree_code (code, vectype, optab_vector);
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"vector/vector shift/rotate found.\n");
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
if (!op1_vectype)
op1_vectype = get_same_sized_vectype (TREE_TYPE (op1), vectype_out);
if (op1_vectype == NULL_TREE
|| TYPE_MODE (op1_vectype) != TYPE_MODE (vectype))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"unusable type for last operand in"
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
" vector/vector shift/rotate.\n");
return false;
}
}
/* See if the machine has a vector shifted by scalar insn and if not
then see if it has a vector shifted by vector insn. */
else
{
optab = optab_for_tree_code (code, vectype, optab_scalar);
if (optab
&& optab_handler (optab, TYPE_MODE (vectype)) != CODE_FOR_nothing)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"vector/scalar shift/rotate found.\n");
}
else
{
optab = optab_for_tree_code (code, vectype, optab_vector);
if (optab
&& (optab_handler (optab, TYPE_MODE (vectype))
!= CODE_FOR_nothing))
{
scalar_shift_arg = false;
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"vector/vector shift/rotate found.\n");
/* Unlike the other binary operators, shifts/rotates have
the rhs being int, instead of the same type as the lhs,
so make sure the scalar is the right type if we are
dealing with vectors of long long/long/short/char. */
if (dt[1] == vect_constant_def)
op1 = fold_convert (TREE_TYPE (vectype), op1);
else if (!useless_type_conversion_p (TREE_TYPE (vectype),
TREE_TYPE (op1)))
{
if (slp_node
&& TYPE_MODE (TREE_TYPE (vectype))
!= TYPE_MODE (TREE_TYPE (op1)))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"unusable type for last operand in"
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
" vector/vector shift/rotate.\n");
Fix indentation issues seen by -Wmisleading-indentation gcc/ChangeLog: * auto-profile.c (afdo_find_equiv_class): Fix indentation so that it reflects the block structure. (afdo_propagate_edge): Likewise. (afdo_calculate_branch_prob): Likewise. (afdo_annotate_cfg): Likewise. * cfgcleanup.c (equal_different_set_p): Likewise. (try_crossjump_to_edge): Likewise. * cgraph.c (cgraph_node::verify_node): Likewise. * cgraphunit.c (expand_all_functions): Likewise. * config/i386/i386.c (ix86_expand_copysign): Likewise. (exact_dependency_1): Likewise. * dwarf2asm.c (dw2_output_indirect_constants): Likewise. * dwarf2out.c (tree_add_const_value_attribute_for_decl): Likewise. * gensupport.c (process_define_subst): Likewise. * lto-wrapper.c (merge_and_complain): Likewise. * tree-if-conv.c (if_convertible_bb_p): Likewise. * tree-ssa-loop-prefetch.c (find_or_create_group): Likewise. * tree-ssa-tail-merge.c (gsi_advance_fw_nondebug_nonlocal): Likewise. * tree-vect-data-refs.c (vect_grouped_load_supported): Likewise. * tree-vect-loop.c (vectorizable_reduction): Likewise. * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise. * tree-vect-stmts.c (vectorizable_shift): Likewise. * tree-vrp.c (vrp_finalize): Likewise. * tree.c (variably_modified_type_p): Likewise. gcc/cp/ChangeLog: * parser.c (cp_parser_asm_definition): Only test for error_mark_node if "outputs" was just set. (cp_parser_asm_definition): Likewise for "inputs". gcc/fortran/ChangeLog: * expr.c (check_inquiry): Fix indentation so that it reflects the block structure. * interface.c (compare_parameter): Likewise. * parse.c (parse_oacc_structured_block): Likewise. * target-memory.c (expr_to_char): Likewise. * trans-types.c (gfc_init_kinds): Likewise. libcpp/ChangeLog: * pch.c (cpp_valid_state): Fix indentation so that it reflects the block structure. From-SVN: r222823
2015-05-05 21:41:11 +02:00
return false;
}
if (vec_stmt && !slp_node)
{
op1 = fold_convert (TREE_TYPE (vectype), op1);
op1 = vect_init_vector (stmt, op1,
TREE_TYPE (vectype), NULL);
}
}
}
}
}
/* Supportable by target? */
if (!optab)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"no optab.\n");
return false;
}
vec_mode = TYPE_MODE (vectype);
icode = (int) optab_handler (optab, vec_mode);
if (icode == CODE_FOR_nothing)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"op not supported by target.\n");
/* Check only during analysis. */
if (GET_MODE_SIZE (vec_mode) != UNITS_PER_WORD
|| (vf < vect_min_worthwhile_factor (code)
&& !vec_stmt))
return false;
if (dump_enabled_p ())
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"proceeding using word mode.\n");
}
/* Worthwhile without SIMD support? Check only during analysis. */
if (!VECTOR_MODE_P (TYPE_MODE (vectype))
&& vf < vect_min_worthwhile_factor (code)
&& !vec_stmt)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"not worthwhile without SIMD support.\n");
return false;
}
if (!vec_stmt) /* transformation not required. */
{
STMT_VINFO_TYPE (stmt_info) = shift_vec_info_type;
if (dump_enabled_p ())
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"=== vectorizable_shift ===\n");
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
vect_model_simple_cost (stmt_info, ncopies, dt, NULL, NULL);
return true;
}
/** Transform. **/
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"transform binary/unary operation.\n");
/* Handle def. */
vec_dest = vect_create_destination_var (scalar_dest, vectype);
prev_stmt_info = NULL;
for (j = 0; j < ncopies; j++)
{
/* Handle uses. */
if (j == 0)
{
if (scalar_shift_arg)
{
/* Vector shl and shr insn patterns can be defined with scalar
operand 2 (shift operand). In this case, use constant or loop
invariant op1 directly, without extending it to vector mode
first. */
optab_op2_mode = insn_data[icode].operand[2].mode;
if (!VECTOR_MODE_P (optab_op2_mode))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"operand 1 using scalar mode.\n");
vec_oprnd1 = op1;
vec_oprnds1.create (slp_node ? slp_node->vec_stmts_size : 1);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds1.quick_push (vec_oprnd1);
if (slp_node)
{
/* Store vec_oprnd1 for every vector stmt to be created
for SLP_NODE. We check during the analysis that all
the shift arguments are the same.
TODO: Allow different constants for different vector
stmts generated for an SLP instance. */
for (k = 0; k < slp_node->vec_stmts_size - 1; k++)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds1.quick_push (vec_oprnd1);
}
}
}
/* vec_oprnd1 is available if operand 1 should be of a scalar-type
(a special case for certain kind of vector shifts); otherwise,
operand 1 should be of a vector type (the usual case). */
if (vec_oprnd1)
vect_get_vec_defs (op0, NULL_TREE, stmt, &vec_oprnds0, NULL,
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
slp_node, -1);
else
vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0, &vec_oprnds1,
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
slp_node, -1);
}
else
vect_get_vec_defs_for_stmt_copy (dt, &vec_oprnds0, &vec_oprnds1);
/* Arguments are ready. Create the new vector stmt. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (vec_oprnds0, i, vop0)
{
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
vop1 = vec_oprnds1[i];
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 (vec_dest, code, vop0, vop1);
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_assign_set_lhs (new_stmt, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (slp_node)
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
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
}
if (slp_node)
continue;
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0.release ();
vec_oprnds1.release ();
return true;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function vectorizable_operation.
tree.def (FMA_EXPR): New tree code. 2010-11-04 Richard Guenther <rguenther@suse.de> Richard Henderson <rth@redhat.com> * tree.def (FMA_EXPR): New tree code. * expr.c (expand_expr_real_2): Add FMA_EXPR expansion code. * gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS. * tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types. * tree-inline.c (estimate_operator_cost): Handle FMA_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): New function. (execute_optimize_widening_mul): Call it. Reorganize to allow dead stmt removal. Move TODO flags ... (pass_optimize_widening_mul): ... here. * flag-types.h (enum fp_contract_mode): New enum. * common.opt (flag_fp_contract_mode): New variable. (-ffp-contract): New option. * opts.c (common_handle_option): Handle it. * doc/invoke.texi (-ffp-contract): Document. * tree.h (fold_fma): Declare. * builtins.c (fold_fma): New function. (fold_builtin_fma): Likewise. (fold_builtin_3): Call it for fma. * fold-const.c (fold_ternary_loc): Fold FMA_EXPR. * optabs.c (optab_for_tree_code): Handle FMA_EXPR. * config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4): New expanders. * doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new named patterns. * genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab. * optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms. (fms_optab, fnma_optab, fnms_optab): New defines. * gimplify.c (gimplify_expr): Handle binary truth expressions explicitly. Handle FMA_EXPR. * tree-vect-stmts.c (vectorizable_operation): Handle ternary operations. * gcc.target/i386/fma4-vector-2.c: New testcase. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r166304
2010-11-04 11:56:22 +01:00
Check if STMT performs a binary, unary or ternary operation that can
be vectorized.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt to replace it, put it in VEC_STMT, and insert it at BSI.
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
static bool
vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
gimple **vec_stmt, slp_tree slp_node)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree vec_dest;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree scalar_dest;
tree.def (FMA_EXPR): New tree code. 2010-11-04 Richard Guenther <rguenther@suse.de> Richard Henderson <rth@redhat.com> * tree.def (FMA_EXPR): New tree code. * expr.c (expand_expr_real_2): Add FMA_EXPR expansion code. * gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS. * tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types. * tree-inline.c (estimate_operator_cost): Handle FMA_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): New function. (execute_optimize_widening_mul): Call it. Reorganize to allow dead stmt removal. Move TODO flags ... (pass_optimize_widening_mul): ... here. * flag-types.h (enum fp_contract_mode): New enum. * common.opt (flag_fp_contract_mode): New variable. (-ffp-contract): New option. * opts.c (common_handle_option): Handle it. * doc/invoke.texi (-ffp-contract): Document. * tree.h (fold_fma): Declare. * builtins.c (fold_fma): New function. (fold_builtin_fma): Likewise. (fold_builtin_3): Call it for fma. * fold-const.c (fold_ternary_loc): Fold FMA_EXPR. * optabs.c (optab_for_tree_code): Handle FMA_EXPR. * config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4): New expanders. * doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new named patterns. * genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab. * optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms. (fms_optab, fnma_optab, fnms_optab): New defines. * gimplify.c (gimplify_expr): Handle binary truth expressions explicitly. Handle FMA_EXPR. * tree-vect-stmts.c (vectorizable_operation): Handle ternary operations. * gcc.target/i386/fma4-vector-2.c: New testcase. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r166304
2010-11-04 11:56:22 +01:00
tree op0, op1 = NULL_TREE, op2 = NULL_TREE;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tree vectype;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
enum tree_code code;
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 vec_mode;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree new_temp;
int op_type;
optab optab;
bool target_support_p;
gimple *def_stmt;
tree.def (FMA_EXPR): New tree code. 2010-11-04 Richard Guenther <rguenther@suse.de> Richard Henderson <rth@redhat.com> * tree.def (FMA_EXPR): New tree code. * expr.c (expand_expr_real_2): Add FMA_EXPR expansion code. * gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS. * tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types. * tree-inline.c (estimate_operator_cost): Handle FMA_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): New function. (execute_optimize_widening_mul): Call it. Reorganize to allow dead stmt removal. Move TODO flags ... (pass_optimize_widening_mul): ... here. * flag-types.h (enum fp_contract_mode): New enum. * common.opt (flag_fp_contract_mode): New variable. (-ffp-contract): New option. * opts.c (common_handle_option): Handle it. * doc/invoke.texi (-ffp-contract): Document. * tree.h (fold_fma): Declare. * builtins.c (fold_fma): New function. (fold_builtin_fma): Likewise. (fold_builtin_3): Call it for fma. * fold-const.c (fold_ternary_loc): Fold FMA_EXPR. * optabs.c (optab_for_tree_code): Handle FMA_EXPR. * config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4): New expanders. * doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new named patterns. * genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab. * optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms. (fms_optab, fnma_optab, fnms_optab): New defines. * gimplify.c (gimplify_expr): Handle binary truth expressions explicitly. Handle FMA_EXPR. * tree-vect-stmts.c (vectorizable_operation): Handle ternary operations. * gcc.target/i386/fma4-vector-2.c: New testcase. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r166304
2010-11-04 11:56:22 +01:00
enum vect_def_type dt[3]
= {vect_unknown_def_type, vect_unknown_def_type, vect_unknown_def_type};
gimple *new_stmt = NULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt_vec_info prev_stmt_info;
int nunits_in;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
int nunits_out;
tree vectype_out;
int ncopies;
int j, i;
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
vec<tree> vec_oprnds0 = vNULL;
vec<tree> vec_oprnds1 = vNULL;
vec<tree> vec_oprnds2 = vNULL;
tree.def (FMA_EXPR): New tree code. 2010-11-04 Richard Guenther <rguenther@suse.de> Richard Henderson <rth@redhat.com> * tree.def (FMA_EXPR): New tree code. * expr.c (expand_expr_real_2): Add FMA_EXPR expansion code. * gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS. * tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types. * tree-inline.c (estimate_operator_cost): Handle FMA_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): New function. (execute_optimize_widening_mul): Call it. Reorganize to allow dead stmt removal. Move TODO flags ... (pass_optimize_widening_mul): ... here. * flag-types.h (enum fp_contract_mode): New enum. * common.opt (flag_fp_contract_mode): New variable. (-ffp-contract): New option. * opts.c (common_handle_option): Handle it. * doc/invoke.texi (-ffp-contract): Document. * tree.h (fold_fma): Declare. * builtins.c (fold_fma): New function. (fold_builtin_fma): Likewise. (fold_builtin_3): Call it for fma. * fold-const.c (fold_ternary_loc): Fold FMA_EXPR. * optabs.c (optab_for_tree_code): Handle FMA_EXPR. * config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4): New expanders. * doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new named patterns. * genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab. * optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms. (fms_optab, fnma_optab, fnms_optab): New defines. * gimplify.c (gimplify_expr): Handle binary truth expressions explicitly. Handle FMA_EXPR. * tree-vect-stmts.c (vectorizable_operation): Handle ternary operations. * gcc.target/i386/fma4-vector-2.c: New testcase. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r166304
2010-11-04 11:56:22 +01:00
tree vop0, vop1, vop2;
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
vec_info *vinfo = stmt_info->vinfo;
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
int vf;
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& ! vec_stmt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
/* Is STMT a vectorizable binary/unary operation? */
if (!is_gimple_assign (stmt))
return false;
if (TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
return false;
code = gimple_assign_rhs_code (stmt);
/* For pointer addition, we should use the normal plus for
the vector addition. */
if (code == POINTER_PLUS_EXPR)
code = PLUS_EXPR;
/* Support only unary or binary operations. */
op_type = TREE_CODE_LENGTH (code);
tree.def (FMA_EXPR): New tree code. 2010-11-04 Richard Guenther <rguenther@suse.de> Richard Henderson <rth@redhat.com> * tree.def (FMA_EXPR): New tree code. * expr.c (expand_expr_real_2): Add FMA_EXPR expansion code. * gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS. * tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types. * tree-inline.c (estimate_operator_cost): Handle FMA_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): New function. (execute_optimize_widening_mul): Call it. Reorganize to allow dead stmt removal. Move TODO flags ... (pass_optimize_widening_mul): ... here. * flag-types.h (enum fp_contract_mode): New enum. * common.opt (flag_fp_contract_mode): New variable. (-ffp-contract): New option. * opts.c (common_handle_option): Handle it. * doc/invoke.texi (-ffp-contract): Document. * tree.h (fold_fma): Declare. * builtins.c (fold_fma): New function. (fold_builtin_fma): Likewise. (fold_builtin_3): Call it for fma. * fold-const.c (fold_ternary_loc): Fold FMA_EXPR. * optabs.c (optab_for_tree_code): Handle FMA_EXPR. * config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4): New expanders. * doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new named patterns. * genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab. * optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms. (fms_optab, fnma_optab, fnms_optab): New defines. * gimplify.c (gimplify_expr): Handle binary truth expressions explicitly. Handle FMA_EXPR. * tree-vect-stmts.c (vectorizable_operation): Handle ternary operations. * gcc.target/i386/fma4-vector-2.c: New testcase. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r166304
2010-11-04 11:56:22 +01:00
if (op_type != unary_op && op_type != binary_op && op_type != ternary_op)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"num. args = %d (not unary/binary/ternary op).\n",
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
op_type);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
scalar_dest = gimple_assign_lhs (stmt);
vectype_out = STMT_VINFO_VECTYPE (stmt_info);
/* Most operations cannot handle bit-precision types without extra
truncations. */
if (!VECTOR_BOOLEAN_TYPE_P (vectype_out)
&& (TYPE_PRECISION (TREE_TYPE (scalar_dest))
!= GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (scalar_dest))))
/* Exception are bitwise binary operations. */
&& code != BIT_IOR_EXPR
&& code != BIT_XOR_EXPR
&& code != BIT_AND_EXPR)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"bit-precision arithmetic not supported.\n");
return false;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
op0 = gimple_assign_rhs1 (stmt);
if (!vect_is_simple_use (op0, vinfo, &def_stmt, &dt[0], &vectype))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"use not simple.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
/* If op0 is an external or constant def use a vector type with
the same size as the output vector type. */
if (!vectype)
{
/* For boolean type we cannot determine vectype by
invariant value (don't know whether it is a vector
of booleans or vector of integers). We use output
vectype because operations on boolean don't change
type. */
if (VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (op0)))
{
if (!VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (scalar_dest)))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"not supported operation on bool value.\n");
return false;
}
vectype = vectype_out;
}
else
vectype = get_same_sized_vectype (TREE_TYPE (op0), vectype_out);
}
if (vec_stmt)
gcc_assert (vectype);
if (!vectype)
{
if (dump_enabled_p ())
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"no vectype for scalar type ");
dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
TREE_TYPE (op0));
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
nunits_in = TYPE_VECTOR_SUBPARTS (vectype);
if (nunits_out != nunits_in)
return false;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree.def (FMA_EXPR): New tree code. 2010-11-04 Richard Guenther <rguenther@suse.de> Richard Henderson <rth@redhat.com> * tree.def (FMA_EXPR): New tree code. * expr.c (expand_expr_real_2): Add FMA_EXPR expansion code. * gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS. * tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types. * tree-inline.c (estimate_operator_cost): Handle FMA_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): New function. (execute_optimize_widening_mul): Call it. Reorganize to allow dead stmt removal. Move TODO flags ... (pass_optimize_widening_mul): ... here. * flag-types.h (enum fp_contract_mode): New enum. * common.opt (flag_fp_contract_mode): New variable. (-ffp-contract): New option. * opts.c (common_handle_option): Handle it. * doc/invoke.texi (-ffp-contract): Document. * tree.h (fold_fma): Declare. * builtins.c (fold_fma): New function. (fold_builtin_fma): Likewise. (fold_builtin_3): Call it for fma. * fold-const.c (fold_ternary_loc): Fold FMA_EXPR. * optabs.c (optab_for_tree_code): Handle FMA_EXPR. * config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4): New expanders. * doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new named patterns. * genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab. * optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms. (fms_optab, fnma_optab, fnms_optab): New defines. * gimplify.c (gimplify_expr): Handle binary truth expressions explicitly. Handle FMA_EXPR. * tree-vect-stmts.c (vectorizable_operation): Handle ternary operations. * gcc.target/i386/fma4-vector-2.c: New testcase. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r166304
2010-11-04 11:56:22 +01:00
if (op_type == binary_op || op_type == ternary_op)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
op1 = gimple_assign_rhs2 (stmt);
if (!vect_is_simple_use (op1, vinfo, &def_stmt, &dt[1]))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"use not simple.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
}
tree.def (FMA_EXPR): New tree code. 2010-11-04 Richard Guenther <rguenther@suse.de> Richard Henderson <rth@redhat.com> * tree.def (FMA_EXPR): New tree code. * expr.c (expand_expr_real_2): Add FMA_EXPR expansion code. * gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS. * tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types. * tree-inline.c (estimate_operator_cost): Handle FMA_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): New function. (execute_optimize_widening_mul): Call it. Reorganize to allow dead stmt removal. Move TODO flags ... (pass_optimize_widening_mul): ... here. * flag-types.h (enum fp_contract_mode): New enum. * common.opt (flag_fp_contract_mode): New variable. (-ffp-contract): New option. * opts.c (common_handle_option): Handle it. * doc/invoke.texi (-ffp-contract): Document. * tree.h (fold_fma): Declare. * builtins.c (fold_fma): New function. (fold_builtin_fma): Likewise. (fold_builtin_3): Call it for fma. * fold-const.c (fold_ternary_loc): Fold FMA_EXPR. * optabs.c (optab_for_tree_code): Handle FMA_EXPR. * config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4): New expanders. * doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new named patterns. * genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab. * optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms. (fms_optab, fnma_optab, fnms_optab): New defines. * gimplify.c (gimplify_expr): Handle binary truth expressions explicitly. Handle FMA_EXPR. * tree-vect-stmts.c (vectorizable_operation): Handle ternary operations. * gcc.target/i386/fma4-vector-2.c: New testcase. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r166304
2010-11-04 11:56:22 +01:00
if (op_type == ternary_op)
{
op2 = gimple_assign_rhs3 (stmt);
if (!vect_is_simple_use (op2, vinfo, &def_stmt, &dt[2]))
tree.def (FMA_EXPR): New tree code. 2010-11-04 Richard Guenther <rguenther@suse.de> Richard Henderson <rth@redhat.com> * tree.def (FMA_EXPR): New tree code. * expr.c (expand_expr_real_2): Add FMA_EXPR expansion code. * gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS. * tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types. * tree-inline.c (estimate_operator_cost): Handle FMA_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): New function. (execute_optimize_widening_mul): Call it. Reorganize to allow dead stmt removal. Move TODO flags ... (pass_optimize_widening_mul): ... here. * flag-types.h (enum fp_contract_mode): New enum. * common.opt (flag_fp_contract_mode): New variable. (-ffp-contract): New option. * opts.c (common_handle_option): Handle it. * doc/invoke.texi (-ffp-contract): Document. * tree.h (fold_fma): Declare. * builtins.c (fold_fma): New function. (fold_builtin_fma): Likewise. (fold_builtin_3): Call it for fma. * fold-const.c (fold_ternary_loc): Fold FMA_EXPR. * optabs.c (optab_for_tree_code): Handle FMA_EXPR. * config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4): New expanders. * doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new named patterns. * genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab. * optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms. (fms_optab, fnma_optab, fnms_optab): New defines. * gimplify.c (gimplify_expr): Handle binary truth expressions explicitly. Handle FMA_EXPR. * tree-vect-stmts.c (vectorizable_operation): Handle ternary operations. * gcc.target/i386/fma4-vector-2.c: New testcase. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r166304
2010-11-04 11:56:22 +01:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"use not simple.\n");
tree.def (FMA_EXPR): New tree code. 2010-11-04 Richard Guenther <rguenther@suse.de> Richard Henderson <rth@redhat.com> * tree.def (FMA_EXPR): New tree code. * expr.c (expand_expr_real_2): Add FMA_EXPR expansion code. * gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS. * tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types. * tree-inline.c (estimate_operator_cost): Handle FMA_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): New function. (execute_optimize_widening_mul): Call it. Reorganize to allow dead stmt removal. Move TODO flags ... (pass_optimize_widening_mul): ... here. * flag-types.h (enum fp_contract_mode): New enum. * common.opt (flag_fp_contract_mode): New variable. (-ffp-contract): New option. * opts.c (common_handle_option): Handle it. * doc/invoke.texi (-ffp-contract): Document. * tree.h (fold_fma): Declare. * builtins.c (fold_fma): New function. (fold_builtin_fma): Likewise. (fold_builtin_3): Call it for fma. * fold-const.c (fold_ternary_loc): Fold FMA_EXPR. * optabs.c (optab_for_tree_code): Handle FMA_EXPR. * config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4): New expanders. * doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new named patterns. * genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab. * optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms. (fms_optab, fnma_optab, fnms_optab): New defines. * gimplify.c (gimplify_expr): Handle binary truth expressions explicitly. Handle FMA_EXPR. * tree-vect-stmts.c (vectorizable_operation): Handle ternary operations. * gcc.target/i386/fma4-vector-2.c: New testcase. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r166304
2010-11-04 11:56:22 +01:00
return false;
}
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (loop_vinfo)
vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
else
vf = 1;
/* Multiple types in SLP are handled by creating the appropriate number of
vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
case of SLP. */
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
if (slp_node)
ncopies = 1;
else
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
gcc_assert (ncopies >= 1);
/* Shifts are handled in vectorizable_shift (). */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (code == LSHIFT_EXPR || code == RSHIFT_EXPR || code == LROTATE_EXPR
|| code == RROTATE_EXPR)
return false;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Supportable by target? */
vec_mode = TYPE_MODE (vectype);
if (code == MULT_HIGHPART_EXPR)
target_support_p = can_mult_highpart_p (vec_mode, TYPE_UNSIGNED (vectype));
else
{
optab = optab_for_tree_code (code, vectype, optab_default);
if (!optab)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"no optab.\n");
return false;
}
target_support_p = (optab_handler (optab, vec_mode)
!= CODE_FOR_nothing);
}
if (!target_support_p)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"op not supported by target.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Check only during analysis. */
if (GET_MODE_SIZE (vec_mode) != UNITS_PER_WORD
|| (!vec_stmt && vf < vect_min_worthwhile_factor (code)))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
if (dump_enabled_p ())
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"proceeding using word mode.\n");
}
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
/* Worthwhile without SIMD support? Check only during analysis. */
if (!VECTOR_MODE_P (vec_mode)
&& !vec_stmt
&& vf < vect_min_worthwhile_factor (code))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"not worthwhile without SIMD support.\n");
return false;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (!vec_stmt) /* transformation not required. */
{
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
STMT_VINFO_TYPE (stmt_info) = op_vec_info_type;
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"=== vectorizable_operation ===\n");
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
vect_model_simple_cost (stmt_info, ncopies, dt, NULL, NULL);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
/** Transform. **/
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"transform binary/unary operation.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Handle def. */
vec_dest = vect_create_destination_var (scalar_dest, vectype);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* In case the vectorization factor (VF) is bigger than the number
of elements that we can fit in a vectype (nunits), we have to generate
more than one vector stmt - i.e - we need to "unroll" the
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
vector stmt by a factor VF/nunits. In doing so, we record a pointer
from one copy of the vector stmt to the next, in the field
STMT_VINFO_RELATED_STMT. This is necessary in order to allow following
stages to find the correct vector defs to be used when vectorizing
stmts that use the defs of the current stmt. The example below
illustrates the vectorization process when VF=16 and nunits=4 (i.e.,
we need to create 4 vectorized stmts):
before vectorization:
RELATED_STMT VEC_STMT
S1: x = memref - -
S2: z = x + 1 - -
step 1: vectorize stmt S1 (done in vectorizable_load. See more details
there):
RELATED_STMT VEC_STMT
VS1_0: vx0 = memref0 VS1_1 -
VS1_1: vx1 = memref1 VS1_2 -
VS1_2: vx2 = memref2 VS1_3 -
VS1_3: vx3 = memref3 - -
S1: x = load - VS1_0
S2: z = x + 1 - -
step2: vectorize stmt S2 (done here):
To vectorize stmt S2 we first need to find the relevant vector
def for the first operand 'x'. This is, as usual, obtained from
the vector stmt recorded in the STMT_VINFO_VEC_STMT of the stmt
that defines 'x' (S1). This way we find the stmt VS1_0, and the
relevant vector def 'vx0'. Having found 'vx0' we can generate
the vector stmt VS2_0, and as usual, record it in the
STMT_VINFO_VEC_STMT of stmt S2.
When creating the second copy (VS2_1), we obtain the relevant vector
def from the vector stmt recorded in the STMT_VINFO_RELATED_STMT of
stmt VS1_0. This way we find the stmt VS1_1 and the relevant
vector def 'vx1'. Using 'vx1' we create stmt VS2_1 and record a
pointer to it in the STMT_VINFO_RELATED_STMT of the vector stmt VS2_0.
Similarly when creating stmts VS2_2 and VS2_3. This is the resulting
chain of stmts and pointers:
RELATED_STMT VEC_STMT
VS1_0: vx0 = memref0 VS1_1 -
VS1_1: vx1 = memref1 VS1_2 -
VS1_2: vx2 = memref2 VS1_3 -
VS1_3: vx3 = memref3 - -
S1: x = load - VS1_0
VS2_0: vz0 = vx0 + v1 VS2_1 -
VS2_1: vz1 = vx1 + v1 VS2_2 -
VS2_2: vz2 = vx2 + v1 VS2_3 -
VS2_3: vz3 = vx3 + v1 - -
S2: z = x + 1 - VS2_0 */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
prev_stmt_info = NULL;
for (j = 0; j < ncopies; j++)
{
/* Handle uses. */
if (j == 0)
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
if (op_type == binary_op || op_type == ternary_op)
vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0, &vec_oprnds1,
slp_node, -1);
else
vect_get_vec_defs (op0, NULL_TREE, stmt, &vec_oprnds0, NULL,
slp_node, -1);
if (op_type == ternary_op)
vect_get_vec_defs (op2, NULL_TREE, stmt, &vec_oprnds2, NULL,
slp_node, -1);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
{
vect_get_vec_defs_for_stmt_copy (dt, &vec_oprnds0, &vec_oprnds1);
if (op_type == ternary_op)
{
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
tree vec_oprnd = vec_oprnds2.pop ();
vec_oprnds2.quick_push (vect_get_vec_def_for_stmt_copy (dt[2],
vec_oprnd));
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
}
}
/* Arguments are ready. Create the new vector stmt. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (vec_oprnds0, i, vop0)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
vop1 = ((op_type == binary_op || op_type == ternary_op)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
? vec_oprnds1[i] : NULL_TREE);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
vop2 = ((op_type == ternary_op)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
? vec_oprnds2[i] : NULL_TREE);
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 (vec_dest, code, vop0, vop1, vop2);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_assign_set_lhs (new_stmt, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (slp_node)
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
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (slp_node)
continue;
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0.release ();
vec_oprnds1.release ();
vec_oprnds2.release ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
/* A helper function to ensure data reference DR's base alignment
for STMT_INFO. */
static void
ensure_base_align (stmt_vec_info stmt_info, struct data_reference *dr)
{
if (!dr->aux)
return;
if (DR_VECT_AUX (dr)->base_misaligned)
{
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
tree base_decl = DR_VECT_AUX (dr)->base_decl;
if (decl_in_symtab_p (base_decl))
symtab_node::get (base_decl)->increase_alignment (TYPE_ALIGN (vectype));
else
{
tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount. * tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount. (SET_TYPE_ALIGN, SET_DECL_ALIGN): New. * tree-core.h (tree_type_common.align): Use bit-field. (tree_type_common.spare): New. (tree_decl_common.off_align): Make smaller. (tree_decl_common.align): Use bit-field. * expr.c (expand_expr_addr_expr_1): Use SET_TYPE_ALIGN. * omp-low.c (install_var_field): Use SET_DECL_ALIGN. (scan_sharing_clauses): Ditto. (finish_taskreg_scan): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (omp_finish_file): Ditto. * stor-layout.c (do_type_align): Use SET_DECL_ALIGN. (layout_decl): Ditto. (relayout_decl): Ditto. (finalize_record_size): Use SET_TYPE_ALIGN. (finalize_type_size): Ditto. (finish_builtin_struct): Ditto. (layout_type): Ditto. (initialize_sizetypes): Ditto. * targhooks.c (std_gimplify_va_arg_expr): Use SET_TYPE_ALIGN. * tree-nested.c (insert_field_into_struct): Use SET_TYPE_ALIGN. (lookup_field_for_decl): Use SET_DECL_ALIGN. (get_chain_field): Ditto. (get_trampoline_type): Ditto. (get_nl_goto_field): Ditto. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use SET_DECL_ALIGN. (unpack_ts_type_common_value_fields): Use SET_TYPE_ALIGN. * gimple-expr.c (copy_var_decl): Use SET_DECL_ALIGN. * tree.c (make_node_stat): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (build_qualified_type): Use SET_TYPE_ALIGN. (build_aligned_type, build_range_type_1): Ditto. (build_atomic_base): Ditto. (build_common_tree_nodes): Ditto. * cfgexpand.c (align_local_variable): Use SET_DECL_ALIGN. (expand_one_stack_var_at): Ditto. * coverage.c (build_var): Use SET_DECL_ALIGN. * except.c (init_eh): Ditto. * function.c (assign_parm_setup_block): Ditto. * symtab.c (increase_alignment_1): Ditto. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Ditto. * tree-vect-stmts.c (ensure_base_align): Ditto. * varasm.c (align_variable): Ditto. (assemble_variable): Ditto. (build_constant_desc): Ditto. (output_constant_def_contents): Ditto. * config/arm/arm.c (arm_relayout_function): Use SET_DECL_ALIGN. * config/avr/avr.c (avr_adjust_type_node): Use SET_TYPE_ALIGN. * config/mips/mips.c (mips_std_gimplify_va_arg_expr): Ditto. * config/msp430/msp430.c (msp430_gimplify_va_arg_expr): Ditto. * config/spu/spu.c (spu_build_builtin_va_list): Use SET_DECL_ALIGN. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN. (gnat_to_gnu_field): Ditto. (components_to_record): Ditto. (create_variant_part_from): Ditto. (copy_and_substitute_in_size): Ditto. (substitute_in_type): Ditto. * gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN. (make_packable_type): Ditto. (maybe_pad_type): Ditto. (finish_fat_pointer_type): Ditto. (finish_record_type): Ditto and use SET_DECL_ALIGN. (rest_of_record_type_compilation): Use SET_TYPE_ALIGN. (create_field_decl): Use SET_DECL_ALIGN. c-family/ * c-common.c (handle_aligned_attribute): Use SET_TYPE_ALIGN and SET_DECL_ALIGN. c/ * c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN. cp/ * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (layout_class_type): Ditto. (build_base_field): Use SET_DECL_ALIGN. (fixup_attribute_variants): Use SET_TYPE_ALIGN. * decl.c (duplicate_decls): Use SET_DECL_ALIGN. (record_unknown_type): Use SET_TYPE_ALIGN. (cxx_init_decl_processing): Ditto. (copy_type_enum): Ditto. (grokfndecl): Use SET_DECL_ALIGN. (copy_type_enum): Use SET_TYPE_ALIGN. * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN. (tsubst): Ditto. * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN. * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN. * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN. * rtti.c (emit_tinfo_decl): Ditto. fortran/ * trans-io.c (gfc_build_io_library_fndecls): Use SET_TYPE_ALIGN. * trans-common.c (build_common_decl): Use SET_DECL_ALIGN. * trans-types.c (gfc_add_field_to_struct): Use SET_DECL_ALIGN. go/ * go-gcc.cc (Gcc_backend::implicit_variable): Use SET_DECL_ALIGN. java/ * class.c (add_method_1): Use SET_DECL_ALIGN. (make_class_data): Ditto. (emit_register_classes_in_jcr_section): Ditto. * typeck.c (build_java_array_type): Ditto. objc/ * objc-act.c (objc_build_struct): Use SET_DECL_ALIGN. libcc1/ * plugin.cc (plugin_finish_record_or_union): Use SET_TYPE_ALIGN. From-SVN: r235172
2016-04-18 22:36:27 +02:00
SET_DECL_ALIGN (base_decl, TYPE_ALIGN (vectype));
DECL_USER_ALIGN (base_decl) = 1;
}
DR_VECT_AUX (dr)->base_misaligned = false;
}
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function get_group_alias_ptr_type.
Return the alias type for the group starting at FIRST_STMT. */
static tree
get_group_alias_ptr_type (gimple *first_stmt)
{
struct data_reference *first_dr, *next_dr;
gimple *next_stmt;
first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (first_stmt));
while (next_stmt)
{
next_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (next_stmt));
if (get_alias_set (DR_REF (first_dr))
!= get_alias_set (DR_REF (next_dr)))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location,
"conflicting alias set types.\n");
return ptr_type_node;
}
next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt));
}
return reference_alias_ptr_type (DR_REF (first_dr));
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function vectorizable_store.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
Check if STMT defines a non scalar data-ref (array/pointer/structure) that
can be vectorized.
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt to replace it, put it in VEC_STMT, and insert it at BSI.
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
static bool
vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
slp_tree slp_node)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree scalar_dest;
tree data_ref;
tree op;
tree vec_oprnd = NULL_TREE;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info), *first_dr = NULL;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
tree elem_type;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
struct loop *loop = NULL;
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 vec_mode;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree dummy;
enum dr_alignment_support alignment_support_scheme;
gimple *def_stmt;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum vect_def_type dt;
stmt_vec_info prev_stmt_info = NULL;
tree dataref_ptr = NULL_TREE;
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
tree dataref_offset = NULL_TREE;
gimple *ptr_incr = NULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
int ncopies;
int j;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
gimple *next_stmt, *first_stmt;
bool grouped_store;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
unsigned int group_size, i;
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
vec<tree> oprnds = vNULL;
vec<tree> result_chain = vNULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
bool inv_p;
tree offset = NULL_TREE;
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
vec<tree> vec_oprnds = vNULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
bool slp = (slp_node != NULL);
unsigned int vec_num;
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
vec_info *vinfo = stmt_info->vinfo;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
tree aggr_type;
gather_scatter_info gs_info;
enum vect_def_type scatter_src_dt = vect_unknown_def_type;
gimple *new_stmt;
int vf;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vec_load_store_type vls_type;
tree ref_type;
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& ! vec_stmt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
/* Is vectorizable store? */
if (!is_gimple_assign (stmt))
return false;
scalar_dest = gimple_assign_lhs (stmt);
if (TREE_CODE (scalar_dest) == VIEW_CONVERT_EXPR
&& is_pattern_stmt_p (stmt_info))
scalar_dest = TREE_OPERAND (scalar_dest, 0);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (TREE_CODE (scalar_dest) != ARRAY_REF
&& TREE_CODE (scalar_dest) != BIT_FIELD_REF
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
&& TREE_CODE (scalar_dest) != INDIRECT_REF
&& TREE_CODE (scalar_dest) != COMPONENT_REF
&& TREE_CODE (scalar_dest) != IMAGPART_EXPR
re PR middle-end/42834 (memcpy folding overeager) 2010-07-01 Richard Guenther <rguenther@suse.de> PR middle-end/42834 PR middle-end/44468 * doc/gimple.texi (is_gimple_mem_ref_addr): Document. * doc/generic.texi (References to storage): Document MEM_REF. * tree-pretty-print.c (dump_generic_node): Handle MEM_REF. (print_call_name): Likewise. * tree.c (recompute_tree_invariant_for_addr_expr): Handle MEM_REF. (build_simple_mem_ref_loc): New function. (mem_ref_offset): Likewise. * tree.h (build_simple_mem_ref_loc): Declare. (build_simple_mem_ref): Define. (mem_ref_offset): Declare. * fold-const.c: Include tree-flow.h. (operand_equal_p): Handle MEM_REF. (build_fold_addr_expr_with_type_loc): Likewise. (fold_comparison): Likewise. (fold_unary_loc): Fold VIEW_CONVERT_EXPR <T1, MEM_REF <T2, ...>> to MEM_REF <T1, ...>. (fold_binary_loc): Fold MEM[&MEM[p, CST1], CST2] to MEM[p, CST1 + CST2], fold MEM[&a.b, CST2] to MEM[&a, offsetof (a, b) + CST2]. * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle MEM_REF. (ptr_deref_may_alias_ref_p_1): Likewise. (ao_ref_base_alias_set): Properly differentiate base object for offset and TBAA. (ao_ref_init_from_ptr_and_size): Use MEM_REF. (indirect_ref_may_alias_decl_p): Handle MEM_REFs properly. (indirect_refs_may_alias_p): Likewise. (refs_may_alias_p_1): Likewise. Remove pointer SSA name def chasing code. (ref_maybe_used_by_call_p_1): Handle MEM_REF. (call_may_clobber_ref_p_1): Likewise. * dwarf2out.c (loc_list_from_tree): Handle MEM_REF. * expr.c (expand_assignment): Handle MEM_REF. (store_expr): Handle MEM_REFs from STRING_CSTs. (store_field): If expanding a MEM_REF of a non-addressable decl use bitfield operations. (get_inner_reference): Handle MEM_REF. (expand_expr_addr_expr_1): Likewise. (expand_expr_real_1): Likewise. * tree-eh.c (tree_could_trap_p): Handle MEM_REF. * alias.c (ao_ref_from_mem): Handle MEM_REF. (get_alias_set): Likewise. Properly handle VIEW_CONVERT_EXPRs. * tree-data-ref.c (dr_analyze_innermost): Handle MEM_REF. (dr_analyze_indices): Likewise. (dr_analyze_alias): Likewise. (object_address_invariant_in_loop_p): Likewise. * gimplify.c (mark_addressable): Handle MEM_REF. (gimplify_cond_expr): Build MEM_REFs. (gimplify_modify_expr_to_memcpy): Likewise. (gimplify_init_ctor_preeval_1): Handle MEM_REF. (gimple_fold_indirect_ref): Adjust. (gimplify_expr): Handle MEM_REF. Gimplify INDIRECT_REF to MEM_REF. * tree.def (MEM_REF): New tree code. * tree-dfa.c: Include toplev.h. (get_ref_base_and_extent): Handle MEM_REF. (get_addr_base_and_unit_offset): New function. * emit-rtl.c (set_mem_attributes_minus_bitpos): Handle MEM_REF. * gimple-fold.c (may_propagate_address_into_dereference): Handle MEM_REF. (maybe_fold_offset_to_array_ref): Allow possibly out-of bounds accesses if the array has just one dimension. Remove always true parameter. Do not require type compatibility here. (maybe_fold_offset_to_component_ref): Remove. (maybe_fold_stmt_indirect): Remove. (maybe_fold_reference): Remove INDIRECT_REF handling. Fold back to non-MEM_REF. (maybe_fold_offset_to_address): Simplify. Deal with type mismatches here. (maybe_fold_reference): Likewise. (maybe_fold_stmt_addition): Likewise. Also handle &ARRAY + I in addition to &ARRAY[0] + I. (fold_gimple_assign): Handle ADDR_EXPR of MEM_REFs. (gimple_get_relevant_ref_binfo): Handle MEM_REF. * cfgexpand.c (expand_debug_expr): Handle MEM_REF. * tree-ssa.c (useless_type_conversion_p): Make most pointer conversions useless. (warn_uninitialized_var): Handle MEM_REF. (maybe_rewrite_mem_ref_base): New function. (execute_update_addresses_taken): Implement re-writing of MEM_REFs to SSA form. * tree-inline.c (remap_gimple_op_r): Handle MEM_REF, remove INDIRECT_REF handling. (copy_tree_body_r): Handle MEM_REF. * gimple.c (is_gimple_addressable): Adjust. (is_gimple_address): Likewise. (is_gimple_invariant_address): ADDR_EXPRs of MEM_REFs with invariant base are invariant. (is_gimple_min_lval): Adjust. (is_gimple_mem_ref_addr): New function. (get_base_address): Handle MEM_REF. (count_ptr_derefs): Likewise. (get_base_loadstore): Likewise. * gimple.h (is_gimple_mem_ref_addr): Declare. (gimple_call_fndecl): Handle invariant MEM_REF addresses. * tree-cfg.c (verify_address): New function, split out from ... (verify_expr): ... here. Use for verifying ADDR_EXPRs and the address operand of MEM_REFs. Verify MEM_REFs. Reject INDIRECT_REFs. (verify_types_in_gimple_min_lval): Handle MEM_REF. Disallow INDIRECT_REF. Allow conversions. (verify_types_in_gimple_reference): Verify VIEW_CONVERT_EXPR of a register does not change its size. (verify_types_in_gimple_reference): Verify MEM_REF. (verify_gimple_assign_single): Disallow INDIRECT_REF. Handle MEM_REF. * tree-ssa-operands.c (opf_non_addressable, opf_not_non_addressable): New. (mark_address_taken): Handle MEM_REF. (get_indirect_ref_operands): Pass through opf_not_non_addressable. (get_asm_expr_operands): Pass opf_not_non_addressable. (get_expr_operands): Handle opf_[not_]non_addressable. Handle MEM_REF. Remove INDIRECT_REF handling. * tree-vrp.c: (check_array_ref): Handle MEM_REF. (search_for_addr_array): Likewise. (check_array_bounds): Likewise. (vrp_stmt_computes_nonzero): Adjust for MEM_REF. * tree-ssa-loop-im.c (for_each_index): Handle MEM_REF. (ref_always_accessed_p): Likewise. (gen_lsm_tmp_name): Likewise. Handle ADDR_EXPR. * tree-complex.c (extract_component): Do not handle INDIRECT_REF. Handle MEM_REF. * cgraphbuild.c (mark_load): Properly check for NULL result from get_base_address. (mark_store): Likewise. * tree-ssa-loop-niter.c (array_at_struct_end_p): Handle MEM_REF. * tree-loop-distribution.c (generate_builtin): Exchange INDIRECT_REF handling for MEM_REF. * tree-scalar-evolution.c (follow_ssa_edge_expr): Handle &MEM[ptr + CST] similar to POINTER_PLUS_EXPR. * builtins.c (stabilize_va_list_loc): Use the function ABI valist type if we couldn't canonicalize the argument type. Always dereference with the canonical va-list type. (maybe_emit_free_warning): Handle MEM_REF. (fold_builtin_memory_op): Simplify and handle MEM_REFs in folding memmove to memcpy. * builtins.c (fold_builtin_memory_op): Use ref-all types for all memcpy foldings. * omp-low.c (build_receiver_ref): Adjust for MEM_REF. (build_outer_var_ref): Likewise. (scan_omp_1_op): Likewise. (lower_rec_input_clauses): Likewise. (lower_lastprivate_clauses): Likewise. (lower_reduction_clauses): Likewise. (lower_copyprivate_clauses): Likewise. (expand_omp_atomic_pipeline): Likewise. (expand_omp_atomic_mutex): Likewise. (create_task_copyfn): Likewise. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle MEM_REF. Remove old union trick. Initialize constant offsets. (ao_ref_init_from_vn_reference): Likewise. Do not handle INDIRECT_REF. Init base_alias_set properly. (vn_reference_lookup_3): Replace INDIRECT_REF handling with MEM_REF. (vn_reference_fold_indirect): Adjust for MEM_REFs. (valueize_refs): Fold MEM_REFs. Re-evaluate constant offset for ARRAY_REFs. (may_insert): Remove. (visit_reference_op_load): Do not test may_insert. (run_scc_vn): Remove parameter, do not fiddle with may_insert. * tree-ssa-sccvn.h (struct vn_reference_op_struct): Add a field to store the constant offset this op applies. (run_scc_vn): Adjust prototype. * cgraphunit.c (thunk_adjust): Adjust for MEM_REF. * tree-ssa-ccp.c (ccp_fold): Replace INDIRECT_REF folding with MEM_REF. Propagate &foo + CST as &MEM[&foo, CST]. Do not bother about volatile qualifiers on pointers. (fold_const_aggregate_ref): Handle MEM_REF, do not handle INDIRECT_REF. * tree-ssa-loop-ivopts.c * tree-ssa-loop-ivopts.c (determine_base_object): Adjust for MEM_REF. (strip_offset_1): Likewise. (find_interesting_uses_address): Replace INDIRECT_REF handling with MEM_REF handling. (get_computation_cost_at): Likewise. * ipa-pure-const.c (check_op): Handle MEM_REF. * tree-stdarg.c (check_all_va_list_escapes): Adjust for MEM_REF. * tree-ssa-sink.c (is_hidden_global_store): Handle MEM_REF and constants. * ipa-inline.c (likely_eliminated_by_inlining_p): Handle MEM_REF. * tree-parloops.c (take_address_of): Adjust for MEM_REF. (eliminate_local_variables_1): Likewise. (create_call_for_reduction_1): Likewise. (create_loads_for_reductions): Likewise. (create_loads_and_stores_for_name): Likewise. * matrix-reorg.c (may_flatten_matrices_1): Sanitize. (ssa_accessed_in_tree): Handle MEM_REF. (ssa_accessed_in_assign_rhs): Likewise. (update_type_size): Likewise. (analyze_accesses_for_call_stmt): Likewise. (analyze_accesses_for_assign_stmt): Likewise. (transform_access_sites): Likewise. (transform_allocation_sites): Likewise. * tree-affine.c (tree_to_aff_combination): Handle MEM_REF. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Do not handle INDIRECT_REF. * tree-ssa-phiopt.c (add_or_mark_expr): Handle MEM_REF. (cond_store_replacement): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Handle MEM_REF, no not handle INDIRECT_REFs. (insert_into_preds_of_block): Properly initialize avail. (phi_translate_1): Fold MEM_REFs. Re-evaluate constant offset for ARRAY_REFs. Properly handle reference lookups that require a bit re-interpretation. (can_PRE_operation): Do not handle INDIRECT_REF. Handle MEM_REF. * tree-sra.c * tree-sra.c (build_access_from_expr_1): Handle MEM_REF. (build_ref_for_offset_1): Remove. (build_ref_for_offset): Build MEM_REFs. (gate_intra_sra): Disable for now. (sra_ipa_modify_expr): Handle MEM_REF. (ipa_early_sra_gate): Disable for now. * tree-sra.c (create_access): Swap INDIRECT_REF handling for MEM_REF handling. (disqualify_base_of_expr): Likewise. (ptr_parm_has_direct_uses): Swap INDIRECT_REF handling for MEM_REF handling. (sra_ipa_modify_expr): Remove INDIRECT_REF handling. Use mem_ref_offset. Remove bogus folding. (build_access_from_expr_1): Properly handle MEM_REF for non IPA-SRA. (make_fancy_name_1): Add support for MEM_REF. * tree-predcom.c (ref_at_iteration): Handle MEM_REFs. * tree-mudflap.c (mf_xform_derefs_1): Adjust for MEM_REF. * ipa-prop.c (compute_complex_assign_jump_func): Handle MEM_REF. (compute_complex_ancestor_jump_func): Likewise. (ipa_analyze_virtual_call_uses): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Replace INDIRECT_REF folding with more generalized MEM_REF folding. (tree_ssa_forward_propagate_single_use_vars): Adjust accordingly. (forward_propagate_addr_into_variable_array_index): Also handle &ARRAY + I in addition to &ARRAY[0] + I. * tree-ssa-dce.c (ref_may_be_aliased): Handle MEM_REF. * tree-ssa-ter.c (find_replaceable_in_bb): Avoid TER if that creates assignments with overlap. * tree-nested.c (get_static_chain): Adjust for MEM_REF. (get_frame_field): Likewise. (get_nonlocal_debug_decl): Likewise. (convert_nonlocal_reference_op): Likewise. (struct nesting_info): Add mem_refs pointer-set. (create_nesting_tree): Allocate it. (convert_local_reference_op): Insert to be folded mem-refs. (fold_mem_refs): New function. (finalize_nesting_tree_1): Perform defered folding of mem-refs (free_nesting_tree): Free the pointer-set. * tree-vect-stmts.c (vectorizable_store): Adjust for MEM_REF. (vectorizable_load): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Adjust for MEM_REF. (propagate_with_phi): Likewise. * tree-object-size.c (addr_object_size): Handle MEM_REFs instead of INDIRECT_REFs. (compute_object_offset): Handle MEM_REF. (plus_stmt_object_size): Handle MEM_REF. (collect_object_sizes_for): Dispatch to plus_stmt_object_size for &MEM_REF. * tree-flow.h (get_addr_base_and_unit_offset): Declare. (symbol_marked_for_renaming): Likewise. * Makefile.in (tree-dfa.o): Add $(TOPLEV_H). (fold-const.o): Add $(TREE_FLOW_H). * tree-ssa-structalias.c (get_constraint_for_1): Handle MEM_REF. (find_func_clobbers): Likewise. * ipa-struct-reorg.c (decompose_indirect_ref_acc): Handle MEM_REF. (decompose_access): Likewise. (replace_field_acc): Likewise. (replace_field_access_stmt): Likewise. (insert_new_var_in_stmt): Likewise. (get_stmt_accesses): Likewise. (reorg_structs_drive): Disable. * config/i386/i386.c (ix86_va_start): Adjust for MEM_REF. (ix86_canonical_va_list_type): Likewise. cp/ * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs predicate we are looking for, allow non-gimplified INDIRECT_REFs. testsuite/ * gcc.c-torture/execute/20100316-1.c: New testcase. * gcc.c-torture/execute/pr44468.c: Likewise. * gcc.c-torture/compile/20100609-1.c: Likewise. * gcc.dg/volatile2.c: Adjust. * gcc.dg/plugin/selfassign.c: Likewise. * gcc.dg/pr36902.c: Likewise. * gcc.dg/tree-ssa/foldaddr-2.c: Remove. * gcc.dg/tree-ssa/foldaddr-3.c: Likewise. * gcc.dg/tree-ssa/forwprop-8.c: Adjust. * gcc.dg/tree-ssa/pr17141-1.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-13.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-14.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-21.c: Likewise. * gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise. * gcc.dg/tree-ssa/20030807-7.c: Likewise. * gcc.dg/tree-ssa/forwprop-10.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-1.c: Likewise. * gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-23.c: Likewise. * gcc.dg/tree-ssa/forwprop-1.c: Likewise. * gcc.dg/tree-ssa/forwprop-2.c: Likewise. * gcc.dg/tree-ssa/struct-aliasing-1.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-25.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-26.c: Likewise. * gcc.dg/tree-ssa/struct-aliasing-2.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-26.c: Likewise. * gcc.dg/tree-ssa/ssa-sccvn-4.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-7.c: Likewise. * gcc.dg/tree-ssa/forwprop-5.c: Likewise. * gcc.dg/struct/w_prof_two_strs.c: XFAIL. * gcc.dg/struct/wo_prof_escape_arg_to_local.c: Likewise. * gcc.dg/struct/wo_prof_global_var.c: Likewise. * gcc.dg/struct/wo_prof_malloc_size_var.c: Likewise. * gcc.dg/struct/w_prof_local_array.c: Likewise. * gcc.dg/struct/w_prof_single_str_global.c: Likewise. * gcc.dg/struct/wo_prof_escape_str_init.c: Likewise. * gcc.dg/struct/wo_prof_array_through_pointer.c: Likewise. * gcc.dg/struct/w_prof_global_array.c: Likewise. * gcc.dg/struct/wo_prof_array_field.c: Likewise. * gcc.dg/struct/wo_prof_single_str_local.c: Likewise. * gcc.dg/struct/w_prof_local_var.c: Likewise. * gcc.dg/struct/wo_prof_two_strs.c: Likewise. * gcc.dg/struct/wo_prof_empty_str.c: Likewise. * gcc.dg/struct/wo_prof_local_array.c: Likewise. * gcc.dg/struct/w_prof_global_var.c: Likewise. * gcc.dg/struct/wo_prof_single_str_global.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_value.c: Likewise. * gcc.dg/struct/wo_prof_global_array.c: Likewise. * gcc.dg/struct/wo_prof_escape_return.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_array.c: Likewise. * gcc.dg/struct/wo_prof_double_malloc.c: Likewise. * gcc.dg/struct/w_ratio_cold_str.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_pointer.c: Likewise. * gcc.dg/struct/wo_prof_local_var.c: Likewise. * gcc.dg/tree-prof/stringop-1.c: Adjust. * g++.dg/tree-ssa/pr31146.C: Likewise. * g++.dg/tree-ssa/copyprop-1.C: Likewise. * g++.dg/tree-ssa/pr33604.C: Likewise. * g++.dg/plugin/selfassign.c: Likewise. * gfortran.dg/array_memcpy_3.f90: Likewise. * gfortran.dg/array_memcpy_4.f90: Likewise. * c-c++-common/torture/pr42834.c: New testcase. From-SVN: r161655
2010-07-01 10:49:19 +02:00
&& TREE_CODE (scalar_dest) != REALPART_EXPR
&& TREE_CODE (scalar_dest) != MEM_REF)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
/* Cannot have hybrid store SLP -- that would mean storing to the
same location twice. */
gcc_assert (slp == PURE_SLP_STMT (stmt_info));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gcc_assert (gimple_assign_single_p (stmt));
tree vectype = STMT_VINFO_VECTYPE (stmt_info), rhs_vectype = NULL_TREE;
unsigned int nunits = TYPE_VECTOR_SUBPARTS (vectype);
if (loop_vinfo)
{
loop = LOOP_VINFO_LOOP (loop_vinfo);
vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
}
else
vf = 1;
/* Multiple types in SLP are handled by creating the appropriate number of
vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
case of SLP. */
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
if (slp)
ncopies = 1;
else
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
/* FORNOW. This restriction should be relaxed. */
if (loop && nested_in_vect_loop_p (loop, stmt) && ncopies > 1)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"multiple types in nested loop.\n");
return false;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
op = gimple_assign_rhs1 (stmt);
/* In the case this is a store from a STRING_CST make sure
native_encode_expr can handle it. */
if (TREE_CODE (op) == STRING_CST
&& ! can_native_encode_string_p (op))
return false;
if (!vect_is_simple_use (op, vinfo, &def_stmt, &dt, &rhs_vectype))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"use not simple.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (dt == vect_constant_def || dt == vect_external_def)
vls_type = VLS_STORE_INVARIANT;
else
vls_type = VLS_STORE;
if (rhs_vectype && !useless_type_conversion_p (vectype, rhs_vectype))
return false;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
elem_type = TREE_TYPE (vectype);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vec_mode = TYPE_MODE (vectype);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* FORNOW. In some cases can vectorize even if data-type not supported
(e.g. - array initialization with 0). */
if (optab_handler (mov_optab, vec_mode) == CODE_FOR_nothing)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
if (!STMT_VINFO_DATA_REF (stmt_info))
return false;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vect_memory_access_type memory_access_type;
if (!get_load_store_type (stmt, vectype, slp, vls_type, ncopies,
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
&memory_access_type, &gs_info))
return false;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (!vec_stmt) /* transformation not required. */
{
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
STMT_VINFO_MEMORY_ACCESS_TYPE (stmt_info) = memory_access_type;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
STMT_VINFO_TYPE (stmt_info) = store_vec_info_type;
/* The SLP costs are calculated during SLP analysis. */
if (!PURE_SLP_STMT (stmt_info))
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vect_model_store_cost (stmt_info, ncopies, memory_access_type, dt,
NULL, NULL, NULL);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
gcc_assert (memory_access_type == STMT_VINFO_MEMORY_ACCESS_TYPE (stmt_info));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/** Transform. **/
ensure_base_align (stmt_info, dr);
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_GATHER_SCATTER)
{
tree vec_oprnd0 = NULL_TREE, vec_oprnd1 = NULL_TREE, op, src;
tree arglist = TYPE_ARG_TYPES (TREE_TYPE (gs_info.decl));
tree rettype, srctype, ptrtype, idxtype, masktype, scaletype;
tree ptr, mask, var, scale, perm_mask = NULL_TREE;
edge pe = loop_preheader_edge (loop);
gimple_seq seq;
basic_block new_bb;
enum { NARROW, NONE, WIDEN } modifier;
int scatter_off_nunits = TYPE_VECTOR_SUBPARTS (gs_info.offset_vectype);
if (nunits == (unsigned int) scatter_off_nunits)
modifier = NONE;
else if (nunits == (unsigned int) scatter_off_nunits / 2)
{
unsigned char *sel = XALLOCAVEC (unsigned char, scatter_off_nunits);
modifier = WIDEN;
for (i = 0; i < (unsigned int) scatter_off_nunits; ++i)
sel[i] = i | nunits;
perm_mask = vect_gen_perm_mask_checked (gs_info.offset_vectype, sel);
gcc_assert (perm_mask != NULL_TREE);
}
else if (nunits == (unsigned int) scatter_off_nunits * 2)
{
unsigned char *sel = XALLOCAVEC (unsigned char, nunits);
modifier = NARROW;
for (i = 0; i < (unsigned int) nunits; ++i)
sel[i] = i | scatter_off_nunits;
perm_mask = vect_gen_perm_mask_checked (vectype, sel);
gcc_assert (perm_mask != NULL_TREE);
ncopies *= 2;
}
else
gcc_unreachable ();
rettype = TREE_TYPE (TREE_TYPE (gs_info.decl));
ptrtype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
masktype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
idxtype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
srctype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
scaletype = TREE_VALUE (arglist);
gcc_checking_assert (TREE_CODE (masktype) == INTEGER_TYPE
&& TREE_CODE (rettype) == VOID_TYPE);
ptr = fold_convert (ptrtype, gs_info.base);
if (!is_gimple_min_invariant (ptr))
{
ptr = force_gimple_operand (ptr, &seq, true, NULL_TREE);
new_bb = gsi_insert_seq_on_edge_immediate (pe, seq);
gcc_assert (!new_bb);
}
/* Currently we support only unconditional scatter stores,
so mask should be all ones. */
mask = build_int_cst (masktype, -1);
mask = vect_init_vector (stmt, mask, masktype, NULL);
scale = build_int_cst (scaletype, gs_info.scale);
prev_stmt_info = NULL;
for (j = 0; j < ncopies; ++j)
{
if (j == 0)
{
src = vec_oprnd1
= vect_get_vec_def_for_operand (gimple_assign_rhs1 (stmt), stmt);
op = vec_oprnd0
= vect_get_vec_def_for_operand (gs_info.offset, stmt);
}
else if (modifier != NONE && (j & 1))
{
if (modifier == WIDEN)
{
src = vec_oprnd1
= vect_get_vec_def_for_stmt_copy (scatter_src_dt, vec_oprnd1);
op = permute_vec_elements (vec_oprnd0, vec_oprnd0, perm_mask,
stmt, gsi);
}
else if (modifier == NARROW)
{
src = permute_vec_elements (vec_oprnd1, vec_oprnd1, perm_mask,
stmt, gsi);
op = vec_oprnd0
= vect_get_vec_def_for_stmt_copy (gs_info.offset_dt,
vec_oprnd0);
}
else
gcc_unreachable ();
}
else
{
src = vec_oprnd1
= vect_get_vec_def_for_stmt_copy (scatter_src_dt, vec_oprnd1);
op = vec_oprnd0
= vect_get_vec_def_for_stmt_copy (gs_info.offset_dt,
vec_oprnd0);
}
if (!useless_type_conversion_p (srctype, TREE_TYPE (src)))
{
gcc_assert (TYPE_VECTOR_SUBPARTS (TREE_TYPE (src))
== TYPE_VECTOR_SUBPARTS (srctype));
var = vect_get_new_ssa_name (srctype, vect_simple_var);
src = build1 (VIEW_CONVERT_EXPR, srctype, src);
new_stmt = gimple_build_assign (var, VIEW_CONVERT_EXPR, src);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
src = var;
}
if (!useless_type_conversion_p (idxtype, TREE_TYPE (op)))
{
gcc_assert (TYPE_VECTOR_SUBPARTS (TREE_TYPE (op))
== TYPE_VECTOR_SUBPARTS (idxtype));
var = vect_get_new_ssa_name (idxtype, vect_simple_var);
op = build1 (VIEW_CONVERT_EXPR, idxtype, op);
new_stmt = gimple_build_assign (var, VIEW_CONVERT_EXPR, op);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
op = var;
}
new_stmt
= gimple_build_call (gs_info.decl, 5, ptr, mask, op, src, scale);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (prev_stmt_info == NULL)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
return true;
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
grouped_store = STMT_VINFO_GROUPED_ACCESS (stmt_info);
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
if (grouped_store)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
GROUP_STORE_COUNT (vinfo_for_stmt (first_stmt))++;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* FORNOW */
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
gcc_assert (!loop || !nested_in_vect_loop_p (loop, stmt));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* We vectorize all the stmts of the interleaving group when we
reach the last stmt in the group. */
if (GROUP_STORE_COUNT (vinfo_for_stmt (first_stmt))
< GROUP_SIZE (vinfo_for_stmt (first_stmt))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
&& !slp)
{
*vec_stmt = NULL;
return true;
}
if (slp)
{
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
grouped_store = false;
/* VEC_NUM is the number of vect stmts to be created for this
group. */
vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
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
first_stmt = SLP_TREE_SCALAR_STMTS (slp_node)[0];
gcc_assert (GROUP_FIRST_ELEMENT (vinfo_for_stmt (first_stmt)) == first_stmt);
first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
op = gimple_assign_rhs1 (first_stmt);
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
/* VEC_NUM is the number of vect stmts to be created for this
group. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vec_num = group_size;
ref_type = get_group_alias_ptr_type (first_stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
else
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
first_stmt = stmt;
first_dr = dr;
group_size = vec_num = 1;
ref_type = reference_alias_ptr_type (DR_REF (first_dr));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"transform store. ncopies = %d\n", ncopies);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_ELEMENTWISE
|| memory_access_type == VMAT_STRIDED_SLP)
{
gimple_stmt_iterator incr_gsi;
bool insert_after;
gimple *incr;
tree offvar;
tree ivstep;
tree running_off;
gimple_seq stmts = NULL;
tree stride_base, stride_step, alias_off;
tree vec_oprnd;
unsigned int g;
gcc_assert (!nested_in_vect_loop_p (loop, stmt));
stride_base
= fold_build_pointer_plus
(unshare_expr (DR_BASE_ADDRESS (first_dr)),
size_binop (PLUS_EXPR,
convert_to_ptrofftype (unshare_expr (DR_OFFSET (first_dr))),
convert_to_ptrofftype (DR_INIT (first_dr))));
stride_step = fold_convert (sizetype, unshare_expr (DR_STEP (first_dr)));
/* For a store with loop-invariant (but other than power-of-2)
stride (i.e. not a grouped access) like so:
for (i = 0; i < n; i += stride)
array[i] = ...;
we generate a new induction variable and new stores from
the components of the (vectorized) rhs:
for (j = 0; ; j += VF*stride)
vectemp = ...;
tmp1 = vectemp[0];
array[j] = tmp1;
tmp2 = vectemp[1];
array[j + stride] = tmp2;
...
*/
unsigned nstores = nunits;
unsigned lnel = 1;
tree ltype = elem_type;
if (slp)
{
if (group_size < nunits
&& nunits % group_size == 0)
{
nstores = nunits / group_size;
lnel = group_size;
ltype = build_vector_type (elem_type, group_size);
}
else if (group_size >= nunits
&& group_size % nunits == 0)
{
nstores = 1;
lnel = nunits;
ltype = vectype;
}
ltype = build_aligned_type (ltype, TYPE_ALIGN (elem_type));
ncopies = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
}
ivstep = stride_step;
ivstep = fold_build2 (MULT_EXPR, TREE_TYPE (ivstep), ivstep,
build_int_cst (TREE_TYPE (ivstep), vf));
standard_iv_increment_position (loop, &incr_gsi, &insert_after);
create_iv (stride_base, ivstep, NULL,
loop, &incr_gsi, insert_after,
&offvar, NULL);
incr = gsi_stmt (incr_gsi);
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
set_vinfo_for_stmt (incr, new_stmt_vec_info (incr, loop_vinfo));
stride_step = force_gimple_operand (stride_step, &stmts, true, NULL_TREE);
if (stmts)
gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
prev_stmt_info = NULL;
alias_off = build_int_cst (ref_type, 0);
next_stmt = first_stmt;
for (g = 0; g < group_size; g++)
{
running_off = offvar;
if (g)
{
tree size = TYPE_SIZE_UNIT (ltype);
tree pos = fold_build2 (MULT_EXPR, sizetype, size_int (g),
size);
tree newoff = copy_ssa_name (running_off, NULL);
incr = gimple_build_assign (newoff, POINTER_PLUS_EXPR,
running_off, pos);
vect_finish_stmt_generation (stmt, incr, gsi);
running_off = newoff;
}
unsigned int group_el = 0;
unsigned HOST_WIDE_INT
elsz = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (vectype)));
for (j = 0; j < ncopies; j++)
{
/* We've set op and dt above, from gimple_assign_rhs1(stmt),
and first_stmt == stmt. */
if (j == 0)
{
if (slp)
{
vect_get_vec_defs (op, NULL_TREE, stmt, &vec_oprnds, NULL,
slp_node, -1);
vec_oprnd = vec_oprnds[0];
}
else
{
gcc_assert (gimple_assign_single_p (next_stmt));
op = gimple_assign_rhs1 (next_stmt);
vec_oprnd = vect_get_vec_def_for_operand (op, next_stmt);
}
}
else
{
if (slp)
vec_oprnd = vec_oprnds[j];
else
{
vect_is_simple_use (vec_oprnd, vinfo, &def_stmt, &dt);
vec_oprnd = vect_get_vec_def_for_stmt_copy (dt, vec_oprnd);
}
}
for (i = 0; i < nstores; i++)
{
tree newref, newoff;
gimple *incr, *assign;
tree size = TYPE_SIZE (ltype);
/* Extract the i'th component. */
tree pos = fold_build2 (MULT_EXPR, bitsizetype,
bitsize_int (i), size);
tree elem = fold_build3 (BIT_FIELD_REF, ltype, vec_oprnd,
size, pos);
elem = force_gimple_operand_gsi (gsi, elem, true,
NULL_TREE, true,
GSI_SAME_STMT);
tree this_off = build_int_cst (TREE_TYPE (alias_off),
group_el * elsz);
newref = build2 (MEM_REF, ltype,
running_off, this_off);
/* And store it to *running_off. */
assign = gimple_build_assign (newref, elem);
vect_finish_stmt_generation (stmt, assign, gsi);
group_el += lnel;
if (! slp
|| group_el == group_size)
{
newoff = copy_ssa_name (running_off, NULL);
incr = gimple_build_assign (newoff, POINTER_PLUS_EXPR,
running_off, stride_step);
vect_finish_stmt_generation (stmt, incr, gsi);
running_off = newoff;
group_el = 0;
}
if (g == group_size - 1
&& !slp)
{
if (j == 0 && i == 0)
STMT_VINFO_VEC_STMT (stmt_info)
= *vec_stmt = assign;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = assign;
prev_stmt_info = vinfo_for_stmt (assign);
}
}
}
next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt));
if (slp)
break;
}
vec_oprnds.release ();
return true;
}
auto_vec<tree> dr_chain (group_size);
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
oprnds.create (group_size);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
alignment_support_scheme = vect_supportable_dr_alignment (first_dr, false);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gcc_assert (alignment_support_scheme);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* Targets with store-lane instructions must not require explicit
realignment. */
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
gcc_assert (memory_access_type != VMAT_LOAD_STORE_LANES
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
|| alignment_support_scheme == dr_aligned
|| alignment_support_scheme == dr_unaligned_supported);
if (memory_access_type == VMAT_CONTIGUOUS_DOWN
|| memory_access_type == VMAT_CONTIGUOUS_REVERSE)
offset = size_int (-TYPE_VECTOR_SUBPARTS (vectype) + 1);
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_LOAD_STORE_LANES)
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
aggr_type = build_array_type_nelts (elem_type, vec_num * nunits);
else
aggr_type = vectype;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* In case the vectorization factor (VF) is bigger than the number
of elements that we can fit in a vectype (nunits), we have to generate
more than one vector stmt - i.e - we need to "unroll" the
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
vector stmt by a factor VF/nunits. For more details see documentation in
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vect_get_vec_def_for_copy_stmt. */
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
/* In case of interleaving (non-unit grouped access):
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
S1: &base + 2 = x2
S2: &base = x0
S3: &base + 1 = x1
S4: &base + 3 = x3
We create vectorized stores starting from base address (the access of the
first stmt in the chain (S2 in the above example), when the last store stmt
of the chain (S4) is reached:
VS1: &base = vx2
VS2: &base + vec_size*1 = vx0
VS3: &base + vec_size*2 = vx1
VS4: &base + vec_size*3 = vx3
Then permutation statements are generated:
Delete VEC_INTERLEAVE_*_EXPR. * tree.def (VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): Remove. * gimple-pretty-print.c (dump_binary_rhs): Don't handle VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. * expr.c (expand_expr_real_2): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * fold-const.c (fold_binary_loc): Likewise. * doc/generic.texi (VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): Remove documentation. * optabs.c (optab_for_tree_code): Don't handle VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. (expand_binop, init_optabs): Remove vec_interleave_high_optab and vec_interleave_low_optab. * genopinit.c (optabs): Likewise. * optabs.h (OTI_vec_interleave_high, OTI_vec_interleave_low): Remove. (vec_interleave_high_optab, vec_interleave_low_optab): Remove. * doc/md.texi (vec_interleave_high, vec_interleave_low): Remove documentation. * tree-vect-stmts.c (gen_perm_mask): Renamed to... (vect_gen_perm_mask): ... this. No longer static. (perm_mask_for_reverse, vectorizable_load): Adjust callers. * tree-vectorizer.h (vect_gen_perm_mask): New prototype. * tree-vect-data-refs.c (vect_strided_store_supported): Don't try VEC_INTERLEAVE_*_EXPR, use can_vec_perm_p instead of can_vec_perm_for_code_p. (vect_permute_store_chain): Generate VEC_PERM_EXPR with interleaving masks instead of VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. * config/i386/i386.c (expand_vec_perm_interleave2): If expand_vec_perm_interleave3 would handle it, return false. (expand_vec_perm_broadcast_1): Don't use vec_interleave_*_optab. From-SVN: r182663
2011-12-23 19:38:03 +01:00
VS5: vx5 = VEC_PERM_EXPR < vx0, vx3, {0, 8, 1, 9, 2, 10, 3, 11} >
VS6: vx6 = VEC_PERM_EXPR < vx0, vx3, {4, 12, 5, 13, 6, 14, 7, 15} >
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
...
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
And they are put in STMT_VINFO_VEC_STMT of the corresponding scalar stmts
(the order of the data-refs in the output of vect_permute_store_chain
corresponds to the order of scalar stmts in the interleaving chain - see
the documentation of vect_permute_store_chain()).
In case of both multiple types and interleaving, above vector stores and
permutation stmts are created for every copy. The result vector stmts are
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
put in STMT_VINFO_VEC_STMT for the first copy and in the corresponding
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
STMT_VINFO_RELATED_STMT for the next copies.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
*/
prev_stmt_info = NULL;
for (j = 0; j < ncopies; j++)
{
if (j == 0)
{
if (slp)
{
/* Get vectorized arguments for SLP_NODE. */
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
vect_get_vec_defs (op, NULL_TREE, stmt, &vec_oprnds,
NULL, slp_node, -1);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnd = vec_oprnds[0];
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
else
{
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* For interleaved stores we collect vectorized defs for all the
stores in the group in DR_CHAIN and OPRNDS. DR_CHAIN is then
used as an input to vect_permute_store_chain(), and OPRNDS as
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
an input to vect_get_vec_def_for_stmt_copy() for the next copy.
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
If the store is not grouped, GROUP_SIZE is 1, and DR_CHAIN and
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
OPRNDS are of size 1. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
next_stmt = first_stmt;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
for (i = 0; i < group_size; i++)
{
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Since gaps are not supported for interleaved stores,
GROUP_SIZE is the exact number of stmts in the chain.
Therefore, NEXT_STMT can't be NULL_TREE. In case that
there is no interleaving, GROUP_SIZE is 1, and only one
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
iteration of the loop will be executed. */
gcc_assert (next_stmt
&& gimple_assign_single_p (next_stmt));
op = gimple_assign_rhs1 (next_stmt);
vec_oprnd = vect_get_vec_def_for_operand (op, next_stmt);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
dr_chain.quick_push (vec_oprnd);
oprnds.quick_push (vec_oprnd);
next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
}
/* We should have catched mismatched types earlier. */
gcc_assert (useless_type_conversion_p (vectype,
TREE_TYPE (vec_oprnd)));
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
bool simd_lane_access_p
= STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info);
if (simd_lane_access_p
&& TREE_CODE (DR_BASE_ADDRESS (first_dr)) == ADDR_EXPR
&& VAR_P (TREE_OPERAND (DR_BASE_ADDRESS (first_dr), 0))
&& integer_zerop (DR_OFFSET (first_dr))
&& integer_zerop (DR_INIT (first_dr))
&& alias_sets_conflict_p (get_alias_set (aggr_type),
get_alias_set (TREE_TYPE (ref_type))))
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
{
dataref_ptr = unshare_expr (DR_BASE_ADDRESS (first_dr));
dataref_offset = build_int_cst (ref_type, 0);
inv_p = false;
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
}
else
dataref_ptr
= vect_create_data_ref_ptr (first_stmt, aggr_type,
simd_lane_access_p ? loop : NULL,
offset, &dummy, gsi, &ptr_incr,
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
simd_lane_access_p, &inv_p);
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
gcc_assert (bb_vinfo || !inv_p);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
else
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* For interleaved stores we created vectorized defs for all the
defs stored in OPRNDS in the previous iteration (previous copy).
DR_CHAIN is then used as an input to vect_permute_store_chain(),
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
and OPRNDS as an input to vect_get_vec_def_for_stmt_copy() for the
next copy.
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
If the store is not grouped, GROUP_SIZE is 1, and DR_CHAIN and
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
OPRNDS are of size 1. */
for (i = 0; i < group_size; i++)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
op = oprnds[i];
vect_is_simple_use (op, vinfo, &def_stmt, &dt);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
vec_oprnd = vect_get_vec_def_for_stmt_copy (dt, op);
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
dr_chain[i] = vec_oprnd;
oprnds[i] = vec_oprnd;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
if (dataref_offset)
dataref_offset
= int_const_binop (PLUS_EXPR, dataref_offset,
TYPE_SIZE_UNIT (aggr_type));
else
dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
TYPE_SIZE_UNIT (aggr_type));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_LOAD_STORE_LANES)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
tree vec_array;
2011-04-20 11:25:42 +02:00
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* Combine all the vectors into an array. */
vec_array = create_vector_array (vectype, vec_num);
for (i = 0; i < vec_num; i++)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnd = dr_chain[i];
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
write_vector_array (stmt, gsi, vec_oprnd, vec_array, i);
2011-04-20 11:25:42 +02:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* Emit:
MEM_REF[...all elements...] = STORE_LANES (VEC_ARRAY). */
data_ref = create_array_ref (aggr_type, dataref_ptr, ref_type);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
new_stmt = gimple_build_call_internal (IFN_STORE_LANES, 1, vec_array);
gimple_call_set_lhs (new_stmt, data_ref);
2011-04-20 11:25:42 +02:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
}
else
{
new_stmt = NULL;
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
if (grouped_store)
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
{
if (j == 0)
result_chain.create (group_size);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* Permute. */
vect_permute_store_chain (dr_chain, group_size, stmt, gsi,
&result_chain);
}
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
next_stmt = first_stmt;
for (i = 0; i < vec_num; i++)
{
builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte... 2012-05-03 Martin Jambor <mjambor@suse.cz> * builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_pointer_alignment_1 for dereference alignment. (get_pointer_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_ptr_info_alignment to get SSA name alignment. (get_object_alignment): Update call to get_object_alignment_1. (get_object_or_type_alignment): Likewise, fall back to type alignment only when it returned false. (get_pointer_alignment): Update call to get_pointer_alignment_1. * fold-const.c (get_pointer_modulus_and_residue): Update call to get_object_alignment_1. * ipa-prop.c (ipa_modify_call_arguments): Update call to get_pointer_alignment_1. * tree-sra.c (build_ref_for_offset): Likewise, fall back to the type of MEM_REF or TARGET_MEM_REF only when it returns false. * tree-ssa-ccp.c (get_value_from_alignment): Update call to get_object_alignment_1. (ccp_finalize): Use set_ptr_info_alignment. * tree.h (get_object_alignment_1): Update declaration. (get_pointer_alignment_1): Likewise. * gimple-pretty-print.c (dump_gimple_phi): Use get_ptr_info_alignment. (dump_gimple_stmt): Likewise. * tree-flow.h (ptr_info_def): Updated comments of fields align and misalign. (get_ptr_info_alignment): Declared. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. * tree-ssa-address.c (copy_ref_info): Use new access functions to get and set alignment of SSA names. * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Call mark_ptr_info_alignment_unknown. * tree-ssanames.c (get_ptr_info_alignment): New function. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. (get_ptr_info): Call mark_ptr_info_alignment_unknown. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Likewise. (bump_vector_ptr): Likewise. * tree-vect-stmts.c (create_array_ref): Use set_ptr_info_alignment. (vectorizable_store): Likewise. (vectorizable_load): Likewise. From-SVN: r187101
2012-05-03 17:48:56 +02:00
unsigned align, misalign;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
if (i > 0)
/* Bump the vector pointer. */
dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi,
stmt, NULL_TREE);
if (slp)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnd = vec_oprnds[i];
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
else if (grouped_store)
/* For grouped stores vectorized defs are interleaved in
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
vect_permute_store_chain(). */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnd = result_chain[i];
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
data_ref = fold_build2 (MEM_REF, vectype,
dataref_ptr,
dataref_offset
? dataref_offset
: build_int_cst (ref_type, 0));
builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte... 2012-05-03 Martin Jambor <mjambor@suse.cz> * builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_pointer_alignment_1 for dereference alignment. (get_pointer_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_ptr_info_alignment to get SSA name alignment. (get_object_alignment): Update call to get_object_alignment_1. (get_object_or_type_alignment): Likewise, fall back to type alignment only when it returned false. (get_pointer_alignment): Update call to get_pointer_alignment_1. * fold-const.c (get_pointer_modulus_and_residue): Update call to get_object_alignment_1. * ipa-prop.c (ipa_modify_call_arguments): Update call to get_pointer_alignment_1. * tree-sra.c (build_ref_for_offset): Likewise, fall back to the type of MEM_REF or TARGET_MEM_REF only when it returns false. * tree-ssa-ccp.c (get_value_from_alignment): Update call to get_object_alignment_1. (ccp_finalize): Use set_ptr_info_alignment. * tree.h (get_object_alignment_1): Update declaration. (get_pointer_alignment_1): Likewise. * gimple-pretty-print.c (dump_gimple_phi): Use get_ptr_info_alignment. (dump_gimple_stmt): Likewise. * tree-flow.h (ptr_info_def): Updated comments of fields align and misalign. (get_ptr_info_alignment): Declared. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. * tree-ssa-address.c (copy_ref_info): Use new access functions to get and set alignment of SSA names. * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Call mark_ptr_info_alignment_unknown. * tree-ssanames.c (get_ptr_info_alignment): New function. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. (get_ptr_info): Call mark_ptr_info_alignment_unknown. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Likewise. (bump_vector_ptr): Likewise. * tree-vect-stmts.c (create_array_ref): Use set_ptr_info_alignment. (vectorizable_store): Likewise. (vectorizable_load): Likewise. From-SVN: r187101
2012-05-03 17:48:56 +02:00
align = TYPE_ALIGN_UNIT (vectype);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
if (aligned_access_p (first_dr))
builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte... 2012-05-03 Martin Jambor <mjambor@suse.cz> * builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_pointer_alignment_1 for dereference alignment. (get_pointer_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_ptr_info_alignment to get SSA name alignment. (get_object_alignment): Update call to get_object_alignment_1. (get_object_or_type_alignment): Likewise, fall back to type alignment only when it returned false. (get_pointer_alignment): Update call to get_pointer_alignment_1. * fold-const.c (get_pointer_modulus_and_residue): Update call to get_object_alignment_1. * ipa-prop.c (ipa_modify_call_arguments): Update call to get_pointer_alignment_1. * tree-sra.c (build_ref_for_offset): Likewise, fall back to the type of MEM_REF or TARGET_MEM_REF only when it returns false. * tree-ssa-ccp.c (get_value_from_alignment): Update call to get_object_alignment_1. (ccp_finalize): Use set_ptr_info_alignment. * tree.h (get_object_alignment_1): Update declaration. (get_pointer_alignment_1): Likewise. * gimple-pretty-print.c (dump_gimple_phi): Use get_ptr_info_alignment. (dump_gimple_stmt): Likewise. * tree-flow.h (ptr_info_def): Updated comments of fields align and misalign. (get_ptr_info_alignment): Declared. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. * tree-ssa-address.c (copy_ref_info): Use new access functions to get and set alignment of SSA names. * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Call mark_ptr_info_alignment_unknown. * tree-ssanames.c (get_ptr_info_alignment): New function. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. (get_ptr_info): Call mark_ptr_info_alignment_unknown. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Likewise. (bump_vector_ptr): Likewise. * tree-vect-stmts.c (create_array_ref): Use set_ptr_info_alignment. (vectorizable_store): Likewise. (vectorizable_load): Likewise. From-SVN: r187101
2012-05-03 17:48:56 +02:00
misalign = 0;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
else if (DR_MISALIGNMENT (first_dr) == -1)
{
if (DR_VECT_AUX (first_dr)->base_element_aligned)
align = TYPE_ALIGN_UNIT (elem_type);
else
align = get_object_alignment (DR_REF (first_dr))
/ BITS_PER_UNIT;
misalign = 0;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
TREE_TYPE (data_ref)
= build_aligned_type (TREE_TYPE (data_ref),
align * BITS_PER_UNIT);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
}
else
{
TREE_TYPE (data_ref)
= build_aligned_type (TREE_TYPE (data_ref),
TYPE_ALIGN (elem_type));
builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte... 2012-05-03 Martin Jambor <mjambor@suse.cz> * builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_pointer_alignment_1 for dereference alignment. (get_pointer_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_ptr_info_alignment to get SSA name alignment. (get_object_alignment): Update call to get_object_alignment_1. (get_object_or_type_alignment): Likewise, fall back to type alignment only when it returned false. (get_pointer_alignment): Update call to get_pointer_alignment_1. * fold-const.c (get_pointer_modulus_and_residue): Update call to get_object_alignment_1. * ipa-prop.c (ipa_modify_call_arguments): Update call to get_pointer_alignment_1. * tree-sra.c (build_ref_for_offset): Likewise, fall back to the type of MEM_REF or TARGET_MEM_REF only when it returns false. * tree-ssa-ccp.c (get_value_from_alignment): Update call to get_object_alignment_1. (ccp_finalize): Use set_ptr_info_alignment. * tree.h (get_object_alignment_1): Update declaration. (get_pointer_alignment_1): Likewise. * gimple-pretty-print.c (dump_gimple_phi): Use get_ptr_info_alignment. (dump_gimple_stmt): Likewise. * tree-flow.h (ptr_info_def): Updated comments of fields align and misalign. (get_ptr_info_alignment): Declared. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. * tree-ssa-address.c (copy_ref_info): Use new access functions to get and set alignment of SSA names. * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Call mark_ptr_info_alignment_unknown. * tree-ssanames.c (get_ptr_info_alignment): New function. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. (get_ptr_info): Call mark_ptr_info_alignment_unknown. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Likewise. (bump_vector_ptr): Likewise. * tree-vect-stmts.c (create_array_ref): Use set_ptr_info_alignment. (vectorizable_store): Likewise. (vectorizable_load): Likewise. From-SVN: r187101
2012-05-03 17:48:56 +02:00
misalign = DR_MISALIGNMENT (first_dr);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
}
if (dataref_offset == NULL_TREE
&& TREE_CODE (dataref_ptr) == SSA_NAME)
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
set_ptr_info_alignment (get_ptr_info (dataref_ptr), align,
misalign);
if (memory_access_type == VMAT_CONTIGUOUS_REVERSE)
{
tree perm_mask = perm_mask_for_reverse (vectype);
tree perm_dest
= vect_create_destination_var (gimple_assign_rhs1 (stmt),
vectype);
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
tree new_temp = make_ssa_name (perm_dest);
/* Generate the permute statement. */
gimple *perm_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
= gimple_build_assign (new_temp, VEC_PERM_EXPR, vec_oprnd,
vec_oprnd, perm_mask);
vect_finish_stmt_generation (stmt, perm_stmt, gsi);
perm_stmt = SSA_NAME_DEF_STMT (new_temp);
vec_oprnd = new_temp;
}
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* Arguments are ready. Create the new vector stmt. */
new_stmt = gimple_build_assign (data_ref, vec_oprnd);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (slp)
continue;
next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt));
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
if (!next_stmt)
break;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
if (!slp)
{
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
oprnds.release ();
result_chain.release ();
vec_oprnds.release ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
/* Given a vector type VECTYPE, turns permutation SEL into the equivalent
VECTOR_CST mask. No checks are made that the target platform supports the
mask, so callers may wish to test can_vec_perm_p separately, or use
vect_gen_perm_mask_checked. */
Delete VEC_INTERLEAVE_*_EXPR. * tree.def (VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): Remove. * gimple-pretty-print.c (dump_binary_rhs): Don't handle VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. * expr.c (expand_expr_real_2): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * fold-const.c (fold_binary_loc): Likewise. * doc/generic.texi (VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): Remove documentation. * optabs.c (optab_for_tree_code): Don't handle VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. (expand_binop, init_optabs): Remove vec_interleave_high_optab and vec_interleave_low_optab. * genopinit.c (optabs): Likewise. * optabs.h (OTI_vec_interleave_high, OTI_vec_interleave_low): Remove. (vec_interleave_high_optab, vec_interleave_low_optab): Remove. * doc/md.texi (vec_interleave_high, vec_interleave_low): Remove documentation. * tree-vect-stmts.c (gen_perm_mask): Renamed to... (vect_gen_perm_mask): ... this. No longer static. (perm_mask_for_reverse, vectorizable_load): Adjust callers. * tree-vectorizer.h (vect_gen_perm_mask): New prototype. * tree-vect-data-refs.c (vect_strided_store_supported): Don't try VEC_INTERLEAVE_*_EXPR, use can_vec_perm_p instead of can_vec_perm_for_code_p. (vect_permute_store_chain): Generate VEC_PERM_EXPR with interleaving masks instead of VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR. * config/i386/i386.c (expand_vec_perm_interleave2): If expand_vec_perm_interleave3 would handle it, return false. (expand_vec_perm_broadcast_1): Don't use vec_interleave_*_optab. From-SVN: r182663
2011-12-23 19:38:03 +01:00
tree
vect_gen_perm_mask_any (tree vectype, const unsigned char *sel)
{
tree.h (TREE_VECTOR_CST_ELTS): Remove. 2012-03-16 Richard Guenther <rguenther@suse.de> * tree.h (TREE_VECTOR_CST_ELTS): Remove. (VECTOR_CST_NELTS, VECTOR_CST_ELTS, VECTOR_CST_ELT): New defines. (struct tree_vector): Remove elements member, add variable size elts array member. (build_vector_stat): Declare. (build_vector): Define in terms of build_vector_stat. * tree.c (build_vector): Rename to ... (build_vector_stat): ... this. Take array of trees as parameter. (build_vector_from_ctor): Adjust. (integer_zerop, integer_onep, integer_all_onesp, iterative_hash_expr, initializer_zerop): Adjust. * cfgexpand.c (expand_debug_expr): Likewise. * expr.c (categorize_ctor_elements_1, expand_expr_real_1, const_vector_from_tree): Likewise. * fold-const.c (const_binop, operand_equal_p, native_encode_vector, native_interpret_vector, fold_unary_loc, vec_cst_ctor_to_array, fold_vec_perm, fold_binary_loc, fold_ternary_loc): Likewise. * tree-streamer-in.c (streamer_alloc_tree): Handle TS_VECTOR. (lto_input_ts_vector_tree_pointers): Adjust. * tree-streamer-out.c (streamer_write_tree_header): Handle TS_VECTOR. (write_ts_vector_tree_pointers): Adjust. * varasm.c (const_hash_1, compare_constant, copy_constant, output_constant): Adjust. * gimple-fold.c (gimple_fold_stmt_to_constant_1): Adjust. * print-tree.c (print_node): Adjust. * tree-pretty-print.c (dump_generic_node): Adjust. * tree-vect-generic.c (uniform_vector_p, vector_element, lower_vec_perm): Adjust. * tree-vect-loop.c (get_initial_def_for_reduction): Adjust. * tree-vect-slp.c (vect_get_constant_vectors, vect_transform_slp_perm_load): Adjust. * tree-vect-stmts.c (vect_gen_perm_mask): Adjust. * expmed.c (make_tree): Adjust. * config/i386/i386.c (ix86_expand_builtin): Adjust. * config/sparc/sparc.c (sparc_handle_vis_mul8x16): Adjust interface and implementation. (sparc_fold_builtin): Adjust. c-family/ * c-pretty-print.c (pp_c_initializer_list): Adjust. From-SVN: r185458
2012-03-16 10:47:09 +01:00
tree mask_elt_type, mask_type, mask_vec, *mask_elts;
int i, nunits;
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
nunits = TYPE_VECTOR_SUBPARTS (vectype);
mask_elt_type = lang_hooks.types.type_for_mode
(int_mode_for_mode (TYPE_MODE (TREE_TYPE (vectype))), 1);
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
mask_type = get_vectype_for_scalar_type (mask_elt_type);
tree.h (TREE_VECTOR_CST_ELTS): Remove. 2012-03-16 Richard Guenther <rguenther@suse.de> * tree.h (TREE_VECTOR_CST_ELTS): Remove. (VECTOR_CST_NELTS, VECTOR_CST_ELTS, VECTOR_CST_ELT): New defines. (struct tree_vector): Remove elements member, add variable size elts array member. (build_vector_stat): Declare. (build_vector): Define in terms of build_vector_stat. * tree.c (build_vector): Rename to ... (build_vector_stat): ... this. Take array of trees as parameter. (build_vector_from_ctor): Adjust. (integer_zerop, integer_onep, integer_all_onesp, iterative_hash_expr, initializer_zerop): Adjust. * cfgexpand.c (expand_debug_expr): Likewise. * expr.c (categorize_ctor_elements_1, expand_expr_real_1, const_vector_from_tree): Likewise. * fold-const.c (const_binop, operand_equal_p, native_encode_vector, native_interpret_vector, fold_unary_loc, vec_cst_ctor_to_array, fold_vec_perm, fold_binary_loc, fold_ternary_loc): Likewise. * tree-streamer-in.c (streamer_alloc_tree): Handle TS_VECTOR. (lto_input_ts_vector_tree_pointers): Adjust. * tree-streamer-out.c (streamer_write_tree_header): Handle TS_VECTOR. (write_ts_vector_tree_pointers): Adjust. * varasm.c (const_hash_1, compare_constant, copy_constant, output_constant): Adjust. * gimple-fold.c (gimple_fold_stmt_to_constant_1): Adjust. * print-tree.c (print_node): Adjust. * tree-pretty-print.c (dump_generic_node): Adjust. * tree-vect-generic.c (uniform_vector_p, vector_element, lower_vec_perm): Adjust. * tree-vect-loop.c (get_initial_def_for_reduction): Adjust. * tree-vect-slp.c (vect_get_constant_vectors, vect_transform_slp_perm_load): Adjust. * tree-vect-stmts.c (vect_gen_perm_mask): Adjust. * expmed.c (make_tree): Adjust. * config/i386/i386.c (ix86_expand_builtin): Adjust. * config/sparc/sparc.c (sparc_handle_vis_mul8x16): Adjust interface and implementation. (sparc_fold_builtin): Adjust. c-family/ * c-pretty-print.c (pp_c_initializer_list): Adjust. From-SVN: r185458
2012-03-16 10:47:09 +01:00
mask_elts = XALLOCAVEC (tree, nunits);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
for (i = nunits - 1; i >= 0; i--)
tree.h (TREE_VECTOR_CST_ELTS): Remove. 2012-03-16 Richard Guenther <rguenther@suse.de> * tree.h (TREE_VECTOR_CST_ELTS): Remove. (VECTOR_CST_NELTS, VECTOR_CST_ELTS, VECTOR_CST_ELT): New defines. (struct tree_vector): Remove elements member, add variable size elts array member. (build_vector_stat): Declare. (build_vector): Define in terms of build_vector_stat. * tree.c (build_vector): Rename to ... (build_vector_stat): ... this. Take array of trees as parameter. (build_vector_from_ctor): Adjust. (integer_zerop, integer_onep, integer_all_onesp, iterative_hash_expr, initializer_zerop): Adjust. * cfgexpand.c (expand_debug_expr): Likewise. * expr.c (categorize_ctor_elements_1, expand_expr_real_1, const_vector_from_tree): Likewise. * fold-const.c (const_binop, operand_equal_p, native_encode_vector, native_interpret_vector, fold_unary_loc, vec_cst_ctor_to_array, fold_vec_perm, fold_binary_loc, fold_ternary_loc): Likewise. * tree-streamer-in.c (streamer_alloc_tree): Handle TS_VECTOR. (lto_input_ts_vector_tree_pointers): Adjust. * tree-streamer-out.c (streamer_write_tree_header): Handle TS_VECTOR. (write_ts_vector_tree_pointers): Adjust. * varasm.c (const_hash_1, compare_constant, copy_constant, output_constant): Adjust. * gimple-fold.c (gimple_fold_stmt_to_constant_1): Adjust. * print-tree.c (print_node): Adjust. * tree-pretty-print.c (dump_generic_node): Adjust. * tree-vect-generic.c (uniform_vector_p, vector_element, lower_vec_perm): Adjust. * tree-vect-loop.c (get_initial_def_for_reduction): Adjust. * tree-vect-slp.c (vect_get_constant_vectors, vect_transform_slp_perm_load): Adjust. * tree-vect-stmts.c (vect_gen_perm_mask): Adjust. * expmed.c (make_tree): Adjust. * config/i386/i386.c (ix86_expand_builtin): Adjust. * config/sparc/sparc.c (sparc_handle_vis_mul8x16): Adjust interface and implementation. (sparc_fold_builtin): Adjust. c-family/ * c-pretty-print.c (pp_c_initializer_list): Adjust. From-SVN: r185458
2012-03-16 10:47:09 +01:00
mask_elts[i] = build_int_cst (mask_elt_type, sel[i]);
mask_vec = build_vector (mask_type, mask_elts);
return mask_vec;
}
/* Checked version of vect_gen_perm_mask_any. Asserts can_vec_perm_p,
i.e. that the target supports the pattern _for arbitrary input vectors_. */
tree
vect_gen_perm_mask_checked (tree vectype, const unsigned char *sel)
{
gcc_assert (can_vec_perm_p (TYPE_MODE (vectype), false, sel));
return vect_gen_perm_mask_any (vectype, sel);
}
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
/* Given a vector variable X and Y, that was generated for the scalar
STMT, generate instructions to permute the vector elements of X and Y
using permutation mask MASK_VEC, insert them at *GSI and return the
permuted vector variable. */
static tree
permute_vec_elements (tree x, tree y, tree mask_vec, gimple *stmt,
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
gimple_stmt_iterator *gsi)
{
tree vectype = TREE_TYPE (x);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
tree perm_dest, data_ref;
gimple *perm_stmt;
perm_dest = vect_create_destination_var (gimple_get_lhs (stmt), vectype);
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
data_ref = make_ssa_name (perm_dest);
/* Generate the permute statement. */
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
perm_stmt = gimple_build_assign (data_ref, VEC_PERM_EXPR, x, y, mask_vec);
vect_finish_stmt_generation (stmt, perm_stmt, gsi);
return data_ref;
}
/* Hoist the definitions of all SSA uses on STMT out of the loop LOOP,
inserting them on the loops preheader edge. Returns true if we
were successful in doing so (and thus STMT can be moved then),
otherwise returns false. */
static bool
hoist_defs_of_uses (gimple *stmt, struct loop *loop)
{
ssa_op_iter i;
tree op;
bool any = false;
FOR_EACH_SSA_TREE_OPERAND (op, stmt, i, SSA_OP_USE)
{
gimple *def_stmt = SSA_NAME_DEF_STMT (op);
if (!gimple_nop_p (def_stmt)
&& flow_bb_inside_loop_p (loop, gimple_bb (def_stmt)))
{
/* Make sure we don't need to recurse. While we could do
so in simple cases when there are more complex use webs
we don't have an easy way to preserve stmt order to fulfil
dependencies within them. */
tree op2;
ssa_op_iter i2;
if (gimple_code (def_stmt) == GIMPLE_PHI)
return false;
FOR_EACH_SSA_TREE_OPERAND (op2, def_stmt, i2, SSA_OP_USE)
{
gimple *def_stmt2 = SSA_NAME_DEF_STMT (op2);
if (!gimple_nop_p (def_stmt2)
&& flow_bb_inside_loop_p (loop, gimple_bb (def_stmt2)))
return false;
}
any = true;
}
}
if (!any)
return true;
FOR_EACH_SSA_TREE_OPERAND (op, stmt, i, SSA_OP_USE)
{
gimple *def_stmt = SSA_NAME_DEF_STMT (op);
if (!gimple_nop_p (def_stmt)
&& flow_bb_inside_loop_p (loop, gimple_bb (def_stmt)))
{
gimple_stmt_iterator gsi = gsi_for_stmt (def_stmt);
gsi_remove (&gsi, false);
gsi_insert_on_edge_immediate (loop_preheader_edge (loop), def_stmt);
}
}
return true;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* vectorizable_load.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
Check if STMT reads a non scalar data-ref (array/pointer/structure) that
can be vectorized.
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt to replace it, put it in VEC_STMT, and insert it at BSI.
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
static bool
vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
slp_tree slp_node, slp_instance slp_node_instance)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree scalar_dest;
tree vec_dest = NULL;
tree data_ref = NULL;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
stmt_vec_info prev_stmt_info;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
struct loop *loop = NULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
struct loop *containing_loop = (gimple_bb (stmt))->loop_father;
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
bool nested_in_vect_loop = false;
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info), *first_dr = NULL;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
tree elem_type;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree new_temp;
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 *new_stmt = NULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree dummy;
enum dr_alignment_support alignment_support_scheme;
tree dataref_ptr = NULL_TREE;
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
tree dataref_offset = NULL_TREE;
gimple *ptr_incr = NULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
int ncopies;
int i, j, group_size, group_gap_adj;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree msq = NULL_TREE, lsq;
tree offset = NULL_TREE;
tree byte_offset = NULL_TREE;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree realignment_token = NULL_TREE;
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 = NULL;
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
vec<tree> dr_chain = vNULL;
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
bool grouped_load = false;
gimple *first_stmt;
gimple *first_stmt_for_drptr = NULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
bool inv_p;
bool compute_in_loop = false;
struct loop *at_loop;
int vec_num;
bool slp = (slp_node != NULL);
bool slp_perm = false;
enum tree_code code;
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
int vf;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
tree aggr_type;
gather_scatter_info gs_info;
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
vec_info *vinfo = stmt_info->vinfo;
tree ref_type;
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& ! vec_stmt)
return false;
/* Is vectorizable load? */
if (!is_gimple_assign (stmt))
return false;
scalar_dest = gimple_assign_lhs (stmt);
if (TREE_CODE (scalar_dest) != SSA_NAME)
return false;
code = gimple_assign_rhs_code (stmt);
if (code != ARRAY_REF
&& code != BIT_FIELD_REF
&& code != INDIRECT_REF
&& code != COMPONENT_REF
&& code != IMAGPART_EXPR
&& code != REALPART_EXPR
&& code != MEM_REF
&& TREE_CODE_CLASS (code) != tcc_declaration)
return false;
if (!STMT_VINFO_DATA_REF (stmt_info))
return false;
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
if (loop_vinfo)
{
loop = LOOP_VINFO_LOOP (loop_vinfo);
nested_in_vect_loop = nested_in_vect_loop_p (loop, stmt);
vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
}
else
vf = 1;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Multiple types in SLP are handled by creating the appropriate number of
vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
case of SLP. */
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
if (slp)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
ncopies = 1;
else
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
/* FORNOW. This restriction should be relaxed. */
if (nested_in_vect_loop && ncopies > 1)
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"multiple types in nested loop.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
/* Invalidate assumptions made by dependence analysis when vectorization
on the unrolled body effectively re-orders stmts. */
if (ncopies > 1
&& STMT_VINFO_MIN_NEG_DIST (stmt_info) != 0
&& ((unsigned)LOOP_VINFO_VECT_FACTOR (loop_vinfo)
> STMT_VINFO_MIN_NEG_DIST (stmt_info)))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"cannot perform implicit CSE when unrolling "
"with negative dependence distance\n");
return false;
}
elem_type = TREE_TYPE (vectype);
mode = TYPE_MODE (vectype);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* FORNOW. In some cases can vectorize even if data-type not supported
(e.g. - data copies). */
if (optab_handler (mov_optab, mode) == CODE_FOR_nothing)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"Aligned load, but unsupported type.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
/* Check if the load is a part of an interleaving chain. */
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
if (STMT_VINFO_GROUPED_ACCESS (stmt_info))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
grouped_load = true;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* FORNOW */
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
gcc_assert (!nested_in_vect_loop);
gcc_assert (!STMT_VINFO_GATHER_SCATTER_P (stmt_info));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
if (slp && SLP_TREE_LOAD_PERMUTATION (slp_node).exists ())
slp_perm = true;
/* Invalidate assumptions made by dependence analysis when vectorization
on the unrolled body effectively re-orders stmts. */
if (!PURE_SLP_STMT (stmt_info)
&& STMT_VINFO_MIN_NEG_DIST (stmt_info) != 0
&& ((unsigned)LOOP_VINFO_VECT_FACTOR (loop_vinfo)
> STMT_VINFO_MIN_NEG_DIST (stmt_info)))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"cannot perform implicit CSE when performing "
"group loads with negative dependence distance\n");
return false;
}
/* Similarly when the stmt is a load that is both part of a SLP
instance and a loop vectorized stmt via the same-dr mechanism
we have to give up. */
if (STMT_VINFO_GROUP_SAME_DR_STMT (stmt_info)
&& (STMT_SLP_TYPE (stmt_info)
!= STMT_SLP_TYPE (vinfo_for_stmt
(STMT_VINFO_GROUP_SAME_DR_STMT (stmt_info)))))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"conflicting SLP types for CSEd load\n");
return false;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vect_memory_access_type memory_access_type;
if (!get_load_store_type (stmt, vectype, slp, VLS_LOAD, ncopies,
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
&memory_access_type, &gs_info))
return false;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (!vec_stmt) /* transformation not required. */
{
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (!slp)
STMT_VINFO_MEMORY_ACCESS_TYPE (stmt_info) = memory_access_type;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
STMT_VINFO_TYPE (stmt_info) = load_vec_info_type;
/* The SLP costs are calculated during SLP analysis. */
if (!PURE_SLP_STMT (stmt_info))
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
vect_model_load_cost (stmt_info, ncopies, memory_access_type,
NULL, NULL, NULL);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (!slp)
gcc_assert (memory_access_type
== STMT_VINFO_MEMORY_ACCESS_TYPE (stmt_info));
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"transform load. ncopies = %d\n", ncopies);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/** Transform. **/
ensure_base_align (stmt_info, dr);
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_GATHER_SCATTER)
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
{
tree vec_oprnd0 = NULL_TREE, op;
tree arglist = TYPE_ARG_TYPES (TREE_TYPE (gs_info.decl));
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
tree rettype, srctype, ptrtype, idxtype, masktype, scaletype;
i386.c (MAX_CLASSES): Increase number of classes. gcc/ * config/i386/i386.c (MAX_CLASSES): Increase number of classes. (classify_argument): Extend for 512 bit vectors. (construct_container): Ditto. (function_arg_advance_32): Ditto. (function_arg_advance_64): Ditto. (function_arg_32): Ditto. (function_arg_64): Ditto. (function_value_32): Ditto. (return_in_memory_32): Ditto. (ix86_gimplify_va_arg): Ditto. (standard_sse_constant_p): Ditto. (standard_sse_constant_opcode): Ditto. (ix86_expand_vector_convert_uns_vsivsf): Ditto. (ix86_build_const_vector): Ditto. (ix86_build_signbit_mask): Ditto. (ix86_expand_sse_cmp): Extend for AVX512. (ix86_expand_sse_movcc): Ditto. (ix86_expand_int_vcond): Ditto. (ix86_expand_vec_perm): Ditto. (ix86_expand_sse_unpack): Ditto. (ix86_constant_alignment): Ditto. (ix86_builtin_vectorized_function): Ditto. (ix86_vectorize_builtin_gather): Ditto. (avx_vpermilp_parallel): Ditto. (ix86_rtx_costs): Ditto. (ix86_expand_vector_init_duplicate): Ditto. (ix86_expand_vector_init_concat): Ditto. (ix86_expand_vector_init_general): Ditto. (ix86_expand_vector_extract): Ditto. (emit_reduc_half): Ditto. (ix86_vector_mode_supported_p): Ditto. (ix86_emit_swdivsf): Ditto. (ix86_emit_swsqrtsf): Ditto. (expand_vec_perm_1): Ditto. (ix86_vectorize_vec_perm_const_ok): Ditto. (ix86_expand_mul_widen_evenodd): Ditto. (ix86_expand_sse2_mulvxdi3): Ditto. (ix86_preferred_simd_mode): Ditto. (ix86_autovectorize_vector_sizes): Ditto. (ix86_expand_vec_perm_vpermi2): New. (ix86_vector_duplicate_value): Ditto. (IX86_BUILTIN_SQRTPD512, IX86_BUILTIN_EXP2PS, IX86_BUILTIN_SQRTPS_NR512, IX86_BUILTIN_GATHER3ALTDIV16SF, IX86_BUILTIN_GATHER3ALTDIV16SI, IX86_BUILTIN_GATHER3ALTSIV8DF, IX86_BUILTIN_GATHER3ALTSIV8DI, IX86_BUILTIN_GATHER3DIV16SF, IX86_BUILTIN_GATHER3DIV16SI, IX86_BUILTIN_GATHER3DIV8DF, IX86_BUILTIN_GATHER3DIV8DI, IX86_BUILTIN_GATHER3SIV16SF, IX86_BUILTIN_GATHER3SIV16SI, IX86_BUILTIN_GATHER3SIV8DF, IX86_BUILTIN_CEILPD_VEC_PACK_SFIX512, IX86_BUILTIN_CPYSGNPS512, IX86_BUILTIN_CPYSGNPD512, IX86_BUILTIN_FLOORPD_VEC_PACK_SFIX512, IX86_BUILTIN_ROUNDPD_AZ_VEC_PACK_SFIX512): Ditto. * config/i386/sse.md (*mov<mode>_internal): Disable SSE typeless stores vectors > 128bit (AVX*). (<sse>_storeu<ssemodesuffix><avxsizesuffix>): Ditto. (<sse2_avx_avx512f>_storedqu<mode>): Extend for AVX-512, disable SSE typeless stores vectors > 128bit (AVX*). (fixuns_trunc<mode><sseintvecmodelower>2): Extend for AVX-512. (vec_pack_ufix_trunc_<mode>): Ditto. (vec_unpacku_float_hi_v16si): New. * tree-vect-stmts.c (vectorizable_load): Support AVX512's gathers. * tree-vectorizer.h (MAX_VECTORIZATION_FACTOR): Extend for 512 bit vectors. testsuite/ * gcc.target/i386/pr49002-2.c: allow vmovapd generation. Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com> Co-Authored-By: Anna Tikhonova <anna.tikhonova@intel.com> Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com> Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com> Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Maxim Kuznetsov <maxim.kuznetsov@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> Co-Authored-By: Sergey Lega <sergey.s.lega@intel.com> From-SVN: r206260
2013-12-31 12:09:42 +01:00
tree ptr, mask, var, scale, merge, perm_mask = NULL_TREE, prev_res = NULL_TREE;
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
edge pe = loop_preheader_edge (loop);
gimple_seq seq;
basic_block new_bb;
enum { NARROW, NONE, WIDEN } modifier;
int gather_off_nunits = TYPE_VECTOR_SUBPARTS (gs_info.offset_vectype);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
if (nunits == gather_off_nunits)
modifier = NONE;
else if (nunits == gather_off_nunits / 2)
{
unsigned char *sel = XALLOCAVEC (unsigned char, gather_off_nunits);
modifier = WIDEN;
for (i = 0; i < gather_off_nunits; ++i)
sel[i] = i | nunits;
perm_mask = vect_gen_perm_mask_checked (gs_info.offset_vectype, sel);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
}
else if (nunits == gather_off_nunits * 2)
{
unsigned char *sel = XALLOCAVEC (unsigned char, nunits);
modifier = NARROW;
for (i = 0; i < nunits; ++i)
sel[i] = i < gather_off_nunits
? i : i + nunits - gather_off_nunits;
perm_mask = vect_gen_perm_mask_checked (vectype, sel);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
ncopies *= 2;
}
else
gcc_unreachable ();
rettype = TREE_TYPE (TREE_TYPE (gs_info.decl));
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
srctype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
ptrtype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
idxtype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
masktype = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
scaletype = TREE_VALUE (arglist);
i386.c (MAX_CLASSES): Increase number of classes. gcc/ * config/i386/i386.c (MAX_CLASSES): Increase number of classes. (classify_argument): Extend for 512 bit vectors. (construct_container): Ditto. (function_arg_advance_32): Ditto. (function_arg_advance_64): Ditto. (function_arg_32): Ditto. (function_arg_64): Ditto. (function_value_32): Ditto. (return_in_memory_32): Ditto. (ix86_gimplify_va_arg): Ditto. (standard_sse_constant_p): Ditto. (standard_sse_constant_opcode): Ditto. (ix86_expand_vector_convert_uns_vsivsf): Ditto. (ix86_build_const_vector): Ditto. (ix86_build_signbit_mask): Ditto. (ix86_expand_sse_cmp): Extend for AVX512. (ix86_expand_sse_movcc): Ditto. (ix86_expand_int_vcond): Ditto. (ix86_expand_vec_perm): Ditto. (ix86_expand_sse_unpack): Ditto. (ix86_constant_alignment): Ditto. (ix86_builtin_vectorized_function): Ditto. (ix86_vectorize_builtin_gather): Ditto. (avx_vpermilp_parallel): Ditto. (ix86_rtx_costs): Ditto. (ix86_expand_vector_init_duplicate): Ditto. (ix86_expand_vector_init_concat): Ditto. (ix86_expand_vector_init_general): Ditto. (ix86_expand_vector_extract): Ditto. (emit_reduc_half): Ditto. (ix86_vector_mode_supported_p): Ditto. (ix86_emit_swdivsf): Ditto. (ix86_emit_swsqrtsf): Ditto. (expand_vec_perm_1): Ditto. (ix86_vectorize_vec_perm_const_ok): Ditto. (ix86_expand_mul_widen_evenodd): Ditto. (ix86_expand_sse2_mulvxdi3): Ditto. (ix86_preferred_simd_mode): Ditto. (ix86_autovectorize_vector_sizes): Ditto. (ix86_expand_vec_perm_vpermi2): New. (ix86_vector_duplicate_value): Ditto. (IX86_BUILTIN_SQRTPD512, IX86_BUILTIN_EXP2PS, IX86_BUILTIN_SQRTPS_NR512, IX86_BUILTIN_GATHER3ALTDIV16SF, IX86_BUILTIN_GATHER3ALTDIV16SI, IX86_BUILTIN_GATHER3ALTSIV8DF, IX86_BUILTIN_GATHER3ALTSIV8DI, IX86_BUILTIN_GATHER3DIV16SF, IX86_BUILTIN_GATHER3DIV16SI, IX86_BUILTIN_GATHER3DIV8DF, IX86_BUILTIN_GATHER3DIV8DI, IX86_BUILTIN_GATHER3SIV16SF, IX86_BUILTIN_GATHER3SIV16SI, IX86_BUILTIN_GATHER3SIV8DF, IX86_BUILTIN_CEILPD_VEC_PACK_SFIX512, IX86_BUILTIN_CPYSGNPS512, IX86_BUILTIN_CPYSGNPD512, IX86_BUILTIN_FLOORPD_VEC_PACK_SFIX512, IX86_BUILTIN_ROUNDPD_AZ_VEC_PACK_SFIX512): Ditto. * config/i386/sse.md (*mov<mode>_internal): Disable SSE typeless stores vectors > 128bit (AVX*). (<sse>_storeu<ssemodesuffix><avxsizesuffix>): Ditto. (<sse2_avx_avx512f>_storedqu<mode>): Extend for AVX-512, disable SSE typeless stores vectors > 128bit (AVX*). (fixuns_trunc<mode><sseintvecmodelower>2): Extend for AVX-512. (vec_pack_ufix_trunc_<mode>): Ditto. (vec_unpacku_float_hi_v16si): New. * tree-vect-stmts.c (vectorizable_load): Support AVX512's gathers. * tree-vectorizer.h (MAX_VECTORIZATION_FACTOR): Extend for 512 bit vectors. testsuite/ * gcc.target/i386/pr49002-2.c: allow vmovapd generation. Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com> Co-Authored-By: Anna Tikhonova <anna.tikhonova@intel.com> Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com> Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com> Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Maxim Kuznetsov <maxim.kuznetsov@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> Co-Authored-By: Sergey Lega <sergey.s.lega@intel.com> From-SVN: r206260
2013-12-31 12:09:42 +01:00
gcc_checking_assert (types_compatible_p (srctype, rettype));
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
vec_dest = vect_create_destination_var (scalar_dest, vectype);
ptr = fold_convert (ptrtype, gs_info.base);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
if (!is_gimple_min_invariant (ptr))
{
ptr = force_gimple_operand (ptr, &seq, true, NULL_TREE);
new_bb = gsi_insert_seq_on_edge_immediate (pe, seq);
gcc_assert (!new_bb);
}
/* Currently we support only unconditional gather loads,
so mask should be all ones. */
i386.c (MAX_CLASSES): Increase number of classes. gcc/ * config/i386/i386.c (MAX_CLASSES): Increase number of classes. (classify_argument): Extend for 512 bit vectors. (construct_container): Ditto. (function_arg_advance_32): Ditto. (function_arg_advance_64): Ditto. (function_arg_32): Ditto. (function_arg_64): Ditto. (function_value_32): Ditto. (return_in_memory_32): Ditto. (ix86_gimplify_va_arg): Ditto. (standard_sse_constant_p): Ditto. (standard_sse_constant_opcode): Ditto. (ix86_expand_vector_convert_uns_vsivsf): Ditto. (ix86_build_const_vector): Ditto. (ix86_build_signbit_mask): Ditto. (ix86_expand_sse_cmp): Extend for AVX512. (ix86_expand_sse_movcc): Ditto. (ix86_expand_int_vcond): Ditto. (ix86_expand_vec_perm): Ditto. (ix86_expand_sse_unpack): Ditto. (ix86_constant_alignment): Ditto. (ix86_builtin_vectorized_function): Ditto. (ix86_vectorize_builtin_gather): Ditto. (avx_vpermilp_parallel): Ditto. (ix86_rtx_costs): Ditto. (ix86_expand_vector_init_duplicate): Ditto. (ix86_expand_vector_init_concat): Ditto. (ix86_expand_vector_init_general): Ditto. (ix86_expand_vector_extract): Ditto. (emit_reduc_half): Ditto. (ix86_vector_mode_supported_p): Ditto. (ix86_emit_swdivsf): Ditto. (ix86_emit_swsqrtsf): Ditto. (expand_vec_perm_1): Ditto. (ix86_vectorize_vec_perm_const_ok): Ditto. (ix86_expand_mul_widen_evenodd): Ditto. (ix86_expand_sse2_mulvxdi3): Ditto. (ix86_preferred_simd_mode): Ditto. (ix86_autovectorize_vector_sizes): Ditto. (ix86_expand_vec_perm_vpermi2): New. (ix86_vector_duplicate_value): Ditto. (IX86_BUILTIN_SQRTPD512, IX86_BUILTIN_EXP2PS, IX86_BUILTIN_SQRTPS_NR512, IX86_BUILTIN_GATHER3ALTDIV16SF, IX86_BUILTIN_GATHER3ALTDIV16SI, IX86_BUILTIN_GATHER3ALTSIV8DF, IX86_BUILTIN_GATHER3ALTSIV8DI, IX86_BUILTIN_GATHER3DIV16SF, IX86_BUILTIN_GATHER3DIV16SI, IX86_BUILTIN_GATHER3DIV8DF, IX86_BUILTIN_GATHER3DIV8DI, IX86_BUILTIN_GATHER3SIV16SF, IX86_BUILTIN_GATHER3SIV16SI, IX86_BUILTIN_GATHER3SIV8DF, IX86_BUILTIN_CEILPD_VEC_PACK_SFIX512, IX86_BUILTIN_CPYSGNPS512, IX86_BUILTIN_CPYSGNPD512, IX86_BUILTIN_FLOORPD_VEC_PACK_SFIX512, IX86_BUILTIN_ROUNDPD_AZ_VEC_PACK_SFIX512): Ditto. * config/i386/sse.md (*mov<mode>_internal): Disable SSE typeless stores vectors > 128bit (AVX*). (<sse>_storeu<ssemodesuffix><avxsizesuffix>): Ditto. (<sse2_avx_avx512f>_storedqu<mode>): Extend for AVX-512, disable SSE typeless stores vectors > 128bit (AVX*). (fixuns_trunc<mode><sseintvecmodelower>2): Extend for AVX-512. (vec_pack_ufix_trunc_<mode>): Ditto. (vec_unpacku_float_hi_v16si): New. * tree-vect-stmts.c (vectorizable_load): Support AVX512's gathers. * tree-vectorizer.h (MAX_VECTORIZATION_FACTOR): Extend for 512 bit vectors. testsuite/ * gcc.target/i386/pr49002-2.c: allow vmovapd generation. Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com> Co-Authored-By: Anna Tikhonova <anna.tikhonova@intel.com> Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com> Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com> Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Maxim Kuznetsov <maxim.kuznetsov@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> Co-Authored-By: Sergey Lega <sergey.s.lega@intel.com> From-SVN: r206260
2013-12-31 12:09:42 +01:00
if (TREE_CODE (masktype) == INTEGER_TYPE)
mask = build_int_cst (masktype, -1);
else if (TREE_CODE (TREE_TYPE (masktype)) == INTEGER_TYPE)
{
mask = build_int_cst (TREE_TYPE (masktype), -1);
mask = build_vector_from_val (masktype, mask);
mask = vect_init_vector (stmt, mask, masktype, NULL);
i386.c (MAX_CLASSES): Increase number of classes. gcc/ * config/i386/i386.c (MAX_CLASSES): Increase number of classes. (classify_argument): Extend for 512 bit vectors. (construct_container): Ditto. (function_arg_advance_32): Ditto. (function_arg_advance_64): Ditto. (function_arg_32): Ditto. (function_arg_64): Ditto. (function_value_32): Ditto. (return_in_memory_32): Ditto. (ix86_gimplify_va_arg): Ditto. (standard_sse_constant_p): Ditto. (standard_sse_constant_opcode): Ditto. (ix86_expand_vector_convert_uns_vsivsf): Ditto. (ix86_build_const_vector): Ditto. (ix86_build_signbit_mask): Ditto. (ix86_expand_sse_cmp): Extend for AVX512. (ix86_expand_sse_movcc): Ditto. (ix86_expand_int_vcond): Ditto. (ix86_expand_vec_perm): Ditto. (ix86_expand_sse_unpack): Ditto. (ix86_constant_alignment): Ditto. (ix86_builtin_vectorized_function): Ditto. (ix86_vectorize_builtin_gather): Ditto. (avx_vpermilp_parallel): Ditto. (ix86_rtx_costs): Ditto. (ix86_expand_vector_init_duplicate): Ditto. (ix86_expand_vector_init_concat): Ditto. (ix86_expand_vector_init_general): Ditto. (ix86_expand_vector_extract): Ditto. (emit_reduc_half): Ditto. (ix86_vector_mode_supported_p): Ditto. (ix86_emit_swdivsf): Ditto. (ix86_emit_swsqrtsf): Ditto. (expand_vec_perm_1): Ditto. (ix86_vectorize_vec_perm_const_ok): Ditto. (ix86_expand_mul_widen_evenodd): Ditto. (ix86_expand_sse2_mulvxdi3): Ditto. (ix86_preferred_simd_mode): Ditto. (ix86_autovectorize_vector_sizes): Ditto. (ix86_expand_vec_perm_vpermi2): New. (ix86_vector_duplicate_value): Ditto. (IX86_BUILTIN_SQRTPD512, IX86_BUILTIN_EXP2PS, IX86_BUILTIN_SQRTPS_NR512, IX86_BUILTIN_GATHER3ALTDIV16SF, IX86_BUILTIN_GATHER3ALTDIV16SI, IX86_BUILTIN_GATHER3ALTSIV8DF, IX86_BUILTIN_GATHER3ALTSIV8DI, IX86_BUILTIN_GATHER3DIV16SF, IX86_BUILTIN_GATHER3DIV16SI, IX86_BUILTIN_GATHER3DIV8DF, IX86_BUILTIN_GATHER3DIV8DI, IX86_BUILTIN_GATHER3SIV16SF, IX86_BUILTIN_GATHER3SIV16SI, IX86_BUILTIN_GATHER3SIV8DF, IX86_BUILTIN_CEILPD_VEC_PACK_SFIX512, IX86_BUILTIN_CPYSGNPS512, IX86_BUILTIN_CPYSGNPD512, IX86_BUILTIN_FLOORPD_VEC_PACK_SFIX512, IX86_BUILTIN_ROUNDPD_AZ_VEC_PACK_SFIX512): Ditto. * config/i386/sse.md (*mov<mode>_internal): Disable SSE typeless stores vectors > 128bit (AVX*). (<sse>_storeu<ssemodesuffix><avxsizesuffix>): Ditto. (<sse2_avx_avx512f>_storedqu<mode>): Extend for AVX-512, disable SSE typeless stores vectors > 128bit (AVX*). (fixuns_trunc<mode><sseintvecmodelower>2): Extend for AVX-512. (vec_pack_ufix_trunc_<mode>): Ditto. (vec_unpacku_float_hi_v16si): New. * tree-vect-stmts.c (vectorizable_load): Support AVX512's gathers. * tree-vectorizer.h (MAX_VECTORIZATION_FACTOR): Extend for 512 bit vectors. testsuite/ * gcc.target/i386/pr49002-2.c: allow vmovapd generation. Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com> Co-Authored-By: Anna Tikhonova <anna.tikhonova@intel.com> Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com> Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com> Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Maxim Kuznetsov <maxim.kuznetsov@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> Co-Authored-By: Sergey Lega <sergey.s.lega@intel.com> From-SVN: r206260
2013-12-31 12:09:42 +01:00
}
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
else if (SCALAR_FLOAT_TYPE_P (TREE_TYPE (masktype)))
{
REAL_VALUE_TYPE r;
long tmp[6];
for (j = 0; j < 6; ++j)
tmp[j] = -1;
real_from_target (&r, tmp, TYPE_MODE (TREE_TYPE (masktype)));
mask = build_real (TREE_TYPE (masktype), r);
i386.c (MAX_CLASSES): Increase number of classes. gcc/ * config/i386/i386.c (MAX_CLASSES): Increase number of classes. (classify_argument): Extend for 512 bit vectors. (construct_container): Ditto. (function_arg_advance_32): Ditto. (function_arg_advance_64): Ditto. (function_arg_32): Ditto. (function_arg_64): Ditto. (function_value_32): Ditto. (return_in_memory_32): Ditto. (ix86_gimplify_va_arg): Ditto. (standard_sse_constant_p): Ditto. (standard_sse_constant_opcode): Ditto. (ix86_expand_vector_convert_uns_vsivsf): Ditto. (ix86_build_const_vector): Ditto. (ix86_build_signbit_mask): Ditto. (ix86_expand_sse_cmp): Extend for AVX512. (ix86_expand_sse_movcc): Ditto. (ix86_expand_int_vcond): Ditto. (ix86_expand_vec_perm): Ditto. (ix86_expand_sse_unpack): Ditto. (ix86_constant_alignment): Ditto. (ix86_builtin_vectorized_function): Ditto. (ix86_vectorize_builtin_gather): Ditto. (avx_vpermilp_parallel): Ditto. (ix86_rtx_costs): Ditto. (ix86_expand_vector_init_duplicate): Ditto. (ix86_expand_vector_init_concat): Ditto. (ix86_expand_vector_init_general): Ditto. (ix86_expand_vector_extract): Ditto. (emit_reduc_half): Ditto. (ix86_vector_mode_supported_p): Ditto. (ix86_emit_swdivsf): Ditto. (ix86_emit_swsqrtsf): Ditto. (expand_vec_perm_1): Ditto. (ix86_vectorize_vec_perm_const_ok): Ditto. (ix86_expand_mul_widen_evenodd): Ditto. (ix86_expand_sse2_mulvxdi3): Ditto. (ix86_preferred_simd_mode): Ditto. (ix86_autovectorize_vector_sizes): Ditto. (ix86_expand_vec_perm_vpermi2): New. (ix86_vector_duplicate_value): Ditto. (IX86_BUILTIN_SQRTPD512, IX86_BUILTIN_EXP2PS, IX86_BUILTIN_SQRTPS_NR512, IX86_BUILTIN_GATHER3ALTDIV16SF, IX86_BUILTIN_GATHER3ALTDIV16SI, IX86_BUILTIN_GATHER3ALTSIV8DF, IX86_BUILTIN_GATHER3ALTSIV8DI, IX86_BUILTIN_GATHER3DIV16SF, IX86_BUILTIN_GATHER3DIV16SI, IX86_BUILTIN_GATHER3DIV8DF, IX86_BUILTIN_GATHER3DIV8DI, IX86_BUILTIN_GATHER3SIV16SF, IX86_BUILTIN_GATHER3SIV16SI, IX86_BUILTIN_GATHER3SIV8DF, IX86_BUILTIN_CEILPD_VEC_PACK_SFIX512, IX86_BUILTIN_CPYSGNPS512, IX86_BUILTIN_CPYSGNPD512, IX86_BUILTIN_FLOORPD_VEC_PACK_SFIX512, IX86_BUILTIN_ROUNDPD_AZ_VEC_PACK_SFIX512): Ditto. * config/i386/sse.md (*mov<mode>_internal): Disable SSE typeless stores vectors > 128bit (AVX*). (<sse>_storeu<ssemodesuffix><avxsizesuffix>): Ditto. (<sse2_avx_avx512f>_storedqu<mode>): Extend for AVX-512, disable SSE typeless stores vectors > 128bit (AVX*). (fixuns_trunc<mode><sseintvecmodelower>2): Extend for AVX-512. (vec_pack_ufix_trunc_<mode>): Ditto. (vec_unpacku_float_hi_v16si): New. * tree-vect-stmts.c (vectorizable_load): Support AVX512's gathers. * tree-vectorizer.h (MAX_VECTORIZATION_FACTOR): Extend for 512 bit vectors. testsuite/ * gcc.target/i386/pr49002-2.c: allow vmovapd generation. Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com> Co-Authored-By: Anna Tikhonova <anna.tikhonova@intel.com> Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com> Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com> Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Maxim Kuznetsov <maxim.kuznetsov@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> Co-Authored-By: Sergey Lega <sergey.s.lega@intel.com> From-SVN: r206260
2013-12-31 12:09:42 +01:00
mask = build_vector_from_val (masktype, mask);
mask = vect_init_vector (stmt, mask, masktype, NULL);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
}
else
gcc_unreachable ();
scale = build_int_cst (scaletype, gs_info.scale);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
i386.c (MAX_CLASSES): Increase number of classes. gcc/ * config/i386/i386.c (MAX_CLASSES): Increase number of classes. (classify_argument): Extend for 512 bit vectors. (construct_container): Ditto. (function_arg_advance_32): Ditto. (function_arg_advance_64): Ditto. (function_arg_32): Ditto. (function_arg_64): Ditto. (function_value_32): Ditto. (return_in_memory_32): Ditto. (ix86_gimplify_va_arg): Ditto. (standard_sse_constant_p): Ditto. (standard_sse_constant_opcode): Ditto. (ix86_expand_vector_convert_uns_vsivsf): Ditto. (ix86_build_const_vector): Ditto. (ix86_build_signbit_mask): Ditto. (ix86_expand_sse_cmp): Extend for AVX512. (ix86_expand_sse_movcc): Ditto. (ix86_expand_int_vcond): Ditto. (ix86_expand_vec_perm): Ditto. (ix86_expand_sse_unpack): Ditto. (ix86_constant_alignment): Ditto. (ix86_builtin_vectorized_function): Ditto. (ix86_vectorize_builtin_gather): Ditto. (avx_vpermilp_parallel): Ditto. (ix86_rtx_costs): Ditto. (ix86_expand_vector_init_duplicate): Ditto. (ix86_expand_vector_init_concat): Ditto. (ix86_expand_vector_init_general): Ditto. (ix86_expand_vector_extract): Ditto. (emit_reduc_half): Ditto. (ix86_vector_mode_supported_p): Ditto. (ix86_emit_swdivsf): Ditto. (ix86_emit_swsqrtsf): Ditto. (expand_vec_perm_1): Ditto. (ix86_vectorize_vec_perm_const_ok): Ditto. (ix86_expand_mul_widen_evenodd): Ditto. (ix86_expand_sse2_mulvxdi3): Ditto. (ix86_preferred_simd_mode): Ditto. (ix86_autovectorize_vector_sizes): Ditto. (ix86_expand_vec_perm_vpermi2): New. (ix86_vector_duplicate_value): Ditto. (IX86_BUILTIN_SQRTPD512, IX86_BUILTIN_EXP2PS, IX86_BUILTIN_SQRTPS_NR512, IX86_BUILTIN_GATHER3ALTDIV16SF, IX86_BUILTIN_GATHER3ALTDIV16SI, IX86_BUILTIN_GATHER3ALTSIV8DF, IX86_BUILTIN_GATHER3ALTSIV8DI, IX86_BUILTIN_GATHER3DIV16SF, IX86_BUILTIN_GATHER3DIV16SI, IX86_BUILTIN_GATHER3DIV8DF, IX86_BUILTIN_GATHER3DIV8DI, IX86_BUILTIN_GATHER3SIV16SF, IX86_BUILTIN_GATHER3SIV16SI, IX86_BUILTIN_GATHER3SIV8DF, IX86_BUILTIN_CEILPD_VEC_PACK_SFIX512, IX86_BUILTIN_CPYSGNPS512, IX86_BUILTIN_CPYSGNPD512, IX86_BUILTIN_FLOORPD_VEC_PACK_SFIX512, IX86_BUILTIN_ROUNDPD_AZ_VEC_PACK_SFIX512): Ditto. * config/i386/sse.md (*mov<mode>_internal): Disable SSE typeless stores vectors > 128bit (AVX*). (<sse>_storeu<ssemodesuffix><avxsizesuffix>): Ditto. (<sse2_avx_avx512f>_storedqu<mode>): Extend for AVX-512, disable SSE typeless stores vectors > 128bit (AVX*). (fixuns_trunc<mode><sseintvecmodelower>2): Extend for AVX-512. (vec_pack_ufix_trunc_<mode>): Ditto. (vec_unpacku_float_hi_v16si): New. * tree-vect-stmts.c (vectorizable_load): Support AVX512's gathers. * tree-vectorizer.h (MAX_VECTORIZATION_FACTOR): Extend for 512 bit vectors. testsuite/ * gcc.target/i386/pr49002-2.c: allow vmovapd generation. Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com> Co-Authored-By: Anna Tikhonova <anna.tikhonova@intel.com> Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com> Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com> Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Maxim Kuznetsov <maxim.kuznetsov@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> Co-Authored-By: Sergey Lega <sergey.s.lega@intel.com> From-SVN: r206260
2013-12-31 12:09:42 +01:00
if (TREE_CODE (TREE_TYPE (rettype)) == INTEGER_TYPE)
merge = build_int_cst (TREE_TYPE (rettype), 0);
else if (SCALAR_FLOAT_TYPE_P (TREE_TYPE (rettype)))
{
REAL_VALUE_TYPE r;
long tmp[6];
for (j = 0; j < 6; ++j)
tmp[j] = 0;
real_from_target (&r, tmp, TYPE_MODE (TREE_TYPE (rettype)));
merge = build_real (TREE_TYPE (rettype), r);
}
else
gcc_unreachable ();
merge = build_vector_from_val (rettype, merge);
merge = vect_init_vector (stmt, merge, rettype, NULL);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
prev_stmt_info = NULL;
for (j = 0; j < ncopies; ++j)
{
if (modifier == WIDEN && (j & 1))
op = permute_vec_elements (vec_oprnd0, vec_oprnd0,
perm_mask, stmt, gsi);
else if (j == 0)
op = vec_oprnd0
= vect_get_vec_def_for_operand (gs_info.offset, stmt);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
else
op = vec_oprnd0
= vect_get_vec_def_for_stmt_copy (gs_info.offset_dt, vec_oprnd0);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
if (!useless_type_conversion_p (idxtype, TREE_TYPE (op)))
{
gcc_assert (TYPE_VECTOR_SUBPARTS (TREE_TYPE (op))
== TYPE_VECTOR_SUBPARTS (idxtype));
var = vect_get_new_ssa_name (idxtype, vect_simple_var);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
op = build1 (VIEW_CONVERT_EXPR, idxtype, op);
new_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
= gimple_build_assign (var, VIEW_CONVERT_EXPR, op);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
vect_finish_stmt_generation (stmt, new_stmt, gsi);
op = var;
}
new_stmt
= gimple_build_call (gs_info.decl, 5, merge, ptr, op, mask, scale);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
if (!useless_type_conversion_p (vectype, rettype))
{
gcc_assert (TYPE_VECTOR_SUBPARTS (vectype)
== TYPE_VECTOR_SUBPARTS (rettype));
op = vect_get_new_ssa_name (rettype, vect_simple_var);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
gimple_call_set_lhs (new_stmt, op);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
var = make_ssa_name (vec_dest);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
op = build1 (VIEW_CONVERT_EXPR, vectype, op);
new_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
= gimple_build_assign (var, VIEW_CONVERT_EXPR, op);
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
}
else
{
var = make_ssa_name (vec_dest, new_stmt);
gimple_call_set_lhs (new_stmt, var);
}
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (modifier == NARROW)
{
if ((j & 1) == 0)
{
prev_res = var;
continue;
}
var = permute_vec_elements (prev_res, var,
perm_mask, stmt, gsi);
new_stmt = SSA_NAME_DEF_STMT (var);
}
if (prev_stmt_info == NULL)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
return true;
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_ELEMENTWISE
|| memory_access_type == VMAT_STRIDED_SLP)
{
gimple_stmt_iterator incr_gsi;
bool insert_after;
gimple *incr;
tree offvar;
tree ivstep;
tree running_off;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<constructor_elt, va_gc> *v = NULL;
gimple_seq stmts = NULL;
tree stride_base, stride_step, alias_off;
gcc_assert (!nested_in_vect_loop);
if (slp && grouped_load)
{
first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
ref_type = get_group_alias_ptr_type (first_stmt);
}
else
{
first_stmt = stmt;
first_dr = dr;
group_size = 1;
ref_type = reference_alias_ptr_type (DR_REF (first_dr));
}
stride_base
= fold_build_pointer_plus
(DR_BASE_ADDRESS (first_dr),
size_binop (PLUS_EXPR,
convert_to_ptrofftype (DR_OFFSET (first_dr)),
convert_to_ptrofftype (DR_INIT (first_dr))));
stride_step = fold_convert (sizetype, DR_STEP (first_dr));
/* For a load with loop-invariant (but other than power-of-2)
stride (i.e. not a grouped access) like so:
for (i = 0; i < n; i += stride)
... = array[i];
we generate a new induction variable and new accesses to
form a new vector (or vectors, depending on ncopies):
for (j = 0; ; j += VF*stride)
tmp1 = array[j];
tmp2 = array[j + stride];
...
vectemp = {tmp1, tmp2, ...}
*/
ivstep = fold_build2 (MULT_EXPR, TREE_TYPE (stride_step), stride_step,
build_int_cst (TREE_TYPE (stride_step), vf));
standard_iv_increment_position (loop, &incr_gsi, &insert_after);
create_iv (unshare_expr (stride_base), unshare_expr (ivstep), NULL,
loop, &incr_gsi, insert_after,
&offvar, NULL);
incr = gsi_stmt (incr_gsi);
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
set_vinfo_for_stmt (incr, new_stmt_vec_info (incr, loop_vinfo));
stride_step = force_gimple_operand (unshare_expr (stride_step),
&stmts, true, NULL_TREE);
if (stmts)
gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
prev_stmt_info = NULL;
running_off = offvar;
alias_off = build_int_cst (ref_type, 0);
int nloads = nunits;
int lnel = 1;
tree ltype = TREE_TYPE (vectype);
tree lvectype = vectype;
auto_vec<tree> dr_chain;
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_STRIDED_SLP)
{
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (group_size < nunits)
{
/* Avoid emitting a constructor of vector elements by performing
the loads using an integer type of the same size,
constructing a vector of those and then re-interpreting it
as the original vector type. This works around the fact
that the vec_init optab was only designed for scalar
element modes and thus expansion goes through memory.
This avoids a huge runtime penalty due to the general
inability to perform store forwarding from smaller stores
to a larger load. */
unsigned lsize
= group_size * TYPE_PRECISION (TREE_TYPE (vectype));
enum machine_mode elmode = mode_for_size (lsize, MODE_INT, 0);
enum machine_mode vmode = mode_for_vector (elmode,
nunits / group_size);
/* If we can't construct such a vector fall back to
element loads of the original vector type. */
if (VECTOR_MODE_P (vmode)
&& optab_handler (vec_init_optab, vmode) != CODE_FOR_nothing)
{
nloads = nunits / group_size;
lnel = group_size;
ltype = build_nonstandard_integer_type (lsize, 1);
lvectype = build_vector_type (ltype, nloads);
}
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
else
{
nloads = 1;
lnel = nunits;
ltype = vectype;
}
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
ltype = build_aligned_type (ltype, TYPE_ALIGN (TREE_TYPE (vectype)));
}
if (slp)
{
/* For SLP permutation support we need to load the whole group,
not only the number of vector stmts the permutation result
fits in. */
if (slp_perm)
{
ncopies = (group_size * vf + nunits - 1) / nunits;
dr_chain.create (ncopies);
}
else
ncopies = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
}
int group_el = 0;
unsigned HOST_WIDE_INT
elsz = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (vectype)));
for (j = 0; j < ncopies; j++)
{
if (nloads > 1)
vec_alloc (v, nloads);
for (i = 0; i < nloads; i++)
{
tree this_off = build_int_cst (TREE_TYPE (alias_off),
group_el * elsz);
new_stmt = gimple_build_assign (make_ssa_name (ltype),
build2 (MEM_REF, ltype,
running_off, this_off));
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (nloads > 1)
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
gimple_assign_lhs (new_stmt));
group_el += lnel;
if (! slp
|| group_el == group_size)
{
tree newoff = copy_ssa_name (running_off);
gimple *incr = gimple_build_assign (newoff, POINTER_PLUS_EXPR,
running_off, stride_step);
vect_finish_stmt_generation (stmt, incr, gsi);
running_off = newoff;
group_el = 0;
}
}
if (nloads > 1)
{
tree vec_inv = build_constructor (lvectype, v);
new_temp = vect_init_vector (stmt, vec_inv, lvectype, gsi);
new_stmt = SSA_NAME_DEF_STMT (new_temp);
if (lvectype != vectype)
{
new_stmt = gimple_build_assign (make_ssa_name (vectype),
VIEW_CONVERT_EXPR,
build1 (VIEW_CONVERT_EXPR,
vectype, new_temp));
vect_finish_stmt_generation (stmt, new_stmt, gsi);
}
}
if (slp)
{
if (slp_perm)
dr_chain.quick_push (gimple_assign_lhs (new_stmt));
else
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
}
else
{
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
}
if (slp_perm)
{
unsigned n_perms;
vect_transform_slp_perm_load (slp_node, dr_chain, gsi, vf,
slp_node_instance, false, &n_perms);
}
return true;
}
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
if (grouped_load)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
/* For SLP vectorization we directly vectorize a subchain
without permutation. */
if (slp && ! SLP_TREE_LOAD_PERMUTATION (slp_node).exists ())
first_stmt = SLP_TREE_SCALAR_STMTS (slp_node)[0];
/* For BB vectorization always use the first stmt to base
the data ref pointer on. */
if (bb_vinfo)
first_stmt_for_drptr = SLP_TREE_SCALAR_STMTS (slp_node)[0];
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Check if the chain of loads is already vectorized. */
if (STMT_VINFO_VEC_STMT (vinfo_for_stmt (first_stmt))
/* For SLP we would need to copy over SLP_TREE_VEC_STMTS.
??? But we can only do so if there is exactly one
as we have no way to get at the rest. Leave the CSE
opportunity alone.
??? With the group load eventually participating
in multiple different permutations (having multiple
slp nodes which refer to the same group) the CSE
is even wrong code. See PR56270. */
&& !slp)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
return true;
}
first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
group_gap_adj = 0;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* VEC_NUM is the number of vect stmts to be created for this group. */
if (slp)
{
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
grouped_load = false;
/* For SLP permutation support we need to load the whole group,
not only the number of vector stmts the permutation result
fits in. */
if (slp_perm)
Backport PRs 80721, 81175, 81410, 81455, 81505 2017-07-26 Richard Biener <rguenther@suse.de> Backport from mainline 2017-06-02 Richard Biener <rguenther@suse.de> Markus Eisenmann <meisenmann.lba@fh-salzburg.ac.at> PR libstdc++/80721 * libsupc++/eh_alloc.cc (pool::free): Keep list properly sorted and add missing freelist item merging cases. 2017-06-18 Richard Biener <rguenther@suse.de> PR tree-optimization/81410 * tree-vect-stmts.c (vectorizable_load): Properly adjust for the gap in the ! slp_perm SLP case after each group. * gcc.dg/vect/pr81410.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR tree-optimization/81455 * tree-ssa-loop-unswitch.c (find_loop_guard): Make sure to not walk in cycles when looking for guards. * gcc.dg/pr81455.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR middle-end/81505 * fold-const.c (fold_negate_const): TREE_OVERFLOW should be sticky. * gcc.dg/ubsan/pr81505.c: New testcase. 2017-07-04 Jakub Jelinek <jakub@redhat.com> PR target/81175 * gcc.target/i386/pr69255-2.c (foo): Use the return value of the gather. 2017-06-28 Jakub Jelinek <jakub@redhat.com> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin rather than def_builtin_pure for __builtin_ia32_gatherpf*. 2017-06-26 Richard Biener <rguenther@suse.de> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin_pure for all gather builtins. * gfortran.dg/pr81175.f: New testcase. 2017-06-21 Marc Glisse <marc.glisse@inria.fr> * config/i386/i386.c (struct builtin_isa): New field pure_p. Reorder for compactness. (def_builtin, def_builtin2, ix86_add_new_builtins): Handle pure_p. (def_builtin_pure, def_builtin_pure2): New functions. (ix86_init_mmx_sse_builtins) [__builtin_ia32_stmxcsr]: Mark as pure. * gcc.dg/tree-ssa/addadd.c: Un-XFAIL. * gcc.dg/tree-ssa/addadd-2.c: New file. From-SVN: r250560
2017-07-26 10:36:34 +02:00
{
vec_num = (group_size * vf + nunits - 1) / nunits;
group_gap_adj = vf * group_size - nunits * vec_num;
}
else
Backport PRs 80721, 81175, 81410, 81455, 81505 2017-07-26 Richard Biener <rguenther@suse.de> Backport from mainline 2017-06-02 Richard Biener <rguenther@suse.de> Markus Eisenmann <meisenmann.lba@fh-salzburg.ac.at> PR libstdc++/80721 * libsupc++/eh_alloc.cc (pool::free): Keep list properly sorted and add missing freelist item merging cases. 2017-06-18 Richard Biener <rguenther@suse.de> PR tree-optimization/81410 * tree-vect-stmts.c (vectorizable_load): Properly adjust for the gap in the ! slp_perm SLP case after each group. * gcc.dg/vect/pr81410.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR tree-optimization/81455 * tree-ssa-loop-unswitch.c (find_loop_guard): Make sure to not walk in cycles when looking for guards. * gcc.dg/pr81455.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR middle-end/81505 * fold-const.c (fold_negate_const): TREE_OVERFLOW should be sticky. * gcc.dg/ubsan/pr81505.c: New testcase. 2017-07-04 Jakub Jelinek <jakub@redhat.com> PR target/81175 * gcc.target/i386/pr69255-2.c (foo): Use the return value of the gather. 2017-06-28 Jakub Jelinek <jakub@redhat.com> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin rather than def_builtin_pure for __builtin_ia32_gatherpf*. 2017-06-26 Richard Biener <rguenther@suse.de> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin_pure for all gather builtins. * gfortran.dg/pr81175.f: New testcase. 2017-06-21 Marc Glisse <marc.glisse@inria.fr> * config/i386/i386.c (struct builtin_isa): New field pure_p. Reorder for compactness. (def_builtin, def_builtin2, ix86_add_new_builtins): Handle pure_p. (def_builtin_pure, def_builtin_pure2): New functions. (ix86_init_mmx_sse_builtins) [__builtin_ia32_stmxcsr]: Mark as pure. * gcc.dg/tree-ssa/addadd.c: Un-XFAIL. * gcc.dg/tree-ssa/addadd-2.c: New file. From-SVN: r250560
2017-07-26 10:36:34 +02:00
{
vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
group_gap_adj
= group_size - SLP_INSTANCE_GROUP_SIZE (slp_node_instance);
Backport PRs 80721, 81175, 81410, 81455, 81505 2017-07-26 Richard Biener <rguenther@suse.de> Backport from mainline 2017-06-02 Richard Biener <rguenther@suse.de> Markus Eisenmann <meisenmann.lba@fh-salzburg.ac.at> PR libstdc++/80721 * libsupc++/eh_alloc.cc (pool::free): Keep list properly sorted and add missing freelist item merging cases. 2017-06-18 Richard Biener <rguenther@suse.de> PR tree-optimization/81410 * tree-vect-stmts.c (vectorizable_load): Properly adjust for the gap in the ! slp_perm SLP case after each group. * gcc.dg/vect/pr81410.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR tree-optimization/81455 * tree-ssa-loop-unswitch.c (find_loop_guard): Make sure to not walk in cycles when looking for guards. * gcc.dg/pr81455.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR middle-end/81505 * fold-const.c (fold_negate_const): TREE_OVERFLOW should be sticky. * gcc.dg/ubsan/pr81505.c: New testcase. 2017-07-04 Jakub Jelinek <jakub@redhat.com> PR target/81175 * gcc.target/i386/pr69255-2.c (foo): Use the return value of the gather. 2017-06-28 Jakub Jelinek <jakub@redhat.com> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin rather than def_builtin_pure for __builtin_ia32_gatherpf*. 2017-06-26 Richard Biener <rguenther@suse.de> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin_pure for all gather builtins. * gfortran.dg/pr81175.f: New testcase. 2017-06-21 Marc Glisse <marc.glisse@inria.fr> * config/i386/i386.c (struct builtin_isa): New field pure_p. Reorder for compactness. (def_builtin, def_builtin2, ix86_add_new_builtins): Handle pure_p. (def_builtin_pure, def_builtin_pure2): New functions. (ix86_init_mmx_sse_builtins) [__builtin_ia32_stmxcsr]: Mark as pure. * gcc.dg/tree-ssa/addadd.c: Un-XFAIL. * gcc.dg/tree-ssa/addadd-2.c: New file. From-SVN: r250560
2017-07-26 10:36:34 +02:00
}
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
vec_num = group_size;
ref_type = get_group_alias_ptr_type (first_stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
else
{
first_stmt = stmt;
first_dr = dr;
group_size = vec_num = 1;
group_gap_adj = 0;
ref_type = reference_alias_ptr_type (DR_REF (first_dr));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
alignment_support_scheme = vect_supportable_dr_alignment (first_dr, false);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gcc_assert (alignment_support_scheme);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* Targets with load-lane instructions must not require explicit
realignment. */
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
gcc_assert (memory_access_type != VMAT_LOAD_STORE_LANES
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
|| alignment_support_scheme == dr_aligned
|| alignment_support_scheme == dr_unaligned_supported);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* In case the vectorization factor (VF) is bigger than the number
of elements that we can fit in a vectype (nunits), we have to generate
more than one vector stmt - i.e - we need to "unroll" the
vector stmt by a factor VF/nunits. In doing so, we record a pointer
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
from one copy of the vector stmt to the next, in the field
STMT_VINFO_RELATED_STMT. This is necessary in order to allow following
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stages to find the correct vector defs to be used when vectorizing
stmts that use the defs of the current stmt. The example below
illustrates the vectorization process when VF=16 and nunits=4 (i.e., we
need to create 4 vectorized stmts):
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
before vectorization:
RELATED_STMT VEC_STMT
S1: x = memref - -
S2: z = x + 1 - -
step 1: vectorize stmt S1:
We first create the vector stmt VS1_0, and, as usual, record a
pointer to it in the STMT_VINFO_VEC_STMT of the scalar stmt S1.
Next, we create the vector stmt VS1_1, and record a pointer to
it in the STMT_VINFO_RELATED_STMT of the vector stmt VS1_0.
Similarly, for VS1_2 and VS1_3. This is the resulting chain of
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmts and pointers:
RELATED_STMT VEC_STMT
VS1_0: vx0 = memref0 VS1_1 -
VS1_1: vx1 = memref1 VS1_2 -
VS1_2: vx2 = memref2 VS1_3 -
VS1_3: vx3 = memref3 - -
S1: x = load - VS1_0
S2: z = x + 1 - -
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
See in documentation in vect_get_vec_def_for_stmt_copy for how the
information we recorded in RELATED_STMT field is used to vectorize
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt S2. */
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
/* In case of interleaving (non-unit grouped access):
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
S1: x2 = &base + 2
S2: x0 = &base
S3: x1 = &base + 1
S4: x3 = &base + 3
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
Vectorized loads are created in the order of memory accesses
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
starting from the access of the first stmt of the chain:
VS1: vx0 = &base
VS2: vx1 = &base + vec_size*1
VS3: vx3 = &base + vec_size*2
VS4: vx4 = &base + vec_size*3
Then permutation statements are generated:
VS5: vx5 = VEC_PERM_EXPR < vx0, vx1, { 0, 2, ..., i*2 } >
VS6: vx6 = VEC_PERM_EXPR < vx0, vx1, { 1, 3, ..., i*2+1 } >
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
...
And they are put in STMT_VINFO_VEC_STMT of the corresponding scalar stmts
(the order of the data-refs in the output of vect_permute_load_chain
corresponds to the order of scalar stmts in the interleaving chain - see
the documentation of vect_permute_load_chain()).
The generation of permutation stmts and recording them in
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
STMT_VINFO_VEC_STMT is done in vect_transform_grouped_load().
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
In case of both multiple types and interleaving, the vector loads and
permutation stmts above are created for every copy. The result vector
stmts are put in STMT_VINFO_VEC_STMT for the first copy and in the
corresponding STMT_VINFO_RELATED_STMT for the next copies. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* If the data reference is aligned (dr_aligned) or potentially unaligned
on a target that supports unaligned accesses (dr_unaligned_supported)
we generate the following code:
p = initial_addr;
indx = 0;
loop {
p = p + indx * vectype_size;
vec_dest = *(p);
indx = indx + 1;
}
Otherwise, the data reference is potentially unaligned on a target that
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
does not support unaligned accesses (dr_explicit_realign_optimized) -
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
then generate the following code, in which the data in each iteration is
obtained by two vector loads, one from the previous iteration, and one
from the current iteration:
p1 = initial_addr;
msq_init = *(floor(p1))
p2 = initial_addr + VS - 1;
realignment_token = call target_builtin;
indx = 0;
loop {
p2 = p2 + indx * vectype_size
lsq = *(floor(p2))
vec_dest = realign_load (msq, lsq, realignment_token)
indx = indx + 1;
msq = lsq;
} */
/* If the misalignment remains the same throughout the execution of the
loop, we can create the init_addr and permutation mask at the loop
preheader. Otherwise, it needs to be created inside the loop.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
This can only occur when vectorizing memory accesses in the inner-loop
nested within an outer-loop that is being vectorized. */
if (nested_in_vect_loop
&& (TREE_INT_CST_LOW (DR_STEP (dr))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
% GET_MODE_SIZE (TYPE_MODE (vectype)) != 0))
{
gcc_assert (alignment_support_scheme != dr_explicit_realign_optimized);
compute_in_loop = true;
}
if ((alignment_support_scheme == dr_explicit_realign_optimized
|| alignment_support_scheme == dr_explicit_realign)
&& !compute_in_loop)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
msq = vect_setup_realignment (first_stmt, gsi, &realignment_token,
alignment_support_scheme, NULL_TREE,
&at_loop);
if (alignment_support_scheme == dr_explicit_realign_optimized)
{
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
phi = as_a <gphi *> (SSA_NAME_DEF_STMT (msq));
byte_offset = size_binop (MINUS_EXPR, TYPE_SIZE_UNIT (vectype),
size_one_node);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
}
else
at_loop = loop;
if (memory_access_type == VMAT_CONTIGUOUS_REVERSE)
offset = size_int (-TYPE_VECTOR_SUBPARTS (vectype) + 1);
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_LOAD_STORE_LANES)
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
aggr_type = build_array_type_nelts (elem_type, vec_num * nunits);
else
aggr_type = vectype;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
prev_stmt_info = NULL;
Backport PRs 80721, 81175, 81410, 81455, 81505 2017-07-26 Richard Biener <rguenther@suse.de> Backport from mainline 2017-06-02 Richard Biener <rguenther@suse.de> Markus Eisenmann <meisenmann.lba@fh-salzburg.ac.at> PR libstdc++/80721 * libsupc++/eh_alloc.cc (pool::free): Keep list properly sorted and add missing freelist item merging cases. 2017-06-18 Richard Biener <rguenther@suse.de> PR tree-optimization/81410 * tree-vect-stmts.c (vectorizable_load): Properly adjust for the gap in the ! slp_perm SLP case after each group. * gcc.dg/vect/pr81410.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR tree-optimization/81455 * tree-ssa-loop-unswitch.c (find_loop_guard): Make sure to not walk in cycles when looking for guards. * gcc.dg/pr81455.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR middle-end/81505 * fold-const.c (fold_negate_const): TREE_OVERFLOW should be sticky. * gcc.dg/ubsan/pr81505.c: New testcase. 2017-07-04 Jakub Jelinek <jakub@redhat.com> PR target/81175 * gcc.target/i386/pr69255-2.c (foo): Use the return value of the gather. 2017-06-28 Jakub Jelinek <jakub@redhat.com> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin rather than def_builtin_pure for __builtin_ia32_gatherpf*. 2017-06-26 Richard Biener <rguenther@suse.de> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin_pure for all gather builtins. * gfortran.dg/pr81175.f: New testcase. 2017-06-21 Marc Glisse <marc.glisse@inria.fr> * config/i386/i386.c (struct builtin_isa): New field pure_p. Reorder for compactness. (def_builtin, def_builtin2, ix86_add_new_builtins): Handle pure_p. (def_builtin_pure, def_builtin_pure2): New functions. (ix86_init_mmx_sse_builtins) [__builtin_ia32_stmxcsr]: Mark as pure. * gcc.dg/tree-ssa/addadd.c: Un-XFAIL. * gcc.dg/tree-ssa/addadd-2.c: New file. From-SVN: r250560
2017-07-26 10:36:34 +02:00
int group_elt = 0;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
for (j = 0; j < ncopies; j++)
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
{
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* 1. Create the vector or array pointer update chain. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (j == 0)
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
{
bool simd_lane_access_p
= STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info);
if (simd_lane_access_p
&& TREE_CODE (DR_BASE_ADDRESS (first_dr)) == ADDR_EXPR
&& VAR_P (TREE_OPERAND (DR_BASE_ADDRESS (first_dr), 0))
&& integer_zerop (DR_OFFSET (first_dr))
&& integer_zerop (DR_INIT (first_dr))
&& alias_sets_conflict_p (get_alias_set (aggr_type),
get_alias_set (TREE_TYPE (ref_type)))
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
&& (alignment_support_scheme == dr_aligned
|| alignment_support_scheme == dr_unaligned_supported))
{
dataref_ptr = unshare_expr (DR_BASE_ADDRESS (first_dr));
dataref_offset = build_int_cst (ref_type, 0);
inv_p = false;
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
}
else if (first_stmt_for_drptr
&& first_stmt != first_stmt_for_drptr)
{
dataref_ptr
= vect_create_data_ref_ptr (first_stmt_for_drptr, aggr_type,
at_loop, offset, &dummy, gsi,
&ptr_incr, simd_lane_access_p,
&inv_p, byte_offset);
/* Adjust the pointer by the difference to first_stmt. */
data_reference_p ptrdr
= STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt_for_drptr));
tree diff = fold_convert (sizetype,
size_binop (MINUS_EXPR,
DR_INIT (first_dr),
DR_INIT (ptrdr)));
dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi,
stmt, diff);
}
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
else
dataref_ptr
= vect_create_data_ref_ptr (first_stmt, aggr_type, at_loop,
offset, &dummy, gsi, &ptr_incr,
simd_lane_access_p, &inv_p,
byte_offset);
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
}
else if (dataref_offset)
dataref_offset = int_const_binop (PLUS_EXPR, dataref_offset,
TYPE_SIZE_UNIT (aggr_type));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
TYPE_SIZE_UNIT (aggr_type));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
if (grouped_load || slp_perm)
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
dr_chain.create (vec_num);
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type == VMAT_LOAD_STORE_LANES)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
tree vec_array;
vec_array = create_vector_array (vectype, vec_num);
/* Emit:
VEC_ARRAY = LOAD_LANES (MEM_REF[...all elements...]). */
data_ref = create_array_ref (aggr_type, dataref_ptr, ref_type);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
new_stmt = gimple_build_call_internal (IFN_LOAD_LANES, 1, data_ref);
gimple_call_set_lhs (new_stmt, vec_array);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* Extract each vector into an SSA_NAME. */
for (i = 0; i < vec_num; i++)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
new_temp = read_vector_array (stmt, gsi, scalar_dest,
vec_array, i);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
dr_chain.quick_push (new_temp);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
}
/* Record the mapping between SSA_NAMEs and statements. */
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
vect_record_grouped_load_vectors (stmt, dr_chain);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
}
else
{
for (i = 0; i < vec_num; i++)
{
if (i > 0)
dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi,
stmt, NULL_TREE);
/* 2. Create the vector-load in the loop. */
switch (alignment_support_scheme)
{
case dr_aligned:
case dr_unaligned_supported:
tree.def (MISALIGNED_INDIRECT_REF): Remove. 2010-09-06 Richard Guenther <rguenther@suse.de> * tree.def (MISALIGNED_INDIRECT_REF): Remove. * tree.h (INDIRECT_REF_P): Only check for INDIRECT_REF. (build_aligned_type): Declare. * tree.c (check_qualified_type): Also compare TYPE_ALIGN. (check_aligned_type): New function. (build_aligned_type): Likewise. * expr.c (expand_assignment): Handle misaligned stores via TARGET_MEM_REF and MEM_REF using movmisalign_optab. (expand_expr_real_1): Likewise. (safe_from_p): Remove MISALIGNED_INDIRECT_REF handling. * tree-vect-stmts.c (vectorizable_store): Do not build MISALIGNED_INDIRECT_REF but initialize alignment information. (vectorizable_load): Likewise. * builtins.c (get_object_alignment): Remove MISALIGNED_INDIRECT_REF handling. * cfgexpand.c (expand_debug_expr): Likewise. * dwarf2out.c (loc_list_from_tree): Likewise. * fold-const.c (maybe_lvalue_p): Likewise. (operand_equal_p): Likewise. (build_fold_addr_expr_with_type_loc): Likewise. * gimplify.c (gimplify_addr_expr): Likewise. (gimplify_expr): Likewise. * tree-cfg.c (verify_types_in_gimple_min_lval): Likewise. (verify_gimple_assign_single): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. (tree_could_trap_p): Likewise. * tree-predcom.c (ref_at_iteration): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. (op_code_prio): Likewise. (op_symbol_code): Likewise. * tree-ssa-ccp.c (get_value_from_alignment): Likewise. * tree-ssa-loop-im.c (for_each_index): Likewise. (gen_lsm_tmp_name): Likewise. * tree-ssa-loop-ivopts.c (idx_find_step): Likewise. (find_interesting_uses_address): Likewise. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise. (ao_ref_init_from_vn_reference): Likewise. * tree.c (staticp): Likewise. (build1_stat): Likewise. (reference_alias_ptr_type): Likewise. * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. * config/rs6000/rs6000.c (rs6000_check_sdmode): Remove MISALIGNED_INDIRECT_REF handling. From-SVN: r163915
2010-09-06 15:26:13 +02:00
{
builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte... 2012-05-03 Martin Jambor <mjambor@suse.cz> * builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_pointer_alignment_1 for dereference alignment. (get_pointer_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_ptr_info_alignment to get SSA name alignment. (get_object_alignment): Update call to get_object_alignment_1. (get_object_or_type_alignment): Likewise, fall back to type alignment only when it returned false. (get_pointer_alignment): Update call to get_pointer_alignment_1. * fold-const.c (get_pointer_modulus_and_residue): Update call to get_object_alignment_1. * ipa-prop.c (ipa_modify_call_arguments): Update call to get_pointer_alignment_1. * tree-sra.c (build_ref_for_offset): Likewise, fall back to the type of MEM_REF or TARGET_MEM_REF only when it returns false. * tree-ssa-ccp.c (get_value_from_alignment): Update call to get_object_alignment_1. (ccp_finalize): Use set_ptr_info_alignment. * tree.h (get_object_alignment_1): Update declaration. (get_pointer_alignment_1): Likewise. * gimple-pretty-print.c (dump_gimple_phi): Use get_ptr_info_alignment. (dump_gimple_stmt): Likewise. * tree-flow.h (ptr_info_def): Updated comments of fields align and misalign. (get_ptr_info_alignment): Declared. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. * tree-ssa-address.c (copy_ref_info): Use new access functions to get and set alignment of SSA names. * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Call mark_ptr_info_alignment_unknown. * tree-ssanames.c (get_ptr_info_alignment): New function. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. (get_ptr_info): Call mark_ptr_info_alignment_unknown. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Likewise. (bump_vector_ptr): Likewise. * tree-vect-stmts.c (create_array_ref): Use set_ptr_info_alignment. (vectorizable_store): Likewise. (vectorizable_load): Likewise. From-SVN: r187101
2012-05-03 17:48:56 +02:00
unsigned int align, misalign;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
data_ref
= fold_build2 (MEM_REF, vectype, dataref_ptr,
dataref_offset
? dataref_offset
: build_int_cst (ref_type, 0));
builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte... 2012-05-03 Martin Jambor <mjambor@suse.cz> * builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_pointer_alignment_1 for dereference alignment. (get_pointer_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_ptr_info_alignment to get SSA name alignment. (get_object_alignment): Update call to get_object_alignment_1. (get_object_or_type_alignment): Likewise, fall back to type alignment only when it returned false. (get_pointer_alignment): Update call to get_pointer_alignment_1. * fold-const.c (get_pointer_modulus_and_residue): Update call to get_object_alignment_1. * ipa-prop.c (ipa_modify_call_arguments): Update call to get_pointer_alignment_1. * tree-sra.c (build_ref_for_offset): Likewise, fall back to the type of MEM_REF or TARGET_MEM_REF only when it returns false. * tree-ssa-ccp.c (get_value_from_alignment): Update call to get_object_alignment_1. (ccp_finalize): Use set_ptr_info_alignment. * tree.h (get_object_alignment_1): Update declaration. (get_pointer_alignment_1): Likewise. * gimple-pretty-print.c (dump_gimple_phi): Use get_ptr_info_alignment. (dump_gimple_stmt): Likewise. * tree-flow.h (ptr_info_def): Updated comments of fields align and misalign. (get_ptr_info_alignment): Declared. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. * tree-ssa-address.c (copy_ref_info): Use new access functions to get and set alignment of SSA names. * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Call mark_ptr_info_alignment_unknown. * tree-ssanames.c (get_ptr_info_alignment): New function. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. (get_ptr_info): Call mark_ptr_info_alignment_unknown. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Likewise. (bump_vector_ptr): Likewise. * tree-vect-stmts.c (create_array_ref): Use set_ptr_info_alignment. (vectorizable_store): Likewise. (vectorizable_load): Likewise. From-SVN: r187101
2012-05-03 17:48:56 +02:00
align = TYPE_ALIGN_UNIT (vectype);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
if (alignment_support_scheme == dr_aligned)
{
gcc_assert (aligned_access_p (first_dr));
builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte... 2012-05-03 Martin Jambor <mjambor@suse.cz> * builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_pointer_alignment_1 for dereference alignment. (get_pointer_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_ptr_info_alignment to get SSA name alignment. (get_object_alignment): Update call to get_object_alignment_1. (get_object_or_type_alignment): Likewise, fall back to type alignment only when it returned false. (get_pointer_alignment): Update call to get_pointer_alignment_1. * fold-const.c (get_pointer_modulus_and_residue): Update call to get_object_alignment_1. * ipa-prop.c (ipa_modify_call_arguments): Update call to get_pointer_alignment_1. * tree-sra.c (build_ref_for_offset): Likewise, fall back to the type of MEM_REF or TARGET_MEM_REF only when it returns false. * tree-ssa-ccp.c (get_value_from_alignment): Update call to get_object_alignment_1. (ccp_finalize): Use set_ptr_info_alignment. * tree.h (get_object_alignment_1): Update declaration. (get_pointer_alignment_1): Likewise. * gimple-pretty-print.c (dump_gimple_phi): Use get_ptr_info_alignment. (dump_gimple_stmt): Likewise. * tree-flow.h (ptr_info_def): Updated comments of fields align and misalign. (get_ptr_info_alignment): Declared. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. * tree-ssa-address.c (copy_ref_info): Use new access functions to get and set alignment of SSA names. * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Call mark_ptr_info_alignment_unknown. * tree-ssanames.c (get_ptr_info_alignment): New function. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. (get_ptr_info): Call mark_ptr_info_alignment_unknown. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Likewise. (bump_vector_ptr): Likewise. * tree-vect-stmts.c (create_array_ref): Use set_ptr_info_alignment. (vectorizable_store): Likewise. (vectorizable_load): Likewise. From-SVN: r187101
2012-05-03 17:48:56 +02:00
misalign = 0;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
}
else if (DR_MISALIGNMENT (first_dr) == -1)
{
if (DR_VECT_AUX (first_dr)->base_element_aligned)
align = TYPE_ALIGN_UNIT (elem_type);
else
align = (get_object_alignment (DR_REF (first_dr))
/ BITS_PER_UNIT);
misalign = 0;
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
TREE_TYPE (data_ref)
= build_aligned_type (TREE_TYPE (data_ref),
align * BITS_PER_UNIT);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
}
else
{
TREE_TYPE (data_ref)
= build_aligned_type (TREE_TYPE (data_ref),
TYPE_ALIGN (elem_type));
builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte... 2012-05-03 Martin Jambor <mjambor@suse.cz> * builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_pointer_alignment_1 for dereference alignment. (get_pointer_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_ptr_info_alignment to get SSA name alignment. (get_object_alignment): Update call to get_object_alignment_1. (get_object_or_type_alignment): Likewise, fall back to type alignment only when it returned false. (get_pointer_alignment): Update call to get_pointer_alignment_1. * fold-const.c (get_pointer_modulus_and_residue): Update call to get_object_alignment_1. * ipa-prop.c (ipa_modify_call_arguments): Update call to get_pointer_alignment_1. * tree-sra.c (build_ref_for_offset): Likewise, fall back to the type of MEM_REF or TARGET_MEM_REF only when it returns false. * tree-ssa-ccp.c (get_value_from_alignment): Update call to get_object_alignment_1. (ccp_finalize): Use set_ptr_info_alignment. * tree.h (get_object_alignment_1): Update declaration. (get_pointer_alignment_1): Likewise. * gimple-pretty-print.c (dump_gimple_phi): Use get_ptr_info_alignment. (dump_gimple_stmt): Likewise. * tree-flow.h (ptr_info_def): Updated comments of fields align and misalign. (get_ptr_info_alignment): Declared. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. * tree-ssa-address.c (copy_ref_info): Use new access functions to get and set alignment of SSA names. * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Call mark_ptr_info_alignment_unknown. * tree-ssanames.c (get_ptr_info_alignment): New function. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. (get_ptr_info): Call mark_ptr_info_alignment_unknown. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Likewise. (bump_vector_ptr): Likewise. * tree-vect-stmts.c (create_array_ref): Use set_ptr_info_alignment. (vectorizable_store): Likewise. (vectorizable_load): Likewise. From-SVN: r187101
2012-05-03 17:48:56 +02:00
misalign = DR_MISALIGNMENT (first_dr);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
}
if (dataref_offset == NULL_TREE
&& TREE_CODE (dataref_ptr) == SSA_NAME)
Makefile.in (omp-low.o): Depend on $(TARGET_H). * Makefile.in (omp-low.o): Depend on $(TARGET_H). * cfgloop.h (struct loop): Add safelen, force_vect, simduid. * function.h (struct function): Add has_force_vect_loops and has_simduid_loops. * gimple-pretty-print.c (dump_gimple_omp_for): Handle GF_OMP_FOR_KIND*. * gimple.c (gimple_build_omp_critical): Add KIND argument and handle it. * gimple.def: Update CLAUSES comments. * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}. (gimple_build_omp_for): Add argument to prototype. (gimple_omp_for_kind): New. (gimple_omp_for_set_kind): New. * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to GOVD_DATA_SHARE_CLASS. (enum omp_region_type): Add ORT_SIMD. (gimple_add_tmp_var): Handle ORT_SIMD. (gimplify_var_or_parm_decl): Same. (is_gimple_stmt): Same. (omp_firstprivatize_variable): Same. (omp_add_variable): Only use splay_tree_insert if lookup failed. (omp_notice_variable): Handle ORT_SIMD. (omp_is_private): Add SIMD argument and handle it as well as ORT_SIMD. (omp_check_private): Handle ORT_SIMD. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR. Handle OMP_CLAUSE_LASTPRIVATE. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and OMP_CLAUSE_SAFELEN. (gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR. (gimplify_expr): Handle OMP_SIMD. * internal-fn.c (expand_GOMP_SIMD_LANE): New. (expand_GOMP_SIMD_VF): New. (expand_GOMP_SIMD_LAST_LANE): New. * internal-fn.def (GOMP_SIMD_LANE): New. (GOMP_SIMD_VF): New. (GOMP_SIMD_LAST_LANE): New. * omp-low.c: Include target.h. (extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN. (check_omp_nesting_restrictions): Same. (omp_max_vf): New. (lower_rec_simd_input_clauses): New. (lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD, OMP_CLAUSE_LINEAR. (lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR, GF_OMP_FOR_KIND_SIMD, OMP_SIMD. (expand_omp_build_assign): New. (expand_omp_for_init_counts): New. (expand_omp_for_init_vars): New. (extract_omp_for_update_vars): New. (expand_omp_for_generic): Use expand_omp_for_{init,update}_vars and rewrite accordingly. (expand_omp_simd): New. (expand_omp_for): Use expand_omp_simd. (lower_omp_for_lastprivate): Unshare vinit when appropriate. (lower_omp_for): Do not lower the body. * tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE in their own loops. * tree-flow.h (find_omp_clause): Remove prototype. * tree-if-conv.c (main_tree_if_conversion): Run if doing if conversion, forcing vectorization of the loop, or if flag_tree_vectorize. (gate_tree_if_conversion): Similarly. * tree-inline.c (remap_gimple_stmt): Pass for kind argument to gimple_build_omp_for. (copy_cfg_body): set has_force_vect_loops and has_simduid_loops. * tree-parloops (create_parallel_loop): Pass kind argument to gimple_build_omp_for. * tree-pretty-print.c (dump_omp_clause): Add cases for OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (dump_generic_node): Handle OMP_SIMD. * tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not unroll OMP_SIMD loops here. * tree-ssa-loop.c (gate_tree_vectorize): Run if has_force_vect_loops. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle loop->safelen (vect_analyze_data_refs): Handle simd loops. * tree-vect-loop.c (vectorizable_live_operation): Handle IFN_GOMP_SIMD*. * tree-vect-stmts.c (vectorizable_call): Handle IFN_GOMP_SIMD_LANE. (vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P. (vectorizable_load): Same. * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h. (struct simduid_to_vf): New. (simduid_to_vf::hash): New. (simduid_to-vf::equal): New. (struct simd_array_to_simduid): New. (simd_array_to_simduid::hash): New. (simd_array_to_simduid::equal): New. (adjust_simduid_builtins): New. (struct note_simd_array_uses_struct): New. (note_simd_array_uses_cb): New. (note_simd_array_uses): New. (vectorize_loops): Handle simd hints and adjust simd builtins accordingly. * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p field. (STMT_VINFO_SIMD_LANE_ACCESS_P): New macro. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM. (omp_clause_code_name): Same. (walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR. * tree.def (OMP_SIMD): New entry. * tree.h (enum omp_clause_code): Add entries for OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_. (OMP_CLAUSE_DECL): Adjust range for new clauses. (OMP_CLAUSE_LINEAR_NO_COPYIN): New. (OMP_CLAUSE_LINEAR_NO_COPYOUT): New. (OMP_CLAUSE_LINEAR_STEP): New. (OMP_CLAUSE_SAFELEN_EXPR): New. (OMP_CLAUSE__SIMDUID__DECL): New. (find_omp_clause): New prototype. cp/ * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r202029
2013-08-27 20:38:00 +02:00
set_ptr_info_alignment (get_ptr_info (dataref_ptr),
align, misalign);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
break;
tree.def (MISALIGNED_INDIRECT_REF): Remove. 2010-09-06 Richard Guenther <rguenther@suse.de> * tree.def (MISALIGNED_INDIRECT_REF): Remove. * tree.h (INDIRECT_REF_P): Only check for INDIRECT_REF. (build_aligned_type): Declare. * tree.c (check_qualified_type): Also compare TYPE_ALIGN. (check_aligned_type): New function. (build_aligned_type): Likewise. * expr.c (expand_assignment): Handle misaligned stores via TARGET_MEM_REF and MEM_REF using movmisalign_optab. (expand_expr_real_1): Likewise. (safe_from_p): Remove MISALIGNED_INDIRECT_REF handling. * tree-vect-stmts.c (vectorizable_store): Do not build MISALIGNED_INDIRECT_REF but initialize alignment information. (vectorizable_load): Likewise. * builtins.c (get_object_alignment): Remove MISALIGNED_INDIRECT_REF handling. * cfgexpand.c (expand_debug_expr): Likewise. * dwarf2out.c (loc_list_from_tree): Likewise. * fold-const.c (maybe_lvalue_p): Likewise. (operand_equal_p): Likewise. (build_fold_addr_expr_with_type_loc): Likewise. * gimplify.c (gimplify_addr_expr): Likewise. (gimplify_expr): Likewise. * tree-cfg.c (verify_types_in_gimple_min_lval): Likewise. (verify_gimple_assign_single): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. (tree_could_trap_p): Likewise. * tree-predcom.c (ref_at_iteration): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. (op_code_prio): Likewise. (op_symbol_code): Likewise. * tree-ssa-ccp.c (get_value_from_alignment): Likewise. * tree-ssa-loop-im.c (for_each_index): Likewise. (gen_lsm_tmp_name): Likewise. * tree-ssa-loop-ivopts.c (idx_find_step): Likewise. (find_interesting_uses_address): Likewise. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise. (ao_ref_init_from_vn_reference): Likewise. * tree.c (staticp): Likewise. (build1_stat): Likewise. (reference_alias_ptr_type): Likewise. * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. * config/rs6000/rs6000.c (rs6000_check_sdmode): Remove MISALIGNED_INDIRECT_REF handling. From-SVN: r163915
2010-09-06 15:26:13 +02:00
}
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
case dr_explicit_realign:
2011-04-20 11:25:42 +02:00
{
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
tree ptr, bump;
tree vs = size_int (TYPE_VECTOR_SUBPARTS (vectype));
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
if (compute_in_loop)
msq = vect_setup_realignment (first_stmt, gsi,
&realignment_token,
dr_explicit_realign,
dataref_ptr, NULL);
if (TREE_CODE (dataref_ptr) == SSA_NAME)
ptr = copy_ssa_name (dataref_ptr);
else
ptr = make_ssa_name (TREE_TYPE (dataref_ptr));
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
(ptr, BIT_AND_EXPR, dataref_ptr,
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
build_int_cst
(TREE_TYPE (dataref_ptr),
-(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
vect_finish_stmt_generation (stmt, new_stmt, gsi);
data_ref
= build2 (MEM_REF, vectype, ptr,
build_int_cst (ref_type, 0));
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
vec_dest = vect_create_destination_var (scalar_dest,
vectype);
new_stmt = gimple_build_assign (vec_dest, data_ref);
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_assign_set_lhs (new_stmt, new_temp);
gimple_set_vdef (new_stmt, gimple_vdef (stmt));
gimple_set_vuse (new_stmt, gimple_vuse (stmt));
vect_finish_stmt_generation (stmt, new_stmt, gsi);
msq = new_temp;
bump = size_binop (MULT_EXPR, vs,
TYPE_SIZE_UNIT (elem_type));
bump = size_binop (MINUS_EXPR, bump, size_one_node);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
ptr = bump_vector_ptr (dataref_ptr, NULL, gsi, stmt, 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
(NULL_TREE, BIT_AND_EXPR, ptr,
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
build_int_cst
(TREE_TYPE (ptr),
-(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
ptr = copy_ssa_name (ptr, new_stmt);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
gimple_assign_set_lhs (new_stmt, ptr);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
data_ref
= build2 (MEM_REF, vectype, ptr,
build_int_cst (ref_type, 0));
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
break;
2011-04-20 11:25:42 +02:00
}
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
case dr_explicit_realign_optimized:
if (TREE_CODE (dataref_ptr) == SSA_NAME)
new_temp = copy_ssa_name (dataref_ptr);
else
new_temp = make_ssa_name (TREE_TYPE (dataref_ptr));
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
(new_temp, BIT_AND_EXPR, dataref_ptr,
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
build_int_cst
(TREE_TYPE (dataref_ptr),
-(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
vect_finish_stmt_generation (stmt, new_stmt, gsi);
data_ref
= build2 (MEM_REF, vectype, new_temp,
build_int_cst (ref_type, 0));
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
break;
default:
gcc_unreachable ();
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vec_dest = vect_create_destination_var (scalar_dest, vectype);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
new_stmt = gimple_build_assign (vec_dest, data_ref);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_assign_set_lhs (new_stmt, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* 3. Handle explicit realignment if necessary/supported.
Create in loop:
vec_dest = realign_load (msq, lsq, realignment_token) */
if (alignment_support_scheme == dr_explicit_realign_optimized
|| alignment_support_scheme == dr_explicit_realign)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
lsq = gimple_assign_lhs (new_stmt);
if (!realignment_token)
realignment_token = dataref_ptr;
vec_dest = vect_create_destination_var (scalar_dest, vectype);
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 (vec_dest, REALIGN_LOAD_EXPR,
msq, lsq, realignment_token);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
new_temp = make_ssa_name (vec_dest, new_stmt);
gimple_assign_set_lhs (new_stmt, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (alignment_support_scheme == dr_explicit_realign_optimized)
{
gcc_assert (phi);
if (i == vec_num - 1 && j == ncopies - 1)
add_phi_arg (phi, lsq,
loop_latch_edge (containing_loop),
revert: tree.h (phi_arg_d): New field. 2012-07-16 Dehao Chen <dehao@google.com> Revert 2012-07-10 Dehao Chen <dehao@google.com> * tree.h (phi_arg_d): New field. * tree-flow-inline.h (gimple_phi_arg_block): New function. (gimple_phi_arg_block_from_edge): New function. (gimple_phi_arg_set_block): New function. (gimple_phi_arg_has_block): New function. (redirect_edge_var_map_block): New function. * tree-flow.h (_edge_var_map): New field. * tree-ssa-live.c (remove_unused_locals): Mark phi_arg's block as used. * tree-eh.c (cleanup_empty_eh_merge_phis): Add block debug info for redirect_edge_var_map_add. * tree-outof-ssa.c (_elim_graph): New field. (insert_partition_copy_on_edge): New parameter. (insert_value_copy_on_edge): New parameter. (insert_rtx_to_part_on_edge): New parameter. (insert_part_to_rtx_on_edge): New parameter. (elim_graph_add_edge): New parameter. (elim_graph_remove_succ_edge): New parameter. (FOR_EACH_ELIM_GRAPH_SUCC): New parameter. (FOR_EACH_ELIM_GRAPH_PRED): New parameter. (new_elim_graph): Add block debug info. (clear_elim_graph): Likewise. (delete_elim_graph): Likewise. (elim_graph_add_node): Likewise. (elim_graph_add_edge): Likewise. (elim_graph_remove_succ_edge): Likewise. (eliminate_build): Likewise. (elim_forward): Likewise. (elim_unvisited_predecessor): Likewise. (elim_backward): Likewise. (elim_create): Likewise. (eliminate_phi): Likewise. (insert_backedge_copies): Likewise. * tree-into-ssa.c (insert_phi_nodes_for): Add block debug info for add_phi_arg. (rewrite_add_phi_arguments): Likewise. * tree-ssa-loop-im.c (execute_sm_if_changed): Likewise. * tree-ssa-tail-merge.c (replace_block_by): Likewise. * tree-ssa-threadupdate.c (copy_phi_args): Likewise. * tree-loop-distribution.c (update_phis_for_loop_copy): Likewise. * tree-ssa-loop-manip.c (create_iv): Likewise. (add_exit_phis_edge): Likewise. (split_loop_exit_edge): Likewise. (copy_phi_node_args): Likewise. (tree_transform_and_unroll_loop): Likewise. * value-prof.c (gimple_ic): Likewise. (gimple_stringop_fixed_value): Likewise. * tree-tailcall.c (add_successor_phi_arg): Likewise. (eliminate_tail_call): Likewise. (create_tailcall_accumulator): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-phinodes.c (add_phi_arg): Likewise. (make_phi_node): Likewise. (resize_phi_node): Likewise. (remove_phi_arg_num): Likewise. * omp-low.c (expand_parallel_call): Likewise. (expand_omp_for_static_chunk): Likewise. * tree-vect-loop-manip.c (slpeel_update_phis_for_duplicate_loop): Likewise. (slpeel_update_phi_nodes_for_guard1): Likewise. (slpeel_update_phi_nodes_for_guard2): Likewise. (slpeel_tree_duplicate_loop_to_edge_cfg): Likewise. (set_prologue_iterations): Likewise. (slpeel_tree_peel_loop_to_edge): Likewise. (vect_loop_versioning): Likewise. * tree-parloops.c (create_phi_for_local_result): Likewise. (transform_to_exit_first_loop): Likewise. (create_parallel_loop): Likewise. * ipa-split.c (split_function): Likewise. * tree-vect-loop.c (get_initial_def_for_induction): Likewise. (vect_create_epilog_for_reduction): Likewise. * tree-vect-data-refs.c (vect_setup_realignment): Likewise. * graphite-scop-detection.c (canonicalize_loop_closed_ssa): Likewise. * tree-ssa-phiopt.c (cond_store_replacement): Likewise. (cond_if_else_store_replacement_1): Likewise. * tree-cfgcleanup.c (remove_forwarder_block): Likewise. (remove_forwarder_block_with_phi): Likewise. * tree-ssa-pre.c (insert_into_preds_of_block): Likewise. * tree-predcom.c (initialize_root_vars): Likewise. (initialize_root_vars_lm): Likewise. * sese.c (sese_add_exit_phis_edge): Likewise. * tree-ssa-dce.c (forward_edge_to_pdom): Likewise. * tree-ssa.c (flush_pending_stmts): Likewise. (redirect_edge_var_map_add): Likewise. (ssa_redirect_edge): Likewise. * gimple-streamer-in.c (input_phi): Likewise. * tree-vect-stmts.c (vectorizable_load): Likewise. * tree-inline.c (copy_phis_for_bb): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-switch-conversion.c (fix_phi_nodes): Likewise. * tree-cfg.c (reinstall_phi_args): Likewise. (gimple_make_forwarder_block): Likewise. (add_phi_args_after_copy_edge): Likewise. (gimple_duplicate_sese_tail): Likewise. From-SVN: r189518
2012-07-16 13:08:21 +02:00
UNKNOWN_LOCATION);
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
msq = lsq;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* 4. Handle invariant-load. */
if (inv_p && !bb_vinfo)
{
gcc_assert (!grouped_load);
/* If we have versioned for aliasing or the loop doesn't
have any data dependencies that would preclude this,
then we are sure this is a loop invariant load and
thus we can insert it on the preheader edge. */
if (LOOP_VINFO_NO_DATA_DEPENDENCIES (loop_vinfo)
&& !nested_in_vect_loop
&& hoist_defs_of_uses (stmt, loop))
{
if (dump_enabled_p ())
{
dump_printf_loc (MSG_NOTE, vect_location,
"hoisting out of the vectorized "
"loop: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
}
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
tree tem = copy_ssa_name (scalar_dest);
gsi_insert_on_edge_immediate
(loop_preheader_edge (loop),
gimple_build_assign (tem,
unshare_expr
(gimple_assign_rhs1 (stmt))));
new_temp = vect_init_vector (stmt, tem, vectype, NULL);
new_stmt = SSA_NAME_DEF_STMT (new_temp);
set_vinfo_for_stmt (new_stmt,
new_stmt_vec_info (new_stmt, vinfo));
}
else
{
gimple_stmt_iterator gsi2 = *gsi;
gsi_next (&gsi2);
new_temp = vect_init_vector (stmt, scalar_dest,
vectype, &gsi2);
new_stmt = SSA_NAME_DEF_STMT (new_temp);
}
}
if (memory_access_type == VMAT_CONTIGUOUS_REVERSE)
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
{
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
tree perm_mask = perm_mask_for_reverse (vectype);
new_temp = permute_vec_elements (new_temp, new_temp,
perm_mask, stmt, gsi);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
new_stmt = SSA_NAME_DEF_STMT (new_temp);
}
2011-04-20 11:25:42 +02:00
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* Collect vector loads and later create their permutation in
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
vect_transform_grouped_load (). */
if (grouped_load || slp_perm)
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
dr_chain.quick_push (new_temp);
2011-04-20 11:25:42 +02:00
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
/* Store vector loads in the corresponding SLP_NODE. */
if (slp && !slp_perm)
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
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
Backport PRs 80721, 81175, 81410, 81455, 81505 2017-07-26 Richard Biener <rguenther@suse.de> Backport from mainline 2017-06-02 Richard Biener <rguenther@suse.de> Markus Eisenmann <meisenmann.lba@fh-salzburg.ac.at> PR libstdc++/80721 * libsupc++/eh_alloc.cc (pool::free): Keep list properly sorted and add missing freelist item merging cases. 2017-06-18 Richard Biener <rguenther@suse.de> PR tree-optimization/81410 * tree-vect-stmts.c (vectorizable_load): Properly adjust for the gap in the ! slp_perm SLP case after each group. * gcc.dg/vect/pr81410.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR tree-optimization/81455 * tree-ssa-loop-unswitch.c (find_loop_guard): Make sure to not walk in cycles when looking for guards. * gcc.dg/pr81455.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR middle-end/81505 * fold-const.c (fold_negate_const): TREE_OVERFLOW should be sticky. * gcc.dg/ubsan/pr81505.c: New testcase. 2017-07-04 Jakub Jelinek <jakub@redhat.com> PR target/81175 * gcc.target/i386/pr69255-2.c (foo): Use the return value of the gather. 2017-06-28 Jakub Jelinek <jakub@redhat.com> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin rather than def_builtin_pure for __builtin_ia32_gatherpf*. 2017-06-26 Richard Biener <rguenther@suse.de> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin_pure for all gather builtins. * gfortran.dg/pr81175.f: New testcase. 2017-06-21 Marc Glisse <marc.glisse@inria.fr> * config/i386/i386.c (struct builtin_isa): New field pure_p. Reorder for compactness. (def_builtin, def_builtin2, ix86_add_new_builtins): Handle pure_p. (def_builtin_pure, def_builtin_pure2): New functions. (ix86_init_mmx_sse_builtins) [__builtin_ia32_stmxcsr]: Mark as pure. * gcc.dg/tree-ssa/addadd.c: Un-XFAIL. * gcc.dg/tree-ssa/addadd-2.c: New file. From-SVN: r250560
2017-07-26 10:36:34 +02:00
/* With SLP permutation we load the gaps as well, without
we need to skip the gaps after we manage to fully load
all elements. group_gap_adj is GROUP_SIZE here. */
group_elt += nunits;
if (group_gap_adj != 0 && ! slp_perm
&& group_elt == group_size - group_gap_adj)
{
bool ovf;
tree bump
= wide_int_to_tree (sizetype,
wi::smul (TYPE_SIZE_UNIT (elem_type),
group_gap_adj, &ovf));
dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi,
stmt, bump);
group_elt = 0;
}
md.texi (vec_load_lanes, [...]): Document. gcc/ * doc/md.texi (vec_load_lanes, vec_store_lanes): Document. * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New convert_optab_index values. (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs. * genopinit.c (optabs): Initialize the new optabs. * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions. * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES) (expand_STORE_LANES): New functions. * tree.h (build_array_type_nelts): Declare. * tree.c (build_array_type_nelts): New function. * tree-vectorizer.h (vect_model_store_cost): Add a bool argument. (vect_model_load_cost): Likewise. (vect_store_lanes_supported, vect_load_lanes_supported) (vect_record_strided_load_vectors): Declare. * tree-vect-data-refs.c (vect_lanes_optab_supported_p) (vect_store_lanes_supported, vect_load_lanes_supported): New functions. (vect_transform_strided_load): Split out statement recording into... (vect_record_strided_load_vectors): ...this new function. * tree-vect-stmts.c (create_vector_array, read_vector_array) (write_vector_array, create_array_ref): New functions. (vect_model_store_cost): Add store_lanes_p argument. (vect_model_load_cost): Add load_lanes_p argument. (vectorizable_store): Try to use store-lanes functions for interleaved stores. (vectorizable_load): Likewise load-lanes and loads. * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call to vect_model_store_cost. (vect_build_slp_tree): Likewise vect_model_load_cost. From-SVN: r173291
2011-05-03 09:46:54 +02:00
}
/* Bump the vector pointer to account for a gap or for excess
elements loaded for a permuted SLP load. */
Backport PRs 80721, 81175, 81410, 81455, 81505 2017-07-26 Richard Biener <rguenther@suse.de> Backport from mainline 2017-06-02 Richard Biener <rguenther@suse.de> Markus Eisenmann <meisenmann.lba@fh-salzburg.ac.at> PR libstdc++/80721 * libsupc++/eh_alloc.cc (pool::free): Keep list properly sorted and add missing freelist item merging cases. 2017-06-18 Richard Biener <rguenther@suse.de> PR tree-optimization/81410 * tree-vect-stmts.c (vectorizable_load): Properly adjust for the gap in the ! slp_perm SLP case after each group. * gcc.dg/vect/pr81410.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR tree-optimization/81455 * tree-ssa-loop-unswitch.c (find_loop_guard): Make sure to not walk in cycles when looking for guards. * gcc.dg/pr81455.c: New testcase. 2017-07-25 Richard Biener <rguenther@suse.de> PR middle-end/81505 * fold-const.c (fold_negate_const): TREE_OVERFLOW should be sticky. * gcc.dg/ubsan/pr81505.c: New testcase. 2017-07-04 Jakub Jelinek <jakub@redhat.com> PR target/81175 * gcc.target/i386/pr69255-2.c (foo): Use the return value of the gather. 2017-06-28 Jakub Jelinek <jakub@redhat.com> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin rather than def_builtin_pure for __builtin_ia32_gatherpf*. 2017-06-26 Richard Biener <rguenther@suse.de> PR target/81175 * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin_pure for all gather builtins. * gfortran.dg/pr81175.f: New testcase. 2017-06-21 Marc Glisse <marc.glisse@inria.fr> * config/i386/i386.c (struct builtin_isa): New field pure_p. Reorder for compactness. (def_builtin, def_builtin2, ix86_add_new_builtins): Handle pure_p. (def_builtin_pure, def_builtin_pure2): New functions. (ix86_init_mmx_sse_builtins) [__builtin_ia32_stmxcsr]: Mark as pure. * gcc.dg/tree-ssa/addadd.c: Un-XFAIL. * gcc.dg/tree-ssa/addadd-2.c: New file. From-SVN: r250560
2017-07-26 10:36:34 +02:00
if (group_gap_adj != 0 && slp_perm)
{
bool ovf;
tree bump
= wide_int_to_tree (sizetype,
wi::smul (TYPE_SIZE_UNIT (elem_type),
group_gap_adj, &ovf));
dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi,
stmt, bump);
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
if (slp && !slp_perm)
continue;
if (slp_perm)
{
unsigned n_perms;
if (!vect_transform_slp_perm_load (slp_node, dr_chain, gsi, vf,
slp_node_instance, false,
&n_perms))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
dr_chain.release ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
}
else
{
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
if (grouped_load)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
[6/7] Explicitly classify vector loads and stores This is the main patch in the series. It adds a new enum and routines for classifying a vector load or store implementation. Originally there were three motivations: (1) Reduce cut-&-paste (2) Make the chosen vectorisation strategy more obvious. At the moment this is derived implicitly from various other bits of state (GROUPED, STRIDED, SLP, etc.) (3) Decouple the vectorisation strategy from those other bits of state, so that there can be a choice of implementation for a given scalar statement. The specific problem here is that we class: for (...) { ... = a[i * x]; ... = a[i * x + 1]; } as "strided and grouped" but: for (...) { ... = a[i * 7]; ... = a[i * 7 + 1]; } as "non-strided and grouped". Before the patch, "strided and grouped" loads would always try to use separate scalar loads while "non-strided and grouped" loads would always try to use load-and-permute. But load-and-permute is never supported for a group size of 7, so the effect was that the first loop was vectorisable and the second wasn't. It seemed odd that not knowing x (but accepting it could be 7) would allow more optimisation opportunities than knowing x is 7. Unfortunately, it looks like we underestimate the cost of separate scalar accesses on at least aarch64, so I've disabled (3) for now; see the "if" statement at the end of get_load_store_type. I think the patch still does (1) and (2), so that's the justification for it in its current form. It also means that (3) is now simply a case of removing the FIXME code, once the cost model problems have been sorted out. (I did wonder about adding a --param, but that seems overkill. I hope to get back to this during GCC 7 stage 1.) Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_memory_access_type): New enum. (_stmt_vec_info): Add a memory_access_type field. (STMT_VINFO_MEMORY_ACCESS_TYPE): New macro. (vect_model_store_cost): Take an access type instead of a boolean. (vect_model_load_cost): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update calls to vect_model_store_cost and vect_model_load_cost. * tree-vect-stmts.c (vec_load_store_type): New enum. (vect_model_store_cost): Take an access type instead of a store_lanes_p boolean. Simplify tests. (vect_model_load_cost): Likewise, but for load_lanes_p. (get_group_load_store_type, get_load_store_type): New functions. (vectorizable_store): Use get_load_store_type. Record the access type in STMT_VINFO_MEMORY_ACCESS_TYPE. (vectorizable_load): Likewise. (vectorizable_mask_load_store): Likewise. Replace is_store variable with vls_type. From-SVN: r238038
2016-07-06 10:15:28 +02:00
if (memory_access_type != VMAT_LOAD_STORE_LANES)
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
vect_transform_grouped_load (stmt, dr_chain, group_size, gsi);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
}
else
{
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
dr_chain.release ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
return true;
}
/* Function vect_is_simple_cond.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Input:
LOOP - the loop that is being vectorized.
COND - Condition that is checked for simple use.
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
Output:
*COMP_VECTYPE - the vector type for the comparison.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Returns whether a COND can be vectorized. Checks whether
condition operands are supportable using vec_is_simple_use. */
static bool
vect_is_simple_cond (tree cond, vec_info *vinfo, tree *comp_vectype)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree lhs, rhs;
enum vect_def_type dt;
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
tree vectype1 = NULL_TREE, vectype2 = NULL_TREE;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Mask case. */
if (TREE_CODE (cond) == SSA_NAME
&& VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (cond)))
{
gimple *lhs_def_stmt = SSA_NAME_DEF_STMT (cond);
if (!vect_is_simple_use (cond, vinfo, &lhs_def_stmt,
&dt, comp_vectype)
|| !*comp_vectype
|| !VECTOR_BOOLEAN_TYPE_P (*comp_vectype))
return false;
return true;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (!COMPARISON_CLASS_P (cond))
return false;
lhs = TREE_OPERAND (cond, 0);
rhs = TREE_OPERAND (cond, 1);
if (TREE_CODE (lhs) == SSA_NAME)
{
gimple *lhs_def_stmt = SSA_NAME_DEF_STMT (lhs);
if (!vect_is_simple_use (lhs, vinfo, &lhs_def_stmt, &dt, &vectype1))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
else if (TREE_CODE (lhs) != INTEGER_CST && TREE_CODE (lhs) != REAL_CST
&& TREE_CODE (lhs) != FIXED_CST)
return false;
if (TREE_CODE (rhs) == SSA_NAME)
{
gimple *rhs_def_stmt = SSA_NAME_DEF_STMT (rhs);
if (!vect_is_simple_use (rhs, vinfo, &rhs_def_stmt, &dt, &vectype2))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
else if (TREE_CODE (rhs) != INTEGER_CST && TREE_CODE (rhs) != REAL_CST
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
&& TREE_CODE (rhs) != FIXED_CST)
return false;
if (vectype1 && vectype2
&& TYPE_VECTOR_SUBPARTS (vectype1) != TYPE_VECTOR_SUBPARTS (vectype2))
return false;
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
*comp_vectype = vectype1 ? vectype1 : vectype2;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
/* vectorizable_condition.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
Check if STMT is conditional modify expression that can be vectorized.
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
stmt using VEC_COND_EXPR to replace it, put it in VEC_STMT, and insert it
at GSI.
When STMT is vectorized as nested cycle, REDUC_DEF is the vector variable
to be used at REDUC_INDEX (in then clause if REDUC_INDEX is 1, and in
else clause if it is 2).
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
bool
vectorizable_condition (gimple *stmt, gimple_stmt_iterator *gsi,
gimple **vec_stmt, tree reduc_def, int reduc_index,
slp_tree slp_node)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree scalar_dest = NULL_TREE;
tree vec_dest = NULL_TREE;
tree cond_expr, cond_expr0 = NULL_TREE, cond_expr1 = NULL_TREE;
tree then_clause, else_clause;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tree comp_vectype = NULL_TREE;
tree vec_cond_lhs = NULL_TREE, vec_cond_rhs = NULL_TREE;
tree vec_then_clause = NULL_TREE, vec_else_clause = NULL_TREE;
tree vec_compare;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree new_temp;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
enum vect_def_type dt, dts[4];
int ncopies;
enum tree_code code, cond_code, bitop1 = NOP_EXPR, bitop2 = NOP_EXPR;
stmt_vec_info prev_stmt_info = NULL;
int i, j;
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
vec<tree> vec_oprnds0 = vNULL;
vec<tree> vec_oprnds1 = vNULL;
vec<tree> vec_oprnds2 = vNULL;
vec<tree> vec_oprnds3 = vNULL;
tree vec_cmp_type;
bool masked = false;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (reduc_index && STMT_SLP_TYPE (stmt_info))
return false;
if (STMT_VINFO_VEC_REDUCTION_TYPE (stmt_info) == TREE_CODE_REDUCTION)
{
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& !(STMT_VINFO_DEF_TYPE (stmt_info) == vect_nested_cycle
&& reduc_def))
return false;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* FORNOW: not yet supported. */
if (STMT_VINFO_LIVE_P (stmt_info))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"value used after loop.\n");
return false;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* Is vectorizable conditional operation? */
if (!is_gimple_assign (stmt))
return false;
code = gimple_assign_rhs_code (stmt);
if (code != COND_EXPR)
return false;
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
tree vectype1 = NULL_TREE, vectype2 = NULL_TREE;
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
if (slp_node)
ncopies = 1;
else
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
if (reduc_index && ncopies > 1)
return false; /* FORNOW */
cond_expr = gimple_assign_rhs1 (stmt);
then_clause = gimple_assign_rhs2 (stmt);
else_clause = gimple_assign_rhs3 (stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (!vect_is_simple_cond (cond_expr, stmt_info->vinfo, &comp_vectype)
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
|| !comp_vectype)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
gimple *def_stmt;
if (!vect_is_simple_use (then_clause, stmt_info->vinfo, &def_stmt, &dt,
&vectype1))
return false;
if (!vect_is_simple_use (else_clause, stmt_info->vinfo, &def_stmt, &dt,
&vectype2))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
if (vectype1 && !useless_type_conversion_p (vectype, vectype1))
return false;
if (vectype2 && !useless_type_conversion_p (vectype, vectype2))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
masked = !COMPARISON_CLASS_P (cond_expr);
vec_cmp_type = build_same_sized_truth_vector_type (comp_vectype);
if (vec_cmp_type == NULL_TREE)
return false;
cond_code = TREE_CODE (cond_expr);
if (!masked)
{
cond_expr0 = TREE_OPERAND (cond_expr, 0);
cond_expr1 = TREE_OPERAND (cond_expr, 1);
}
if (!masked && VECTOR_BOOLEAN_TYPE_P (comp_vectype))
{
/* Boolean values may have another representation in vectors
and therefore we prefer bit operations over comparison for
them (which also works for scalar masks). We store opcodes
to use in bitop1 and bitop2. Statement is vectorized as
BITOP2 (rhs1 BITOP1 rhs2) or rhs1 BITOP2 (BITOP1 rhs2)
depending on bitop1 and bitop2 arity. */
switch (cond_code)
{
case GT_EXPR:
bitop1 = BIT_NOT_EXPR;
bitop2 = BIT_AND_EXPR;
break;
case GE_EXPR:
bitop1 = BIT_NOT_EXPR;
bitop2 = BIT_IOR_EXPR;
break;
case LT_EXPR:
bitop1 = BIT_NOT_EXPR;
bitop2 = BIT_AND_EXPR;
std::swap (cond_expr0, cond_expr1);
break;
case LE_EXPR:
bitop1 = BIT_NOT_EXPR;
bitop2 = BIT_IOR_EXPR;
std::swap (cond_expr0, cond_expr1);
break;
case NE_EXPR:
bitop1 = BIT_XOR_EXPR;
break;
case EQ_EXPR:
bitop1 = BIT_XOR_EXPR;
bitop2 = BIT_NOT_EXPR;
break;
default:
return false;
}
cond_code = SSA_NAME;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (!vec_stmt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
STMT_VINFO_TYPE (stmt_info) = condition_vec_info_type;
if (bitop1 != NOP_EXPR)
{
machine_mode mode = TYPE_MODE (comp_vectype);
optab optab;
optab = optab_for_tree_code (bitop1, comp_vectype, optab_default);
if (!optab || optab_handler (optab, mode) == CODE_FOR_nothing)
return false;
if (bitop2 != NOP_EXPR)
{
optab = optab_for_tree_code (bitop2, comp_vectype,
optab_default);
if (!optab || optab_handler (optab, mode) == CODE_FOR_nothing)
return false;
}
}
return expand_vec_cond_expr_p (vectype, comp_vectype,
cond_code);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* Transform. */
if (!slp_node)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0.create (1);
vec_oprnds1.create (1);
vec_oprnds2.create (1);
vec_oprnds3.create (1);
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Handle def. */
scalar_dest = gimple_assign_lhs (stmt);
vec_dest = vect_create_destination_var (scalar_dest, vectype);
/* Handle cond expr. */
for (j = 0; j < ncopies; j++)
{
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 *new_stmt = NULL;
if (j == 0)
{
if (slp_node)
{
auto_vec<tree, 4> ops;
auto_vec<vec<tree>, 4> vec_defs;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
if (masked)
ops.safe_push (cond_expr);
else
{
ops.safe_push (cond_expr0);
ops.safe_push (cond_expr1);
}
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
ops.safe_push (then_clause);
ops.safe_push (else_clause);
vect_get_slp_defs (ops, slp_node, &vec_defs, -1);
vec_oprnds3 = vec_defs.pop ();
vec_oprnds2 = vec_defs.pop ();
if (!masked)
vec_oprnds1 = vec_defs.pop ();
vec_oprnds0 = vec_defs.pop ();
}
else
{
gimple *gtemp;
if (masked)
{
vec_cond_lhs
= vect_get_vec_def_for_operand (cond_expr, stmt,
comp_vectype);
vect_is_simple_use (cond_expr, stmt_info->vinfo,
&gtemp, &dts[0]);
}
else
{
vec_cond_lhs
= vect_get_vec_def_for_operand (cond_expr0,
stmt, comp_vectype);
vect_is_simple_use (cond_expr0, loop_vinfo, &gtemp, &dts[0]);
vec_cond_rhs
= vect_get_vec_def_for_operand (cond_expr1,
stmt, comp_vectype);
vect_is_simple_use (cond_expr1, loop_vinfo, &gtemp, &dts[1]);
}
if (reduc_index == 1)
vec_then_clause = reduc_def;
else
{
vec_then_clause = vect_get_vec_def_for_operand (then_clause,
stmt);
vect_is_simple_use (then_clause, loop_vinfo,
&gtemp, &dts[2]);
}
if (reduc_index == 2)
vec_else_clause = reduc_def;
else
{
vec_else_clause = vect_get_vec_def_for_operand (else_clause,
stmt);
vect_is_simple_use (else_clause, loop_vinfo, &gtemp, &dts[3]);
}
}
}
else
{
vec_cond_lhs
= vect_get_vec_def_for_stmt_copy (dts[0],
vec_oprnds0.pop ());
if (!masked)
vec_cond_rhs
= vect_get_vec_def_for_stmt_copy (dts[1],
vec_oprnds1.pop ());
vec_then_clause = vect_get_vec_def_for_stmt_copy (dts[2],
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds2.pop ());
vec_else_clause = vect_get_vec_def_for_stmt_copy (dts[3],
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds3.pop ());
}
if (!slp_node)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0.quick_push (vec_cond_lhs);
if (!masked)
vec_oprnds1.quick_push (vec_cond_rhs);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds2.quick_push (vec_then_clause);
vec_oprnds3.quick_push (vec_else_clause);
}
/* Arguments are ready. Create the new vector stmt. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (vec_oprnds0, i, vec_cond_lhs)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_then_clause = vec_oprnds2[i];
vec_else_clause = vec_oprnds3[i];
if (masked)
vec_compare = vec_cond_lhs;
else
{
vec_cond_rhs = vec_oprnds1[i];
if (bitop1 == NOP_EXPR)
vec_compare = build2 (cond_code, vec_cmp_type,
vec_cond_lhs, vec_cond_rhs);
else
{
new_temp = make_ssa_name (vec_cmp_type);
if (bitop1 == BIT_NOT_EXPR)
new_stmt = gimple_build_assign (new_temp, bitop1,
vec_cond_rhs);
else
new_stmt
= gimple_build_assign (new_temp, bitop1, vec_cond_lhs,
vec_cond_rhs);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (bitop2 == NOP_EXPR)
vec_compare = new_temp;
else if (bitop2 == BIT_NOT_EXPR)
{
/* Instead of doing ~x ? y : z do x ? z : y. */
vec_compare = new_temp;
std::swap (vec_then_clause, vec_else_clause);
}
else
{
vec_compare = make_ssa_name (vec_cmp_type);
new_stmt
= gimple_build_assign (vec_compare, bitop2,
vec_cond_lhs, new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
}
}
}
new_temp = make_ssa_name (vec_dest);
new_stmt = gimple_build_assign (new_temp, VEC_COND_EXPR,
vec_compare, vec_then_clause,
vec_else_clause);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (slp_node)
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
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
}
if (slp_node)
continue;
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_oprnds0.release ();
vec_oprnds1.release ();
vec_oprnds2.release ();
vec_oprnds3.release ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
/* vectorizable_comparison.
Check if STMT is comparison expression that can be vectorized.
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
comparison, put it in VEC_STMT, and insert it at GSI.
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
static bool
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
vectorizable_comparison (gimple *stmt, gimple_stmt_iterator *gsi,
gimple **vec_stmt, tree reduc_def,
slp_tree slp_node)
{
tree lhs, rhs1, rhs2;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tree vectype1 = NULL_TREE, vectype2 = NULL_TREE;
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
tree vec_rhs1 = NULL_TREE, vec_rhs2 = NULL_TREE;
tree new_temp;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
enum vect_def_type dts[2] = {vect_unknown_def_type, vect_unknown_def_type};
unsigned nunits;
int ncopies;
enum tree_code code, bitop1 = NOP_EXPR, bitop2 = NOP_EXPR;
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
stmt_vec_info prev_stmt_info = NULL;
int i, j;
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
vec<tree> vec_oprnds0 = vNULL;
vec<tree> vec_oprnds1 = vNULL;
gimple *def_stmt;
tree mask_type;
tree mask;
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
if (!vectype || !VECTOR_BOOLEAN_TYPE_P (vectype))
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
return false;
mask_type = vectype;
nunits = TYPE_VECTOR_SUBPARTS (vectype);
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
if (slp_node)
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
ncopies = 1;
else
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
&& !(STMT_VINFO_DEF_TYPE (stmt_info) == vect_nested_cycle
&& reduc_def))
return false;
if (STMT_VINFO_LIVE_P (stmt_info))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"value used after loop.\n");
return false;
}
if (!is_gimple_assign (stmt))
return false;
code = gimple_assign_rhs_code (stmt);
if (TREE_CODE_CLASS (code) != tcc_comparison)
return false;
rhs1 = gimple_assign_rhs1 (stmt);
rhs2 = gimple_assign_rhs2 (stmt);
if (!vect_is_simple_use (rhs1, stmt_info->vinfo, &def_stmt,
&dts[0], &vectype1))
return false;
if (!vect_is_simple_use (rhs2, stmt_info->vinfo, &def_stmt,
&dts[1], &vectype2))
return false;
if (vectype1 && vectype2
&& TYPE_VECTOR_SUBPARTS (vectype1) != TYPE_VECTOR_SUBPARTS (vectype2))
return false;
vectype = vectype1 ? vectype1 : vectype2;
/* Invariant comparison. */
if (!vectype)
{
vectype = get_vectype_for_scalar_type (TREE_TYPE (rhs1));
if (TYPE_VECTOR_SUBPARTS (vectype) != nunits)
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
return false;
}
else if (nunits != TYPE_VECTOR_SUBPARTS (vectype))
return false;
/* Can't compare mask and non-mask types. */
if (vectype1 && vectype2
&& (VECTOR_BOOLEAN_TYPE_P (vectype1) ^ VECTOR_BOOLEAN_TYPE_P (vectype2)))
return false;
/* Boolean values may have another representation in vectors
and therefore we prefer bit operations over comparison for
them (which also works for scalar masks). We store opcodes
to use in bitop1 and bitop2. Statement is vectorized as
BITOP2 (rhs1 BITOP1 rhs2) or
rhs1 BITOP2 (BITOP1 rhs2)
depending on bitop1 and bitop2 arity. */
if (VECTOR_BOOLEAN_TYPE_P (vectype))
{
if (code == GT_EXPR)
{
bitop1 = BIT_NOT_EXPR;
bitop2 = BIT_AND_EXPR;
}
else if (code == GE_EXPR)
{
bitop1 = BIT_NOT_EXPR;
bitop2 = BIT_IOR_EXPR;
}
else if (code == LT_EXPR)
{
bitop1 = BIT_NOT_EXPR;
bitop2 = BIT_AND_EXPR;
std::swap (rhs1, rhs2);
std::swap (dts[0], dts[1]);
}
else if (code == LE_EXPR)
{
bitop1 = BIT_NOT_EXPR;
bitop2 = BIT_IOR_EXPR;
std::swap (rhs1, rhs2);
std::swap (dts[0], dts[1]);
}
else
{
bitop1 = BIT_XOR_EXPR;
if (code == EQ_EXPR)
bitop2 = BIT_NOT_EXPR;
}
}
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
if (!vec_stmt)
{
STMT_VINFO_TYPE (stmt_info) = comparison_vec_info_type;
vect_model_simple_cost (stmt_info, ncopies * (1 + (bitop2 != NOP_EXPR)),
dts, NULL, NULL);
if (bitop1 == NOP_EXPR)
return expand_vec_cmp_expr_p (vectype, mask_type, code);
else
{
machine_mode mode = TYPE_MODE (vectype);
optab optab;
optab = optab_for_tree_code (bitop1, vectype, optab_default);
if (!optab || optab_handler (optab, mode) == CODE_FOR_nothing)
return false;
if (bitop2 != NOP_EXPR)
{
optab = optab_for_tree_code (bitop2, vectype, optab_default);
if (!optab || optab_handler (optab, mode) == CODE_FOR_nothing)
return false;
}
return true;
}
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
}
/* Transform. */
if (!slp_node)
{
vec_oprnds0.create (1);
vec_oprnds1.create (1);
}
/* Handle def. */
lhs = gimple_assign_lhs (stmt);
mask = vect_create_destination_var (lhs, mask_type);
/* Handle cmp expr. */
for (j = 0; j < ncopies; j++)
{
gassign *new_stmt = NULL;
if (j == 0)
{
if (slp_node)
{
auto_vec<tree, 2> ops;
auto_vec<vec<tree>, 2> vec_defs;
ops.safe_push (rhs1);
ops.safe_push (rhs2);
vect_get_slp_defs (ops, slp_node, &vec_defs, -1);
vec_oprnds1 = vec_defs.pop ();
vec_oprnds0 = vec_defs.pop ();
}
else
{
vec_rhs1 = vect_get_vec_def_for_operand (rhs1, stmt, vectype);
vec_rhs2 = vect_get_vec_def_for_operand (rhs2, stmt, vectype);
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
}
}
else
{
vec_rhs1 = vect_get_vec_def_for_stmt_copy (dts[0],
vec_oprnds0.pop ());
vec_rhs2 = vect_get_vec_def_for_stmt_copy (dts[1],
vec_oprnds1.pop ());
}
if (!slp_node)
{
vec_oprnds0.quick_push (vec_rhs1);
vec_oprnds1.quick_push (vec_rhs2);
}
/* Arguments are ready. Create the new vector stmt. */
FOR_EACH_VEC_ELT (vec_oprnds0, i, vec_rhs1)
{
vec_rhs2 = vec_oprnds1[i];
new_temp = make_ssa_name (mask);
if (bitop1 == NOP_EXPR)
{
new_stmt = gimple_build_assign (new_temp, code,
vec_rhs1, vec_rhs2);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
}
else
{
if (bitop1 == BIT_NOT_EXPR)
new_stmt = gimple_build_assign (new_temp, bitop1, vec_rhs2);
else
new_stmt = gimple_build_assign (new_temp, bitop1, vec_rhs1,
vec_rhs2);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (bitop2 != NOP_EXPR)
{
tree res = make_ssa_name (mask);
if (bitop2 == BIT_NOT_EXPR)
new_stmt = gimple_build_assign (res, bitop2, new_temp);
else
new_stmt = gimple_build_assign (res, bitop2, vec_rhs1,
new_temp);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
}
}
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
if (slp_node)
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
}
if (slp_node)
continue;
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
vec_oprnds0.release ();
vec_oprnds1.release ();
return true;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
/* Make sure the statement is vectorizable. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
bool
vect_analyze_stmt (gimple *stmt, bool *need_to_vectorize, slp_tree node)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
enum vect_relevant relevance = STMT_VINFO_RELEVANT (stmt_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
bool ok;
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
tree scalar_type, vectype;
gimple *pattern_stmt;
gimple_seq pattern_def_seq;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (dump_enabled_p ())
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location, "==> examining statement: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (gimple_has_volatile_ops (stmt))
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"not vectorized: stmt has volatile operands\n");
return false;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Skip stmts that do not need to be vectorized. In loops this is expected
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
to include:
- the COND_EXPR which is the loop exit condition
- any LABEL_EXPRs in the loop
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
- computations that are used only for array indexing or loop control.
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
In basic blocks we only analyze statements that are a part of some SLP
instance, therefore, all the statements are relevant.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
re PR tree-optimization/50912 (gimple assertion failure at gimple.h:1940 with -msse2) PR tree-optimization/50912 * tree-vectorizer.h (slp_void_p): New. (struct _slp_tree): Replace left and right with children. Update documentation. (struct _slp_oprnd_info): New. (vect_get_vec_defs): Declare. (vect_get_slp_defs): Update arguments. * tree-vect-loop.c (vect_create_epilog_for_reduction): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Remove static, add argument. Update call to vect_get_slp_defs. (vectorizable_conversion): Update call to vect_get_vec_defs. (vectorizable_assignment, vectorizable_shift, vectorizable_operation): Likewise. (vectorizable_type_demotion): Call vect_get_vec_defs instead of vect_get_slp_defs. (vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Fix typo. * tree-vect-slp.c (vect_free_slp_tree): Update SLP tree traversal. (vect_print_slp_tree, vect_mark_slp_stmts, vect_mark_slp_stmts_relevant, vect_slp_rearrange_stmts, vect_detect_hybrid_slp_stmts, vect_slp_analyze_node_operations, vect_schedule_slp_instance): Likewise. (vect_create_new_slp_node): New. (vect_create_oprnd_info, vect_free_oprnd_info): Likewise. (vect_get_and_check_slp_defs): Pass information about defs using oprnds_info, allow any number of operands. (vect_build_slp_tree): Likewise. Update calls to vect_get_and_check_slp_defs. Fix comments. (vect_analyze_slp_instance): Move node creation to vect_create_new_slp_node. (vect_get_slp_defs): Allow any number of operands. From-SVN: r180819
2011-11-03 09:44:35 +01:00
Pattern statement needs to be analyzed instead of the original statement
if the original statement is not relevant. Otherwise, we analyze both
statements. In basic blocks we are called from some SLP instance
traversal, don't analyze pattern stmts instead, the pattern stmts
already will be part of SLP instance. */
pattern_stmt = STMT_VINFO_RELATED_STMT (stmt_info);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (!STMT_VINFO_RELEVANT_P (stmt_info)
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
&& !STMT_VINFO_LIVE_P (stmt_info))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (STMT_VINFO_IN_PATTERN_P (stmt_info)
&& pattern_stmt
&& (STMT_VINFO_RELEVANT_P (vinfo_for_stmt (pattern_stmt))
|| STMT_VINFO_LIVE_P (vinfo_for_stmt (pattern_stmt))))
{
/* Analyze PATTERN_STMT instead of the original stmt. */
stmt = pattern_stmt;
stmt_info = vinfo_for_stmt (pattern_stmt);
if (dump_enabled_p ())
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"==> examining pattern statement: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
}
}
else
{
if (dump_enabled_p ())
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf_loc (MSG_NOTE, vect_location, "irrelevant.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
}
else if (STMT_VINFO_IN_PATTERN_P (stmt_info)
&& node == NULL
&& pattern_stmt
&& (STMT_VINFO_RELEVANT_P (vinfo_for_stmt (pattern_stmt))
|| STMT_VINFO_LIVE_P (vinfo_for_stmt (pattern_stmt))))
{
/* Analyze PATTERN_STMT too. */
if (dump_enabled_p ())
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"==> examining pattern statement: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
}
if (!vect_analyze_stmt (pattern_stmt, need_to_vectorize, node))
return false;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (is_pattern_stmt_p (stmt_info)
&& node == NULL
&& (pattern_def_seq = STMT_VINFO_PATTERN_DEF_SEQ (stmt_info)))
{
gimple_stmt_iterator si;
for (si = gsi_start (pattern_def_seq); !gsi_end_p (si); gsi_next (&si))
{
gimple *pattern_def_stmt = gsi_stmt (si);
if (STMT_VINFO_RELEVANT_P (vinfo_for_stmt (pattern_def_stmt))
|| STMT_VINFO_LIVE_P (vinfo_for_stmt (pattern_def_stmt)))
{
/* Analyze def stmt of STMT if it's a pattern stmt. */
if (dump_enabled_p ())
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"==> examining pattern def statement: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_def_stmt, 0);
}
if (!vect_analyze_stmt (pattern_def_stmt,
need_to_vectorize, node))
return false;
}
}
}
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
switch (STMT_VINFO_DEF_TYPE (stmt_info))
{
case vect_internal_def:
break;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
case vect_reduction_def:
2009-06-16 09:21:12 +02:00
case vect_nested_cycle:
gcc_assert (!bb_vinfo
&& (relevance == vect_used_in_outer
|| relevance == vect_used_in_outer_by_reduction
|| relevance == vect_used_by_reduction
|| relevance == vect_unused_in_scope
|| relevance == vect_used_only_live));
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
break;
case vect_induction_def:
case vect_constant_def:
case vect_external_def:
case vect_unknown_def_type:
default:
gcc_unreachable ();
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
if (bb_vinfo)
{
gcc_assert (PURE_SLP_STMT (stmt_info));
/* Memory accesses already got their vector type assigned
in vect_analyze_data_refs. */
if (! STMT_VINFO_DATA_REF (stmt_info))
{
scalar_type = TREE_TYPE (gimple_get_lhs (stmt));
if (dump_enabled_p ())
{
dump_printf_loc (MSG_NOTE, vect_location,
"get vectype for scalar type: ");
dump_generic_expr (MSG_NOTE, TDF_SLIM, scalar_type);
dump_printf (MSG_NOTE, "\n");
}
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
vectype = get_vectype_for_scalar_type (scalar_type);
if (!vectype)
{
if (dump_enabled_p ())
{
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"not SLPed: unsupported data-type ");
dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
scalar_type);
dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
if (dump_enabled_p ())
{
dump_printf_loc (MSG_NOTE, vect_location, "vectype: ");
dump_generic_expr (MSG_NOTE, TDF_SLIM, vectype);
dump_printf (MSG_NOTE, "\n");
}
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
STMT_VINFO_VECTYPE (stmt_info) = vectype;
}
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
}
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
if (STMT_VINFO_RELEVANT_P (stmt_info))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
gcc_assert (!VECTOR_MODE_P (TYPE_MODE (gimple_expr_type (stmt))));
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
gcc_assert (STMT_VINFO_VECTYPE (stmt_info)
|| (is_gimple_call (stmt)
&& gimple_call_lhs (stmt) == NULL_TREE));
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
*need_to_vectorize = true;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
if (PURE_SLP_STMT (stmt_info) && !node)
{
dump_printf_loc (MSG_NOTE, vect_location,
"handled only by SLP analysis\n");
return true;
}
ok = true;
if (!bb_vinfo
&& (STMT_VINFO_RELEVANT_P (stmt_info)
|| STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def))
ok = (vectorizable_simd_clone_call (stmt, NULL, NULL, node)
|| vectorizable_conversion (stmt, NULL, NULL, node)
|| vectorizable_shift (stmt, NULL, NULL, node)
|| vectorizable_operation (stmt, NULL, NULL, node)
|| vectorizable_assignment (stmt, NULL, NULL, node)
|| vectorizable_load (stmt, NULL, NULL, node, NULL)
|| vectorizable_call (stmt, NULL, NULL, node)
|| vectorizable_store (stmt, NULL, NULL, node)
|| vectorizable_reduction (stmt, NULL, NULL, node)
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
|| vectorizable_condition (stmt, NULL, NULL, NULL, 0, node)
|| vectorizable_comparison (stmt, NULL, NULL, NULL, node));
else
{
if (bb_vinfo)
ok = (vectorizable_simd_clone_call (stmt, NULL, NULL, node)
|| vectorizable_conversion (stmt, NULL, NULL, node)
|| vectorizable_shift (stmt, NULL, NULL, node)
|| vectorizable_operation (stmt, NULL, NULL, node)
|| vectorizable_assignment (stmt, NULL, NULL, node)
|| vectorizable_load (stmt, NULL, NULL, node, NULL)
|| vectorizable_call (stmt, NULL, NULL, node)
|| vectorizable_store (stmt, NULL, NULL, node)
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
|| vectorizable_condition (stmt, NULL, NULL, NULL, 0, node)
|| vectorizable_comparison (stmt, NULL, NULL, NULL, node));
}
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
if (!ok)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"not vectorized: relevant stmt not ");
dump_printf (MSG_MISSED_OPTIMIZATION, "supported: ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
if (bb_vinfo)
return true;
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
/* Stmts that are (also) "live" (i.e. - that are used out of the loop)
need extra handling, except for vectorizable reductions. */
if (STMT_VINFO_LIVE_P (stmt_info)
&& STMT_VINFO_TYPE (stmt_info) != reduc_vec_info_type)
ok = vectorizable_live_operation (stmt, NULL, NULL, -1, NULL);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
if (!ok)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"not vectorized: live stmt not ");
dump_printf (MSG_MISSED_OPTIMIZATION, "supported: ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
return false;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
return true;
}
/* Function vect_transform_stmt.
Create a vectorized stmt to replace STMT, and insert it at BSI. */
bool
vect_transform_stmt (gimple *stmt, gimple_stmt_iterator *gsi,
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
bool *grouped_store, slp_tree slp_node,
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
slp_instance slp_node_instance)
{
bool is_store = false;
gimple *vec_stmt = NULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
bool done;
Clean up PURE_SLP_STMT handling The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-24 16:05:20 +02:00
gcc_assert (slp_node || !PURE_SLP_STMT (stmt_info));
gimple *old_vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
switch (STMT_VINFO_TYPE (stmt_info))
{
case type_demotion_vec_info_type:
case type_promotion_vec_info_type:
case type_conversion_vec_info_type:
done = vectorizable_conversion (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
break;
case induc_vec_info_type:
gcc_assert (!slp_node);
done = vectorizable_induction (stmt, gsi, &vec_stmt);
gcc_assert (done);
break;
case shift_vec_info_type:
done = vectorizable_shift (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
break;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
case op_vec_info_type:
done = vectorizable_operation (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
break;
case assignment_vec_info_type:
done = vectorizable_assignment (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
break;
case load_vec_info_type:
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
done = vectorizable_load (stmt, gsi, &vec_stmt, slp_node,
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
slp_node_instance);
gcc_assert (done);
break;
case store_vec_info_type:
done = vectorizable_store (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
if (STMT_VINFO_GROUPED_ACCESS (stmt_info) && !slp_node)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
/* In case of interleaving, the whole chain is vectorized when the
last store in the chain is reached. Store stmts before the last
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
one are skipped, and there vec_stmt_info shouldn't be freed
meanwhile. */
tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. * tree-vectorizer.h (_loop_vec_info.strided_stores): Rename to grouped_stores. (LOOP_VINFO_STRIDED_STORES): Rename to LOOP_VINFO_GROUPED_STORES. (struce _bb_vec_info.strided_stores): Rename to grouped_stores. (BB_VINFO_STRIDED_STORES): Rename to BB_VINFO_GROUPED_STORES. (STMT_VINFO_STRIDED_ACCESS): Rename to STMT_VINFO_GROUPED_ACCESS. (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Rename use of above macros. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_peeling_hash_get_lowest_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto and rename stride to groupsize. (vect_analyze_data_ref_access): Rename "strided" to "grouped". (vect_strided_store_supported): Rename to vect_grouped_store_supported. (vect_strided_load_supported): Rename to vect_grouped_load_supported. (vect_transform_strided_load): Rename to vect_transform_grouped_load. (vect_record_strided_load_vectors): Rename to vect_record_grouped_load_vectors. * tree-vect-loop.c (new_loop_vec_info): Rename use of above macros. (destroy_loop_vec_info): Ditto. (vect_transform_loop): Ditto and rename strided_store to grouped_store. * tree-vect-slp.c (vect_build_slp_tree): Rename use of above macros. (vect_analyze_slp): Ditto. (new_bb_vec_info): Ditto. (destroy_bb_vec_info): Ditto. (vect_schedule_slp_instance): Ditto and rename strided_store to grouped_store. * tree-vect-stmts.c (vect_cost_strided_group_size): Rename to vect_cost_group_size. (vect_model_store_cost): Rename use of above macros and call to vect_cost_strided_group_size. (vect_model_load_cost): Ditto. (vectorizable_store): Ditto, rename strided_store to grouped_store and calls to renamed tree-vectorizer.h functions. (vectorizable_load): Ditto. (vect_transform_stmt): Rename use of above macros and strided_store to grouped_store. testsuite/ * gcc.dg/vect/vect-outer-1-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1.c: Adjust. * gcc.dg/vect/vect-outer-1a-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1a.c: Adjust. * gcc.dg/vect/vect-outer-1b-big-array.c: Adjust. * gcc.dg/vect/vect-outer-1b.c: Adjust. * gcc.dg/vect/vect-outer-2b.c: Adjust. * gcc.dg/vect/vect-outer-3b.c: Adjust. From-SVN: r186285
2012-04-10 18:09:03 +02:00
*grouped_store = true;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (STMT_VINFO_VEC_STMT (stmt_info))
is_store = true;
}
else
is_store = true;
break;
case condition_vec_info_type:
done = vectorizable_condition (stmt, gsi, &vec_stmt, NULL, 0, slp_node);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gcc_assert (done);
break;
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
case comparison_vec_info_type:
done = vectorizable_comparison (stmt, gsi, &vec_stmt, NULL, slp_node);
gcc_assert (done);
break;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
case call_vec_info_type:
done = vectorizable_call (stmt, gsi, &vec_stmt, slp_node);
stmt = gsi_stmt (*gsi);
if (gimple_call_internal_p (stmt, IFN_MASK_STORE))
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
is_store = true;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
case call_simd_clone_vec_info_type:
done = vectorizable_simd_clone_call (stmt, gsi, &vec_stmt, slp_node);
stmt = gsi_stmt (*gsi);
break;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
case reduc_vec_info_type:
re PR tree-optimization/37027 (SLP loop vectorization missing support for reductions) PR tree-optimization/37027 * tree-vectorizer.h (struct _loop_vec_info): Add new field reductions and macro to access it. (vectorizable_reduction): Add argument. (vect_get_slp_defs): Likewise. * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Collect reduction statements for possible use in SLP. (new_loop_vec_info): Initialize LOOP_VINFO_REDUCTIONS. (destroy_loop_vec_info): Free LOOP_VINFO_REDUCTIONS. (vect_create_epilog_for_reduction): Handle SLP. Modify documentation, add new argument. (vectorizable_reduction): Likewise. * tree-vect-stmts.c (vect_get_vec_defs): Update call to vect_get_slp_defs. (vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store): Likewise. (vect_analyze_stmt): Update call to vectorizable_reduction. (vect_transform_stmt): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs): Handle reduction. (vect_build_slp_tree): Fix indentation. Check that there are no loads from different interleaving chains in same node. (vect_slp_rearrange_stmts): New function. (vect_supported_load_permutation_p): Allow load permutations for reductions. Call vect_slp_rearrange_stmts() to rearrange statements inside SLP nodes if necessary. (vect_analyze_slp_instance): Handle reductions. (vect_analyze_slp): Try to build SLP instances originating from groups of reductions. (vect_detect_hybrid_slp_stmts): Skip reduction statements. (vect_get_constant_vectors): Create initial vectors for reductions according to reduction code. Add new argument. (vect_get_slp_defs): Add new argument, pass it to vect_get_constant_vectors. (vect_schedule_slp_instance): Remove SLP tree root statements. From-SVN: r158506
2010-04-19 11:10:45 +02:00
done = vectorizable_reduction (stmt, gsi, &vec_stmt, slp_node);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gcc_assert (done);
break;
default:
if (!STMT_VINFO_LIVE_P (stmt_info))
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"stmt not supported.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gcc_unreachable ();
}
}
/* Verify SLP vectorization doesn't mess with STMT_VINFO_VEC_STMT.
This would break hybrid SLP vectorization. */
if (slp_node)
gcc_assert (!vec_stmt
&& STMT_VINFO_VEC_STMT (stmt_info) == old_vec_stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Handle inner-loop stmts whose DEF is used in the loop-nest that
is being vectorized, but outside the immediately enclosing loop. */
if (vec_stmt
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
&& STMT_VINFO_LOOP_VINFO (stmt_info)
&& nested_in_vect_loop_p (LOOP_VINFO_LOOP (
STMT_VINFO_LOOP_VINFO (stmt_info)), stmt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
&& STMT_VINFO_TYPE (stmt_info) != reduc_vec_info_type
&& (STMT_VINFO_RELEVANT (stmt_info) == vect_used_in_outer
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
|| STMT_VINFO_RELEVANT (stmt_info) ==
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
vect_used_in_outer_by_reduction))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
struct loop *innerloop = LOOP_VINFO_LOOP (
STMT_VINFO_LOOP_VINFO (stmt_info))->inner;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
imm_use_iterator imm_iter;
use_operand_p use_p;
tree scalar_dest;
gimple *exit_phi;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"Record the vdef for outer-loop vectorization.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Find the relevant loop-exit phi-node, and reord the vec_stmt there
(to be used when vectorizing outer-loop stmts that use the DEF of
STMT). */
if (gimple_code (stmt) == GIMPLE_PHI)
scalar_dest = PHI_RESULT (stmt);
else
scalar_dest = gimple_assign_lhs (stmt);
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, scalar_dest)
{
if (!flow_bb_inside_loop_p (innerloop, gimple_bb (USE_STMT (use_p))))
{
exit_phi = USE_STMT (use_p);
STMT_VINFO_VEC_STMT (vinfo_for_stmt (exit_phi)) = vec_stmt;
}
}
}
/* Handle stmts whose DEF is used outside the loop-nest that is
being vectorized. */
if (slp_node)
{
gimple *slp_stmt;
int i;
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (slp_node), i, slp_stmt)
{
stmt_vec_info slp_stmt_info = vinfo_for_stmt (slp_stmt);
if (STMT_VINFO_LIVE_P (slp_stmt_info)
&& STMT_VINFO_TYPE (slp_stmt_info) != reduc_vec_info_type)
{
done = vectorizable_live_operation (slp_stmt, gsi, slp_node, i,
&vec_stmt);
gcc_assert (done);
}
}
}
else if (STMT_VINFO_LIVE_P (stmt_info)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
&& STMT_VINFO_TYPE (stmt_info) != reduc_vec_info_type)
{
done = vectorizable_live_operation (stmt, gsi, slp_node, -1, &vec_stmt);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gcc_assert (done);
}
if (vec_stmt)
STMT_VINFO_VEC_STMT (stmt_info) = vec_stmt;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
return is_store;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Remove a group of stores (for SLP or interleaving), free their
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
stmt_vec_info. */
void
vect_remove_stores (gimple *first_stmt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
gimple *next = first_stmt;
gimple *tmp;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gimple_stmt_iterator next_si;
while (next)
{
stmt_vec_info stmt_info = vinfo_for_stmt (next);
tmp = GROUP_NEXT_ELEMENT (stmt_info);
if (is_pattern_stmt_p (stmt_info))
next = STMT_VINFO_RELATED_STMT (stmt_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Free the attached stmt_vec_info and remove the stmt. */
next_si = gsi_for_stmt (next);
unlink_stmt_vdef (next);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
gsi_remove (&next_si, true);
release_defs (next);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
free_stmt_vec_info (next);
next = tmp;
}
}
/* Function new_stmt_vec_info.
Create and initialize a new stmt_vec_info struct for STMT. */
stmt_vec_info
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
new_stmt_vec_info (gimple *stmt, vec_info *vinfo)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
stmt_vec_info res;
res = (stmt_vec_info) xcalloc (1, sizeof (struct _stmt_vec_info));
STMT_VINFO_TYPE (res) = undef_vec_info_type;
STMT_VINFO_STMT (res) = stmt;
tree-vectorizer.h (vec_info): New base class for... 2015-10-06 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vec_info): New base class for... (_loop_vec_info): ... this and ... (_bb_vec_info): ... this. (vect_is_simple_use, vect_is_simple_use_1, new_stmt_vec_info, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp, vect_pattern_recog, vect_destroy_datarefs): Adjust interface to take a vec_info * rather than both a loop_vec_info and a bb_vec_info argument. * tree-vect-data-refs.c (vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_create_data_ref_ptr): Adjust accordingly. * tree-vect-loop.c (new_loop_vec_info): Initialize base class. (destroy_loop_vec_info, vect_analyze_loop_2, vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Adjust. * tree-vect-patterns.c (type_conversion_p, vect_recog_widen_mult_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, check_bool_pattern, vect_recog_bool_pattern, vect_mark_pattern_stmts, vect_pattern_recog): Likewise. * tree-vect-slp.c (vect_get_and_check_slp_defs, vect_build_slp_tree_1, vect_build_slp_tree, vect_analyze_slp_cost_1, vect_analyze_slp_instance, vect_analyze_slp, destroy_bb_vec_info, vect_slp_analyze_bb_1, vect_schedule_slp): Likewise. (new_bb_vec_info): Initialize base classs. * tree-vect-stmts.c (record_stmt_cost, process_use, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_assignment, vectorizable_shift, vectorizable_operation, vectorizable_store, vectorizable_load, vect_is_simple_cond, vectorizable_condition, new_stmt_vec_info, vect_is_simple_use, vect_is_simple_use_1): Likewise. * tree-vectorizer.c (vect_destroy_datarefs): Likewise. From-SVN: r228514
2015-10-06 09:52:03 +02:00
res->vinfo = vinfo;
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
STMT_VINFO_RELEVANT (res) = vect_unused_in_scope;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
STMT_VINFO_LIVE_P (res) = false;
STMT_VINFO_VECTYPE (res) = NULL;
STMT_VINFO_VEC_STMT (res) = NULL;
STMT_VINFO_VECTORIZABLE (res) = true;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
STMT_VINFO_IN_PATTERN_P (res) = false;
STMT_VINFO_RELATED_STMT (res) = NULL;
STMT_VINFO_PATTERN_DEF_SEQ (res) = NULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
STMT_VINFO_DATA_REF (res) = NULL;
STMT_VINFO_VEC_REDUCTION_TYPE (res) = TREE_CODE_REDUCTION;
STMT_VINFO_VEC_CONST_COND_REDUC_CODE (res) = ERROR_MARK;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
STMT_VINFO_DR_BASE_ADDRESS (res) = NULL;
STMT_VINFO_DR_OFFSET (res) = NULL;
STMT_VINFO_DR_INIT (res) = NULL;
STMT_VINFO_DR_STEP (res) = NULL;
STMT_VINFO_DR_ALIGNED_TO (res) = NULL;
if (gimple_code (stmt) == GIMPLE_PHI
&& is_loop_header_bb_p (gimple_bb (stmt)))
STMT_VINFO_DEF_TYPE (res) = vect_unknown_def_type;
else
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
STMT_VINFO_DEF_TYPE (res) = vect_internal_def;
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
STMT_VINFO_SAME_ALIGN_REFS (res).create (0);
combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. gcc/: * combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. (record_dead_and_set_regs): Likewise. * df.h (struct df_mw_hardreg): Change flags field to int. (struct df_base_ref): Likewise. (struct df): Change changeable_flags field to int. * df-scan.c (df_defs_record): Change clobber_flags to int. * dwarf2.h (enum dwarf_tag): Make lo_user and hi_user values enum constants rather than #define macros. (enum dwarf_attribute, enum dwarf_location_atom): Likewise. (enum dwarf_type, enum dwarf_endianity_encoding): Likewise. (enum dwarf_calling_convention): Likewise. (enum dwarf_line_number_x_ops): Likewise. (enum dwarf_call_frame_info): Likewise. (enum dwarf_source_language): Likewise. * dwarf2out.c (int_loc_descriptor): Add cast to enum type. (add_calling_convention_attribute): Likewise. * fold-const.c (fold_undefer_overflow_warnings): Add cast to enum type. (combine_comparisons): Change compcode to int. Add cast to enum type. * genrecog.c (maybe_both_true_2): Change c to int. (write_switch): Likewise. Add cast to enum type. * gimplify.c (gimplify_omp_for): Handle return values from gimplify_expr using MIN rather than bitwise or. (gimplify_expr): Add cast to enum type. * ipa-prop.c (update_jump_functions_after_inlining): Change IPA_BOTTOM to IPA_JF_UNKNOWN. * ira.c (setup_class_subset_and_memory_move_costs): Change mode to int. Add casts to enum type. (setup_cover_and_important_classes): Change cl to int. Add casts to enum type. (setup_class_translate): Change cl and mode to int. (ira_init_once): Change mode to int. (free_register_move_costs): Likewise. (setup_prohibited_mode_move_regs): Add casts to enum type. * langhooks.c (add_builtin_function_common): Rework assertion that value fits bitfield. * mcf.c (add_fixup_edge): Change type parameter to edge_type. * omega.c (omega_do_elimination): Avoid math on enum types. * optabs.c (expand_vec_shift_expr): Remove casts to int. * opts.c (set_debug_level): Change 2 to enum constant. Use new int local to handle integral_argment value. * regmove.c (try_auto_increment): Change PUT_MODE to PUT_REG_NOTE_KIND. * reload.c (push_secondary_reload): Add casts to enum type. (secondary_reload_class, find_valid_class): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * rtl.h (NOTE_VAR_LOCATION_STATUS): Likewise. * sel-sched.c (init_hard_regs_data): Change cur_mode to int. * sel-sched-ir.c (hash_with_unspec_callback): Change 0 to enum constant. * tree.c (build_common_builtin_nodes): Add casts to enum type. * tree-complex.c (complex_lattice_t): Typedef to int rather than enum type. (expand_complex_libcall): Add casts to enum type. * tree-into-ssa.c (get_ssa_name_ann): Change 0 to enum constant. * tree-vect-loop.c (vect_model_reduction_cost): Compare reduc_code with ERROR_MARK, not NUM_TREE_CODES. (vect_create_epilog_for_reduction): Likewise. (vectorizable_reduction): Don't initialize epiloc_reduc_code. When not using it, set it to ERROR_MARK rather than NUM_TREE_CODES. * tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to enum machine_mode. * tree-vect-stmts.c (new_stmt_vec_info): Change 0 to vect_unused_in_loop. Change 0 to loop_vect. * tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum type. * var-tracking.c (get_init_value): Change return type to enum var_init_status. * vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T. * config/arm/arm.c (fp_model_for_fpu): Change to array to enum arm_fp_model. (arm_override_options): Add casts to enum type. (arm_emit_tls_decoration): Likewise. * config/i386/i386.c (ix86_function_specific_restore): Add casts to enum type. * config/i386/i386-c.c (ix86_pragma_target_parse): Likewise. * config/ia64/ia64.c (ia64_expand_compare): Change magic to int. * config/rs6000/rs6000.c (rs6000_override_options): Add casts to enum type. * config/s390/s390.c (code_for_builtin_64): Change to array of enum insn_code. (code_for_builtin_31): Likewise. (s390_expand_builtin): Change code_for_builtin to enum insn_code const *. * config/sparc/sparc.c (sparc_override_options): Change value field in struct code_model to enum cmodel. In initializer change 0 to NULL and add cast to enum type. * c-typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. Issue a -Wc++-compat warning using lhs_origtype if necessary. (convert_for_assignment): Issue -Wc++-compat warnings about invalid conversions to enum type on assignment. * c-common.h (build_modify_expr): Update declaration. gcc/cp/: * call.c (build_temp): Change 0 to enum constant. * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum type. * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type. * decl2.c (constrain_visibility): Likewise. * parser.c (cp_lexer_get_preprocessor_token): Likewise. (cp_parser_flags): Typedef to int rather than enum type. (cp_parser_expression_stack_entry): Change prec field to enum cp_parser_prec. * typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. gcc/fortran/: * gfortran.h (enum gfc_symbol_type): New named enum type, broken out of struct gfc_symbol. (struct gfc_symbol): Use enum gfc_symbol_type. (enum gfc_array_ref_dimen_type): New named enum type, broken out of struct gfc_array_ref). (struct gfc_array_ref): Use enum gfc_array_ref_dimen_type. (mod_pointee_as): Update declaration. * decl.c (add_global_entry): Change type to enum gfc_symbol_type. (gfc_mod_pointee_as): Change return type to "match". * module.c (mio_array_ref): Add cast to enum type. (mio_symbol): Likewise. * resolve.c (resolve_global_procedure): Change type to enum gfc_symbol_type. * trans-io.c (gfc_build_st_parameter): Change type to unsigned int. gcc/java/: * jcf-parse.c (handle_constant): Add cast to enum type. gcc/objc/: * objc-act.c (get_super_receiver): Update calls to build_modify_expr to pass new argument. gcc/testsuite/: * gcc.dg/Wcxx-compat-4.c: New testcase. From-SVN: r146735
2009-04-24 17:31:38 +02:00
STMT_SLP_TYPE (res) = loop_vect;
STMT_VINFO_NUM_SLP_USES (res) = 0;
GROUP_FIRST_ELEMENT (res) = NULL;
GROUP_NEXT_ELEMENT (res) = NULL;
GROUP_SIZE (res) = 0;
GROUP_STORE_COUNT (res) = 0;
GROUP_GAP (res) = 0;
GROUP_SAME_DR_STMT (res) = NULL;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return res;
}
/* Create a hash table for stmt_vec_info. */
void
init_stmt_vec_info_vec (void)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
gcc_assert (!stmt_vec_info_vec.exists ());
stmt_vec_info_vec.create (50);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* Free hash table for stmt_vec_info. */
void
free_stmt_vec_info_vec (void)
{
unsigned int i;
stmt_vec_info info;
FOR_EACH_VEC_ELT (stmt_vec_info_vec, i, info)
if (info != NULL)
free_stmt_vec_info (STMT_VINFO_STMT (info));
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
gcc_assert (stmt_vec_info_vec.exists ());
stmt_vec_info_vec.release ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* Free stmt vectorization related info. */
void
free_stmt_vec_info (gimple *stmt)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
if (!stmt_info)
return;
/* Check if this statement has a related "pattern stmt"
(introduced by the vectorizer during the pattern recognition
pass). Free pattern's stmt_vec_info and def stmt's stmt_vec_info
too. */
if (STMT_VINFO_IN_PATTERN_P (stmt_info))
{
stmt_vec_info patt_info
= vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_info));
if (patt_info)
{
gimple_seq seq = STMT_VINFO_PATTERN_DEF_SEQ (patt_info);
gimple *patt_stmt = STMT_VINFO_STMT (patt_info);
gimple_set_bb (patt_stmt, NULL);
tree lhs = gimple_get_lhs (patt_stmt);
if (lhs && TREE_CODE (lhs) == SSA_NAME)
release_ssa_name (lhs);
if (seq)
{
gimple_stmt_iterator si;
for (si = gsi_start (seq); !gsi_end_p (si); gsi_next (&si))
{
gimple *seq_stmt = gsi_stmt (si);
gimple_set_bb (seq_stmt, NULL);
lhs = gimple_get_lhs (seq_stmt);
if (lhs && TREE_CODE (lhs) == SSA_NAME)
release_ssa_name (lhs);
free_stmt_vec_info (seq_stmt);
}
}
free_stmt_vec_info (patt_stmt);
}
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
STMT_VINFO_SAME_ALIGN_REFS (stmt_info).release ();
STMT_VINFO_SIMD_CLONE_INFO (stmt_info).release ();
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
set_vinfo_for_stmt (stmt, NULL);
free (stmt_info);
}
/* Function get_vectype_for_scalar_type_and_size.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Returns the vector type corresponding to SCALAR_TYPE and SIZE as supported
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
by the target. */
static tree
get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
tree orig_scalar_type = scalar_type;
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 inner_mode = TYPE_MODE (scalar_type);
machine_mode simd_mode;
unsigned int nbytes = GET_MODE_SIZE (inner_mode);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
int nunits;
tree vectype;
if (nbytes == 0)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return NULL_TREE;
if (GET_MODE_CLASS (inner_mode) != MODE_INT
&& GET_MODE_CLASS (inner_mode) != MODE_FLOAT)
return NULL_TREE;
/* For vector types of elements whose mode precision doesn't
match their types precision we use a element type of mode
precision. The vectorization routines will have to make sure
they support the proper result truncation/extension.
We also make sure to build vector types with INTEGER_TYPE
component type only. */
if (INTEGRAL_TYPE_P (scalar_type)
&& (GET_MODE_BITSIZE (inner_mode) != TYPE_PRECISION (scalar_type)
|| TREE_CODE (scalar_type) != INTEGER_TYPE))
scalar_type = build_nonstandard_integer_type (GET_MODE_BITSIZE (inner_mode),
TYPE_UNSIGNED (scalar_type));
/* We shouldn't end up building VECTOR_TYPEs of non-scalar components.
When the component mode passes the above test simply use a type
corresponding to that mode. The theory is that any use that
would cause problems with this will disable vectorization anyway. */
else if (!SCALAR_FLOAT_TYPE_P (scalar_type)
&& !INTEGRAL_TYPE_P (scalar_type))
scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1);
/* We can't build a vector type of elements with alignment bigger than
their size. */
else if (nbytes < TYPE_ALIGN_UNIT (scalar_type))
scalar_type = lang_hooks.types.type_for_mode (inner_mode,
TYPE_UNSIGNED (scalar_type));
/* If we felt back to using the mode fail if there was
no scalar type for it. */
if (scalar_type == NULL_TREE)
return NULL_TREE;
/* If no size was supplied use the mode the target prefers. Otherwise
lookup a vector mode of the specified size. */
if (size == 0)
simd_mode = targetm.vectorize.preferred_simd_mode (inner_mode);
else
simd_mode = mode_for_vector (inner_mode, size / nbytes);
nunits = GET_MODE_SIZE (simd_mode) / nbytes;
if (nunits <= 1)
return NULL_TREE;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
vectype = build_vector_type (scalar_type, nunits);
if (!VECTOR_MODE_P (TYPE_MODE (vectype))
&& !INTEGRAL_MODE_P (TYPE_MODE (vectype)))
return NULL_TREE;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Re-attach the address-space qualifier if we canonicalized the scalar
type. */
if (TYPE_ADDR_SPACE (orig_scalar_type) != TYPE_ADDR_SPACE (vectype))
return build_qualified_type
(vectype, KEEP_QUAL_ADDR_SPACE (TYPE_QUALS (orig_scalar_type)));
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return vectype;
}
unsigned int current_vector_size;
/* Function get_vectype_for_scalar_type.
Returns the vector type corresponding to SCALAR_TYPE as supported
by the target. */
tree
get_vectype_for_scalar_type (tree scalar_type)
{
tree vectype;
vectype = get_vectype_for_scalar_type_and_size (scalar_type,
current_vector_size);
if (vectype
&& current_vector_size == 0)
current_vector_size = GET_MODE_SIZE (TYPE_MODE (vectype));
return vectype;
}
expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. gcc/ * expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results. (const_vector_mask_from_tree): New. (const_vector_from_tree): Use const_vector_mask_from_tree for boolean vectors. * optabs-query.h (get_vec_cmp_icode): New. * optabs-tree.c (expand_vec_cmp_expr_p): New. * optabs-tree.h (expand_vec_cmp_expr_p): New. * optabs.c (vector_compare_rtx): Add OPNO arg. (expand_vec_cond_expr): Adjust to vector_compare_rtx change. (expand_vec_cmp_expr): New. * optabs.def (vec_cmp_optab): New. (vec_cmpu_optab): New. * optabs.h (expand_vec_cmp_expr): New. * tree-vect-generic.c (expand_vector_comparison): Add vector comparison optabs check. * tree-vect-loop.c (vect_determine_vectorization_factor): Ignore mask operations for VF. Add mask type computation. * tree-vect-stmts.c (get_mask_type_for_scalar_type): New. (vectorizable_comparison): New. (vect_analyze_stmt): Add vectorizable_comparison. (vect_transform_stmt): Likewise. (vect_init_vector): Support boolean vector invariants. (vect_get_vec_def_for_operand): Add VECTYPE arg. (vectorizable_condition): Directly provide vectype for invariants used in comparison. * tree-vectorizer.h (get_mask_type_for_scalar_type): New. (enum vect_var_kind): Add vect_mask_var. (enum stmt_vec_info_type): Add comparison_vec_info_type. (vectorizable_comparison): New. (vect_get_vec_def_for_operand): Add VECTYPE arg. * tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var. (vect_create_destination_var): Likewise. * tree-vect-patterns.c (check_bool_pattern): Check fails if we can vectorize comparison directly. (search_type_for_mask): New. (vect_recog_bool_pattern): Support cases when bool pattern check fails. * tree-vect-slp.c (vect_build_slp_tree_1): Allow comparison statements. (vect_get_constant_vectors): Support boolean vector constants. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New. (ix86_expand_int_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. * config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for op_true and op_false. (ix86_int_cmp_code_to_pcmp_immediate): New. (ix86_fp_cmp_code_to_pcmp_immediate): New. (ix86_cmp_code_to_pcmp_immediate): New. (ix86_expand_mask_vec_cmp): New. (ix86_expand_fp_vec_cmp): New. (ix86_expand_int_sse_cmp): New. (ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp. (ix86_expand_int_vec_cmp): New. (ix86_get_mask_mode): New. (TARGET_VECTORIZE_GET_MASK_MODE): New. * config/i386/sse.md (avx512fmaskmodelower): New. (vec_cmp<mode><avx512fmaskmodelower>): New. (vec_cmp<mode><sseintvecmodelower>): New. (vec_cmpv2div2di): New. (vec_cmpu<mode><avx512fmaskmodelower>): New. (vec_cmpu<mode><sseintvecmodelower>): New. (vec_cmpuv2div2di): New. gcc/testsuite/ * gcc.dg/vect/slp-cond-5.c: New test. From-SVN: r230098
2015-11-10 12:57:34 +01:00
/* Function get_mask_type_for_scalar_type.
Returns the mask type corresponding to a result of comparison
of vectors of specified SCALAR_TYPE as supported by target. */
tree
get_mask_type_for_scalar_type (tree scalar_type)
{
tree vectype = get_vectype_for_scalar_type (scalar_type);
if (!vectype)
return NULL;
return build_truth_vector_type (TYPE_VECTOR_SUBPARTS (vectype),
current_vector_size);
}
/* Function get_same_sized_vectype
Returns a vector type corresponding to SCALAR_TYPE of size
VECTOR_TYPE if supported by the target. */
tree
get_same_sized_vectype (tree scalar_type, tree vector_type)
{
if (VECT_SCALAR_BOOLEAN_TYPE_P (scalar_type))
tm.texi: Regenerated. gcc/ * doc/tm.texi: Regenerated. * doc/tm.texi.in (TARGET_VECTORIZE_GET_MASK_MODE): New. * stor-layout.c (layout_type): Use mode to get vector mask size. * target.def (get_mask_mode): New. * targhooks.c (default_get_mask_mode): New. * targhooks.h (default_get_mask_mode): New. * gcc/tree-vect-stmts.c (get_same_sized_vectype): Add special case for boolean vector. * tree.c (MAX_BOOL_CACHED_PREC): New. (nonstandard_boolean_type_cache): New. (build_nonstandard_boolean_type): New. (make_vector_type): Vector mask has no canonical type. (build_truth_vector_type): New. (build_same_sized_truth_vector_type): New. (truth_type_for): Support vector masks. * tree.h (VECTOR_BOOLEAN_TYPE_P): New. (build_truth_vector_type): New. (build_same_sized_truth_vector_type): New. (build_nonstandard_boolean_type): New. * tree-cfg.c (verify_gimple_comparison) Require boolean vector type for vector comparison. (verify_gimple_assign_ternary): Likewise. * optabs.c (expand_vec_cond_expr): Accept boolean vector as condition operand. * tree-vect-stmts.c (vectorizable_condition): Use boolean vector type for vector comparison. * tree-vect-generic.c (elem_op_func): Add new operand to hold vector type. (do_unop): Adjust to modified function type. (do_binop): Likewise. (do_plus_minus): Likewise. (do_negate); Likewise. (expand_vector_piecewise): Likewise. (do_cond): Likewise. (do_compare): Use comparison instead of condition. (expand_vector_divmod): Use boolean vector type for comparison. (expand_vector_operations_1): Skip scalar mask operations. gcc/c * c-typeck.c (build_conditional_expr): Use boolean vector type for vector comparison. (build_vec_cmp): New. (build_binary_op): Use build_vec_cmp for comparison. gcc/cp * call.c (build_conditional_expr_1): Use boolean vector type for vector comparison. * typeck.c (build_vec_cmp): New. (cp_build_binary_op): Use build_vec_cmp for comparison. gcc/testsuite/ * g++.dg/ext/vector22.C: Allow VEC_COND_EXPR. From-SVN: r229128
2015-10-21 18:01:43 +02:00
return build_same_sized_truth_vector_type (vector_type);
return get_vectype_for_scalar_type_and_size
(scalar_type, GET_MODE_SIZE (TYPE_MODE (vector_type)));
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function vect_is_simple_use.
Input:
VINFO - the vect info of the loop or basic block that is being vectorized.
OPERAND - operand in the loop or bb.
Output:
DEF_STMT - the defining stmt in case OPERAND is an SSA_NAME.
DT - the type of definition
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Returns whether a stmt with OPERAND can be vectorized.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
For loops, supportable operands are constants, loop invariants, and operands
that are defined by the current iteration of the loop. Unsupportable
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
operands are those that are defined by a previous iteration of the loop (as
passes.texi (Tree-SSA passes): Document SLP pass. * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define. From-SVN: r147829
2009-05-24 10:44:56 +02:00
is the case in reduction/induction computations).
For basic blocks, supportable operands are constants and bb invariants.
For now, operands defined outside the basic block are not supported. */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
bool
vect_is_simple_use (tree operand, vec_info *vinfo,
gimple **def_stmt, enum vect_def_type *dt)
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
{
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
*def_stmt = NULL;
*dt = vect_unknown_def_type;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (dump_enabled_p ())
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location,
"vect_is_simple_use: operand ");
dump_generic_expr (MSG_NOTE, TDF_SLIM, operand);
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
dump_printf (MSG_NOTE, "\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (CONSTANT_CLASS_P (operand))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
*dt = vect_constant_def;
return true;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (is_gimple_min_invariant (operand))
{
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
*dt = vect_external_def;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return true;
}
if (TREE_CODE (operand) != SSA_NAME)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"not ssa-name.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (SSA_NAME_IS_DEFAULT_DEF (operand))
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
*dt = vect_external_def;
return true;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
*def_stmt = SSA_NAME_DEF_STMT (operand);
if (dump_enabled_p ())
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_NOTE, vect_location, "def_stmt: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, *def_stmt, 0);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
if (! vect_stmt_in_region_p (vinfo, *def_stmt))
tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use REPORT_VECTORIZED_LOCATIONS instead REPORT_VECTORIZED_LOOPS. * tree-vectorizer.c (vect_verbosity_level): Make static. (vect_loop_location): Rename to vect_location. (vect_set_verbosity_level): Update comment. (vect_set_dump_settings): Use REPORT_VECTORIZED_LOCATIONS and vect_location. (vectorize_loops): Fix comment. Use REPORT_VECTORIZED_LOCATIONS and vect_location. Use REPORT_UNVECTORIZED_LOCATIONS instead REPORT_UNVECTORIZED_LOOPS. * tree-vectorizer.h (enum vect_def_type): Rename vect_invariant_def and vect_loop_def to vect_external_def and vect_internal_def. (enum verbosity_levels): Rename REPORT_VECTORIZED_LOOPS and REPORT_UNVECTORIZED_LOOPS to REPORT_VECTORIZED_LOCATIONS and REPORT_UNVECTORIZED_LOCATIONS. (enum vect_relevant): Update comment. Rename vect_unused_in_loop and vect_used_in_loop and to vect_unused_in_scope and vect_used_in_scope. (STMT_VINFO_RELEVANT_P): Use vect_unused_in_scope. (vect_verbosity_level): Remove declaration. (vect_analyze_operations): Likewise. (vect_analyze_stmt): Declare. * tree-vect-loop.c (vect_determine_vectorization_factor): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_get_loop_niters): Fix indentation. (vect_analyze_loop_form): Use REPORT_UNVECTORIZED_LOCATIONS. (vect_analyze_loop_operations): New function. (vect_analyze_loop): Call vect_analyze_loop_operations instead of vect_analyze_operations. (vect_is_simple_reduction): Use new names. (vectorizable_live_operation, vect_transform_loop): Likewise. * tree-vect-data-refs.c (vect_check_interleaving): Add a return value to specify whether the data references can be a part of interleaving chain. (vect_analyze_data_ref_dependence): Use new names. (vect_analyze_data_refs_alignment, vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Remove redundant code. * tree-vect-patterns.c (widened_name_p): Use new names. (vect_recog_dot_prod_pattern): Likewise. * tree-vect-stmts.c (vect_stmt_relevant_p): Use new names. (process_use, vect_mark_stmts_to_be_vectorized, vect_model_simple_cost, vect_model_store_cost, vect_get_vec_def_for_operand, vect_get_vec_def_for_stmt_copy, vectorizable_call, vectorizable_conversion, vectorizable_assignment, vectorizable_operation, vectorizable_type_demotion, vectorizable_type_promotion, vectorizable_store, vectorizable_load, vectorizable_condition): Likewise. (vect_analyze_operations): Split into vect_analyze_loop_operations and ... (vect_analyze_stmt): ... new function. (new_stmt_vec_info): Use new names. (vect_is_simple_use): Use new names and fix comment. * tree-vect-slp.c (vect_get_and_check_slp_defs): Use new names. (vect_build_slp_tree, vect_analyze_slp, vect_schedule_slp): Likewise. From-SVN: r146875
2009-04-28 10:08:25 +02:00
*dt = vect_external_def;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
{
stmt_vec_info stmt_vinfo = vinfo_for_stmt (*def_stmt);
*dt = STMT_VINFO_DEF_TYPE (stmt_vinfo);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
if (dump_enabled_p ())
{
dump_printf_loc (MSG_NOTE, vect_location, "type of def: ");
switch (*dt)
{
case vect_uninitialized_def:
dump_printf (MSG_NOTE, "uninitialized\n");
break;
case vect_constant_def:
dump_printf (MSG_NOTE, "constant\n");
break;
case vect_external_def:
dump_printf (MSG_NOTE, "external\n");
break;
case vect_internal_def:
dump_printf (MSG_NOTE, "internal\n");
break;
case vect_induction_def:
dump_printf (MSG_NOTE, "induction\n");
break;
case vect_reduction_def:
dump_printf (MSG_NOTE, "reduction\n");
break;
case vect_double_reduction_def:
dump_printf (MSG_NOTE, "double reduction\n");
break;
case vect_nested_cycle:
dump_printf (MSG_NOTE, "nested cycle\n");
break;
case vect_unknown_def_type:
dump_printf (MSG_NOTE, "unknown\n");
break;
}
}
if (*dt == vect_unknown_def_type)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"Unsupported pattern.\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
switch (gimple_code (*def_stmt))
{
case GIMPLE_PHI:
case GIMPLE_ASSIGN:
case GIMPLE_CALL:
break;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
default:
if (dump_enabled_p ())
invoke.texi: Add documentation for the new option. 2012-09-30 Sharad Singhai <singhai@google.com> * doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. From-SVN: r191883
2012-10-01 07:43:06 +02:00
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
dumpfile.c (dump_loc): Remove newline emission. 2013-09-16 Teresa Johnson <tejohnson@google.com> * dumpfile.c (dump_loc): Remove newline emission. * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Add newline emission to dump_printf_loc calls where missing. (vect_mark_for_runtime_alias_test): Ditto. (vect_analyze_data_ref_dependence): Ditto. (vect_analyze_data_ref_dependences): Ditto. (vect_slp_analyze_data_ref_dependence): Ditto. (vect_slp_analyze_data_ref_dependences): Ditto. (vect_compute_data_ref_alignment): Ditto. (vect_update_misalignment_for_peel): Ditto. (vect_verify_datarefs_alignment): Ditto. (vector_alignment_reachable_p): Ditto. (vect_get_data_access_cost): Ditto. (vect_enhance_data_refs_alignment): Ditto. (vect_find_same_alignment_drs): Ditto. (vect_analyze_data_refs_alignment): Ditto. (vect_analyze_group_access): Ditto. (vect_analyze_data_ref_access): Ditto. (vect_analyze_data_ref_accesses): Ditto. (vect_prune_runtime_alias_test_list): Ditto. (vect_analyze_data_refs): Ditto. (vect_create_addr_base_for_vector_ref): Ditto. (vect_create_data_ref_ptr): Ditto. (vect_grouped_store_supported): Ditto. (vect_grouped_load_supported): Ditto. * value-prof.c (check_counter): Ditto. (check_ic_target): Ditto. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Ditto. (vect_recog_widen_mult_pattern): Ditto. (vect_recog_widen_sum_pattern): Ditto. (vect_recog_over_widening_pattern): Ditto. (vect_recog_widen_shift_pattern): Ditto. (vect_recog_rotate_pattern): Ditto. (vect_recog_vector_vector_shift_pattern): Ditto. (vect_recog_divmod_pattern): Ditto. (vect_recog_mixed_size_cond_pattern): Ditto. (vect_recog_bool_pattern): Ditto. (vect_pattern_recog_1): Ditto. (vect_pattern_recog): Ditto. * tree-vect-loop.c (vect_determine_vectorization_factor): Ditto. (vect_is_simple_iv_evolution): Ditto. (vect_analyze_scalar_cycles_1): Ditto. (vect_get_loop_niters): Ditto. (vect_analyze_loop_1): Ditto. (vect_analyze_loop_form): Ditto. (vect_analyze_loop_operations): Ditto. (vect_analyze_loop_2): Ditto. (vect_analyze_loop): Ditto. (report_vect_op): Ditto. (vect_is_slp_reduction): Ditto. (vect_is_simple_reduction_1): Ditto. (vect_get_known_peeling_cost): Ditto. (vect_estimate_min_profitable_iters): Ditto. (vect_model_reduction_cost): Ditto. (vect_model_induction_cost): Ditto. (get_initial_def_for_induction): Ditto. (vect_create_epilog_for_reduction): Ditto. (vectorizable_reduction): Ditto. (vectorizable_induction): Ditto. (vectorizable_live_operation): Ditto. (vect_loop_kill_debug_uses): Ditto. (vect_transform_loop): Ditto. * tree-vect-stmts.c (vect_mark_relevant): Ditto. (vect_stmt_relevant_p): Ditto. (process_use): Ditto. (vect_mark_stmts_to_be_vectorized): Ditto. (vect_model_simple_cost): Ditto. (vect_model_promotion_demotion_cost): Ditto. (vect_model_store_cost): Ditto. (vect_get_store_cost): Ditto. (vect_model_load_cost): Ditto. (vect_get_load_cost): Ditto. (vect_init_vector_1): Ditto. (vect_get_vec_def_for_operand): Ditto. (vect_finish_stmt_generation): Ditto. (vectorizable_call): Ditto. (vectorizable_conversion): Ditto. (vectorizable_assignment): Ditto. (vectorizable_shift): Ditto. (vectorizable_operation): Ditto. (vectorizable_store): Ditto. (vectorizable_load): Ditto. (vectorizable_condition): Ditto. (vect_analyze_stmt): Ditto. (vect_transform_stmt): Ditto. (vect_is_simple_use): Ditto. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Ditto. (vect_can_advance_ivs_p): Ditto. (vect_update_ivs_after_vectorizer): Ditto. (vect_do_peeling_for_loop_bound): Ditto. (vect_gen_niters_for_prolog_loop): Ditto. (vect_update_inits_of_drs): Ditto. (vect_create_cond_for_alias_checks): Ditto. * tree-vect-slp.c (vect_get_and_check_slp_defs): Ditto. (vect_build_slp_tree_1): Ditto. (vect_supported_load_permutation_p): Ditto. (vect_analyze_slp_instance): Ditto. (vect_analyze_slp): Ditto. (vect_make_slp_decision): Ditto. (vect_detect_hybrid_slp): Ditto. (vect_bb_vectorization_profitable_p): Ditto. (vect_slp_analyze_bb_1): Ditto. (vect_update_slp_costs_according_to_vf): Ditto. (vect_get_mask_element): Ditto. (vect_transform_slp_perm_load): Ditto. (vect_schedule_slp_instance): Ditto. (vect_schedule_slp): Ditto. (vect_slp_transform_bb): Ditto. * profile.c (read_profile_edge_counts): Ditto. (compute_branch_probabilities): Ditto. * coverage.c (get_coverage_counts): Ditto. From-SVN: r202628
2013-09-16 15:40:02 +02:00
"unsupported defining stmt:\n");
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
}
return true;
}
/* Function vect_is_simple_use.
Same as vect_is_simple_use but also determines the vector operand
type of OPERAND and stores it to *VECTYPE. If the definition of
OPERAND is vect_uninitialized_def, vect_constant_def or
vect_external_def *VECTYPE will be set to NULL_TREE and the caller
is responsible to compute the best suited vector type for the
scalar operand. */
bool
vect_is_simple_use (tree operand, vec_info *vinfo,
gimple **def_stmt, enum vect_def_type *dt, tree *vectype)
{
if (!vect_is_simple_use (operand, vinfo, def_stmt, dt))
return false;
/* Now get a vector type if the def is internal, otherwise supply
NULL_TREE and leave it up to the caller to figure out a proper
type for the use stmt. */
if (*dt == vect_internal_def
|| *dt == vect_induction_def
|| *dt == vect_reduction_def
|| *dt == vect_double_reduction_def
|| *dt == vect_nested_cycle)
{
stmt_vec_info stmt_info = vinfo_for_stmt (*def_stmt);
if (STMT_VINFO_IN_PATTERN_P (stmt_info)
&& !STMT_VINFO_RELEVANT (stmt_info)
&& !STMT_VINFO_LIVE_P (stmt_info))
stmt_info = vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_info));
*vectype = STMT_VINFO_VECTYPE (stmt_info);
gcc_assert (*vectype != NULL_TREE);
}
else if (*dt == vect_uninitialized_def
|| *dt == vect_constant_def
|| *dt == vect_external_def)
*vectype = NULL_TREE;
else
gcc_unreachable ();
return true;
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Function supportable_widening_operation
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
Check whether an operation represented by the code CODE is a
widening operation that is supported by the target platform in
vector form (i.e., when operating on arguments of type VECTYPE_IN
producing a result of type VECTYPE_OUT).
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Widening operations we currently support are NOP (CONVERT), FLOAT
and WIDEN_MULT. This function checks if these operations are supported
by the target platform either directly (via vector tree-codes), or via
target builtins.
Output:
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
- CODE1 and CODE2 are codes of vector operations to be used when
vectorizing the operation, if available.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
- MULTI_STEP_CVT determines the number of required intermediate steps in
case of multi-step conversion (like char->short->int - in that case
MULTI_STEP_CVT will be 1).
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
- INTERM_TYPES contains the intermediate type required to perform the
widening operation (short in the above example). */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
bool
supportable_widening_operation (enum tree_code code, gimple *stmt,
tree vectype_out, tree vectype_in,
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum tree_code *code1, enum tree_code *code2,
int *multi_step_cvt,
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> *interm_types)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_info = STMT_VINFO_LOOP_VINFO (stmt_info);
struct loop *vect_loop = NULL;
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 vec_mode;
collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. ./: * collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. * dce.c (run_fast_df_dce): Change type of old_flags to int. * df-core.c (df_set_flags): Change return type to int. Change type of old_flags to int. (df_clear_flags): Likewise. * df-scan.c (df_def_record_1): Change 0 to VOIDmode. (df_get_conditional_uses): Likewise. * df.h (df_set_flags, df_clear_flags): Update declarations. * dwarf2out.c (struct indirect_string_node): Change type of form field to enum dwarf_form. (AT_string_form): Change return type to enum dwarf_form. * fixed-value.c (fixed_compare): Add cast to enum type. * fwprop.c (update_df): Change 0 to VOIDmode. * gensupport.c: Change 0 to UNKNOWN. * gimple.h (gimple_cond_code): Add cast to enum type. * haifa-sched.c (reemit_notes): Add cast to enum type. * hooks.c (hook_int_void_no_regs): Remove function. * hooks.h (hook_int_void_no_regs): Remove declaration. * optabs.c (expand_widen_pattern_expr): Change 0 to VOIDmode. * predict.c (combine_predictions_for_insn): Add casts to enum type. * real.c (real_arithmetic): Add cast to enum type. (real_compare): Likewise. * target.h (struct gcc_target): Change return type of branch_target_register_class to enum reg_class. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define as default_branch_target_register_class. * targhooks.c (default_branch_target_register_class): New function. * targhooks.h (default_branch_target_register_class): Declare. * tree-data-ref.c (print_direction_vector): Add cast to enum type. * tree-vect-data-refs.c (vect_supportable_dr_alignment): Remove cast to int. * tree-vect-loop.c (vect_create_epilog_for_reduction): Change 0 to ERROR_MARK. * tree-vect-slp.c (vect_build_slp_tree): Change 0 to vect_uninitialized_def. Change 0 to ERROR_MARK. * tree-vect-stmts.c (supportable_widening_operation): Don't initialize icode1 and icode2. * tree-vectorizer.h (enum vect_def_type): Add vect_uninitialized_def. * config/sol2-c.c (cmn_err_length_specs): Change 0 to FMT_LEN_none and to STD_C89. (cmn_err_flag_specs): Change 0 to STD_C89. (cmn_err_char_table): Likewise. * config/arm/arm.c (get_arm_condition_code): Change type of code to enum arm_cond_code. (IWMMXT_BUILTIN): Change 0 to UNKNOWN. (IWMMXT_BUILTIN2): Likewise. (neon_builtin_type_bits): Don't define typedef. (neon_builtin_datum): Change type of bits field to int. (arm_expand_neon_args): Add cast to enum type. * config/ia64/ia64.c (tls_symbolic_operand_type): Change 0 to TLS_MODEL_NONE. * config/i386/i386.c (bdesc_multi_arg): Change 0 to UNKNOWN. Add casts to enum type. * config/mips/mips.c (LOONGSON_BUILTIN_ALIAS): Change 0 to MIPS_FP_COND_f. * config/mips/mips.md (jal_macro): Return enum constant. (single_insn): Likewise. * config/rs6000/rs6000.c (bdesc_altivec_preds): Change 0 to CODE_FOR_nothing. * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add casts to enum type. * config/s390/s390.c (s390_tune_flags): Change type to int. (s390_arch_flags): Likewise. (s390_handle_arch_option): Change flags field of struct pta to int. * config/s390/s390.h (s390_tune_flags): Update declaration. (s390_arch_flags): Likewise. * config/sh/sh.c (prepare_move_operands): Compare tls_symbolic_operand result with enum constant. (sh_reorg): Change PUT_MODE to PUT_REG_NOTE_KIND. (sh_expand_prologue): Add cast to enum type. (sh_expand_epilogue): Likewise. (tls_symbolic_operand): Change return type to enum tls_model. (fpscr_set_from_mem): Add cast to enum type. (legitimize_pic_address): Compare tls_symbolic_operand result with enum constant. (sh_target_reg_class): Change return type to enum reg_class. * config/sh/sh.h (OVERRIDE_OPTIONS): Change CPU_xxx to PROCESSOR_xxx. * config/sh/sh-protos.h (tls_symbolic_operand): Update declaration. * config/sparc/sparc.c (sparc_override_options): Add cast to enum type. * config/sparc/sparc.md (empty_delay_slot): Return enum constant. (pic, calls_alloca, calls_eh_return, leaf_function): Likewise. (delayed_branch, tls_call_delay): Likewise. (eligible_for_sibcall_delay): Likewise. (eligible_for_return_delay): Likewise. * config/spu/spu.c (expand_builtin_args): Add cast to enum type. (spu_expand_builtin_1): Likewise. * c-typeck.c (convert_for_assignment): Issue -Wc++-compat warnings for all types of conversions. (output_init_element): Issue -Wc++-compat warning if needed when initializing a bitfield with enum type. * c-parser.c (c_parser_expression): Set original_type to original_type of right hand operand of comman operator. cp/: * semantics.c (finish_omp_clauses): Change type of c_kind to enum omp_clause_code. fortran/: * trans-intrinsic.c (DEFINE_MATH_BUILTIN): Add casts to enum type. * trans-io.c (st_parameter_field): Add casts to enum type. java/: * builtins.c (java_builtins): Add casts to enum type. * verify-impl.c (check_class_constant): Add cast to enum type. (check_constant, check_wide_constant): Likewise. objc/: * objc-act.c (objc_gimplify_expr): Add casts to enum type. testsuite/: * gcc.dg/Wcxx-compat-5.c: New testcase. * gcc.dg/Wcxx-compat-6.c: New testcase. From-SVN: r146855
2009-04-27 22:25:48 +02:00
enum insn_code icode1, icode2;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
optab optab1, optab2;
tree vectype = vectype_in;
tree wide_vectype = vectype_out;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum tree_code c1, c2;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
int i;
tree prev_type, intermediate_type;
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 intermediate_mode, prev_mode;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
optab optab3, optab4;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
*multi_step_cvt = 0;
if (loop_info)
vect_loop = LOOP_VINFO_LOOP (loop_info);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
switch (code)
{
case WIDEN_MULT_EXPR:
/* The result of a vectorized widening operation usually requires
two vectors (because the widened results do not fit into one vector).
The generated vector results would normally be expected to be
generated in the same order as in the original scalar computation,
i.e. if 8 results are generated in each vector iteration, they are
to be organized as follows:
vect1: [res1,res2,res3,res4],
vect2: [res5,res6,res7,res8].
However, in the special case that the result of the widening
operation is used in a reduction computation only, the order doesn't
matter (because when vectorizing a reduction we change the order of
the computation). Some targets can take advantage of this and
generate more efficient code. For example, targets like Altivec,
that support widen_mult using a sequence of {mult_even,mult_odd}
generate the following vectors:
vect1: [res1,res3,res5,res7],
vect2: [res2,res4,res6,res8].
When vectorizing outer-loops, we execute the inner-loop sequentially
(each vectorized inner-loop iteration contributes to VF outer-loop
iterations in parallel). We therefore don't allow to change the
order of the computation in the inner-loop during outer-loop
vectorization. */
/* TODO: Another case in which order doesn't *really* matter is when we
widen and then contract again, e.g. (short)((int)x * y >> 8).
Normally, pack_trunc performs an even/odd permute, whereas the
repack from an even/odd expansion would be an interleave, which
would be significantly simpler for e.g. AVX2. */
/* In any case, in order to avoid duplicating the code below, recurse
on VEC_WIDEN_MULT_EVEN_EXPR. If it succeeds, all the return values
are properly set up for the caller. If we fail, we'll continue with
a VEC_WIDEN_MULT_LO/HI_EXPR check. */
if (vect_loop
&& STMT_VINFO_RELEVANT (stmt_info) == vect_used_by_reduction
&& !nested_in_vect_loop_p (vect_loop, stmt)
&& supportable_widening_operation (VEC_WIDEN_MULT_EVEN_EXPR,
stmt, vectype_out, vectype_in,
code1, code2, multi_step_cvt,
interm_types))
{
/* Elements in a vector with vect_used_by_reduction property cannot
be reordered if the use chain with this property does not have the
same operation. One such an example is s += a * b, where elements
in a and b cannot be reordered. Here we check if the vector defined
by STMT is only directly used in the reduction statement. */
tree lhs = gimple_assign_lhs (stmt);
use_operand_p dummy;
gimple *use_stmt;
stmt_vec_info use_stmt_info = NULL;
if (single_imm_use (lhs, &dummy, &use_stmt)
&& (use_stmt_info = vinfo_for_stmt (use_stmt))
&& STMT_VINFO_DEF_TYPE (use_stmt_info) == vect_reduction_def)
return true;
}
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
c1 = VEC_WIDEN_MULT_LO_EXPR;
c2 = VEC_WIDEN_MULT_HI_EXPR;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
case DOT_PROD_EXPR:
c1 = DOT_PROD_EXPR;
c2 = DOT_PROD_EXPR;
break;
case SAD_EXPR:
c1 = SAD_EXPR;
c2 = SAD_EXPR;
break;
case VEC_WIDEN_MULT_EVEN_EXPR:
/* Support the recursion induced just above. */
c1 = VEC_WIDEN_MULT_EVEN_EXPR;
c2 = VEC_WIDEN_MULT_ODD_EXPR;
break;
md.texi (vec_widen_ushiftl_hi, [...]): Document. * doc/md.texi (vec_widen_ushiftl_hi, vec_widen_ushiftl_lo, vec_widen_sshiftl_hi, vec_widen_sshiftl_lo): Document. * tree-pretty-print.c (dump_generic_node): Handle WIDEN_LSHIFT_EXPR, VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. (op_code_prio): Likewise. (op_symbol_code): Handle WIDEN_LSHIFT_EXPR. * optabs.c (optab_for_tree_code): Handle VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. (init-optabs): Initialize optab codes for vec_widen_u/sshiftl_hi/lo. * optabs.h (enum optab_index): Add OTI_vec_widen_u/sshiftl_hi/lo. * genopinit.c (optabs): Initialize the new optabs. * expr.c (expand_expr_real_2): Handle VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. * gimple-pretty-print.c (dump_binary_rhs): Likewise. * tree-vectorizer.h (NUM_PATTERNS): Increase to 8. * tree.def (WIDEN_LSHIFT_EXPR, VEC_WIDEN_LSHIFT_HI_EXPR, VEC_WIDEN_LSHIFT_LO_EXPR): New. * cfgexpand.c (expand_debug_expr): Handle new tree codes. * tree-vect-patterns.c (vect_vect_recog_func_ptrs): Add vect_recog_widen_shift_pattern. (vect_handle_widen_mult_by_const): Rename... (vect_handle_widen_op_by_const): ...to this. Handle shifts. Add a new argument, update documentation. (vect_recog_widen_mult_pattern): Assume that only second operand can be constant. Update call to vect_handle_widen_op_by_const. (vect_recog_over_widening_pattern): Fix typo. (vect_recog_widen_shift_pattern): New. * tree-vect-stmts.c (vectorizable_type_promotion): Handle widening shifts. (supportable_widening_operation): Likewise. * tree-inline.c (estimate_operator_cost): Handle new tree codes. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * config/arm/neon.md (neon_vec_<US>shiftl_<mode>): New. (vec_widen_<US>shiftl_lo_<mode>, neon_vec_<US>shiftl_hi_<mode>, vec_widen_<US>shiftl_hi_<mode>, neon_vec_<US>shift_left_<mode>): Likewise. * config/arm/predicates.md (const_neon_scalar_shift_amount_operand): New. * config/arm/iterators.md (V_innermode): New. * tree-vect-slp.c (vect_build_slp_tree): Require same shift operand for widening shift. From-SVN: r180128
2011-10-18 11:39:04 +02:00
case WIDEN_LSHIFT_EXPR:
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
c1 = VEC_WIDEN_LSHIFT_LO_EXPR;
c2 = VEC_WIDEN_LSHIFT_HI_EXPR;
md.texi (vec_widen_ushiftl_hi, [...]): Document. * doc/md.texi (vec_widen_ushiftl_hi, vec_widen_ushiftl_lo, vec_widen_sshiftl_hi, vec_widen_sshiftl_lo): Document. * tree-pretty-print.c (dump_generic_node): Handle WIDEN_LSHIFT_EXPR, VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. (op_code_prio): Likewise. (op_symbol_code): Handle WIDEN_LSHIFT_EXPR. * optabs.c (optab_for_tree_code): Handle VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. (init-optabs): Initialize optab codes for vec_widen_u/sshiftl_hi/lo. * optabs.h (enum optab_index): Add OTI_vec_widen_u/sshiftl_hi/lo. * genopinit.c (optabs): Initialize the new optabs. * expr.c (expand_expr_real_2): Handle VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. * gimple-pretty-print.c (dump_binary_rhs): Likewise. * tree-vectorizer.h (NUM_PATTERNS): Increase to 8. * tree.def (WIDEN_LSHIFT_EXPR, VEC_WIDEN_LSHIFT_HI_EXPR, VEC_WIDEN_LSHIFT_LO_EXPR): New. * cfgexpand.c (expand_debug_expr): Handle new tree codes. * tree-vect-patterns.c (vect_vect_recog_func_ptrs): Add vect_recog_widen_shift_pattern. (vect_handle_widen_mult_by_const): Rename... (vect_handle_widen_op_by_const): ...to this. Handle shifts. Add a new argument, update documentation. (vect_recog_widen_mult_pattern): Assume that only second operand can be constant. Update call to vect_handle_widen_op_by_const. (vect_recog_over_widening_pattern): Fix typo. (vect_recog_widen_shift_pattern): New. * tree-vect-stmts.c (vectorizable_type_promotion): Handle widening shifts. (supportable_widening_operation): Likewise. * tree-inline.c (estimate_operator_cost): Handle new tree codes. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * config/arm/neon.md (neon_vec_<US>shiftl_<mode>): New. (vec_widen_<US>shiftl_lo_<mode>, neon_vec_<US>shiftl_hi_<mode>, vec_widen_<US>shiftl_hi_<mode>, neon_vec_<US>shift_left_<mode>): Likewise. * config/arm/predicates.md (const_neon_scalar_shift_amount_operand): New. * config/arm/iterators.md (V_innermode): New. * tree-vect-slp.c (vect_build_slp_tree): Require same shift operand for widening shift. From-SVN: r180128
2011-10-18 11:39:04 +02:00
break;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
CASE_CONVERT:
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
c1 = VEC_UNPACK_LO_EXPR;
c2 = VEC_UNPACK_HI_EXPR;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
case FLOAT_EXPR:
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
c1 = VEC_UNPACK_FLOAT_LO_EXPR;
c2 = VEC_UNPACK_FLOAT_HI_EXPR;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
break;
case FIX_TRUNC_EXPR:
/* ??? Not yet implemented due to missing VEC_UNPACK_FIX_TRUNC_HI_EXPR/
VEC_UNPACK_FIX_TRUNC_LO_EXPR tree codes and optabs used for
computing the operation. */
return false;
default:
gcc_unreachable ();
}
if (BYTES_BIG_ENDIAN && c1 != VEC_WIDEN_MULT_EVEN_EXPR)
Use std::swap instead of manual swaps. gcc/ * auto-inc-dec.c (reverse_mem, reverse_inc): Remove. (parse_add_or_inc): Use std::swap instead of reverse_{mem,inc}. (find_inc): Likewise. * combine.c (combine_simplify_rtx): Use std::swap instead of manually swapping. * df-core.c (df_worklist_dataflow_doublequeue): Likewise. * df-scan.c (df_swap_refs): Remove. (df_sort_and_compress_refs): Use std::swap instead of df_swap_refs. * dominance.c (link_roots): Use std::swap instead of manually swapping. * expr.c (expand_expr_real_2, do_store_flag): Likewise. * fold-const.c (fold_relational_const): Likewise. * genattrtab.c (simplify_test_exp): Likewise. * gimple-match-head.c (gimple_resimplify2, gimple_resimplify3, gimple_simplify): Likewise. * ifcvt.c (noce_try_abs, find_if_header): Likewise. * internal-fn.c (expand_addsub_overflow, expand_mul_overflow): Likewise. * ipa-devirt.c (add_type_duplicate): Likewise. * loop-iv.c (get_biv_step_1, iv_number_of_iterations): Likewise. * lra-lives.c (lra_setup_reload_pseudo_preferenced_hard_reg): Likewise. * lra.c (lra_create_copy): Likewise. * lto-streamer-out.c (DFS::DFS): Likewise. * modulo-sched.c (get_sched_window): Likewise. * omega.c (omega_pretty_print_problem): Likewise. * optabs.c (prepare_float_lib_cmp, expand_mult_highpart): Likewise. * reload1.c (reloads_unique_chain_p): Likewise. * sel-sched-ir.c (exchange_lv_sets, exchange_av_sets): Remove. (exchange_data_sets): Move logic from exchange_{av,lv}_sets here and use std::swap. * simplify-rtx.c (simplify_unary_operation_1): Use std::swap instead of manually swapping. * tree-if-conv.c (is_cond_scalar_reduction, predicate_scalar_phi, predicate_mem_writes): Likewise. * tree-loop-distribution.c (pg_add_dependence_edges): Likewise. * tree-predcom.c (combine_chains): Likewise. * tree-ssa-alias.c (nonoverlapping_component_refs_p, refs_may_alias_p_1): Likewise. * tree-ssa-ifcombine.c (recognize_if_then_else): Likewise. * tree-ssa-loop-ivopts.c (extract_cond_operands): Likewise. * tree-ssa-loop-niter.c (refine_bounds_using_guard, number_of_iterations_cond): Likewise. * tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Likewise. * tree-ssa-sccvn.c (vn_nary_op_compute_hash): Likewise. * tree-vect-slp.c (vect_build_slp_tree): Likewise. * tree-vect-stmts.c (supportable_widening_operation): Likewise. * tree-vrp.c (extract_range_from_binary_expr_1, extract_range_from_unary_expr_1): Likewise. gcc/cp/ * pt.c (maybe_adjust_types_for_deduction): Use std::swap instead of manually swapping. * semantics.c (finish_omp_atomic): Likewise. * typeck.c (cp_build_array_ref): Likewise. gcc/c-family/ * c-common.c (scalar_to_vector): Use std::swap instead of manually swapping. From-SVN: r224718
2015-06-22 04:54:11 +02:00
std::swap (c1, c2);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
if (code == FIX_TRUNC_EXPR)
{
/* The signedness is determined from output operand. */
optab1 = optab_for_tree_code (c1, vectype_out, optab_default);
optab2 = optab_for_tree_code (c2, vectype_out, optab_default);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
else
{
optab1 = optab_for_tree_code (c1, vectype, optab_default);
optab2 = optab_for_tree_code (c2, vectype, optab_default);
}
if (!optab1 || !optab2)
return false;
vec_mode = TYPE_MODE (vectype);
if ((icode1 = optab_handler (optab1, vec_mode)) == CODE_FOR_nothing
|| (icode2 = optab_handler (optab2, vec_mode)) == CODE_FOR_nothing)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
*code1 = c1;
*code2 = c2;
if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
&& insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
/* For scalar masks we may have different boolean
vector types having the same QImode. Thus we
add additional check for elements number. */
return (!VECTOR_BOOLEAN_TYPE_P (vectype)
|| (TYPE_VECTOR_SUBPARTS (vectype) / 2
== TYPE_VECTOR_SUBPARTS (wide_vectype)));
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Check if it's a multi-step conversion that can be done using intermediate
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
types. */
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
prev_type = vectype;
prev_mode = vec_mode;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (!CONVERT_EXPR_CODE_P (code))
return false;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
/* We assume here that there will not be more than MAX_INTERM_CVT_STEPS
intermediate steps in promotion sequence. We try
MAX_INTERM_CVT_STEPS to get to NARROW_VECTYPE, and fail if we do
not. */
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
interm_types->create (MAX_INTERM_CVT_STEPS);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
for (i = 0; i < MAX_INTERM_CVT_STEPS; i++)
{
intermediate_mode = insn_data[icode1].operand[0].mode;
if (VECTOR_BOOLEAN_TYPE_P (prev_type))
{
intermediate_type
= build_truth_vector_type (TYPE_VECTOR_SUBPARTS (prev_type) / 2,
current_vector_size);
if (intermediate_mode != TYPE_MODE (intermediate_type))
return false;
}
else
intermediate_type
= lang_hooks.types.type_for_mode (intermediate_mode,
TYPE_UNSIGNED (prev_type));
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
optab3 = optab_for_tree_code (c1, intermediate_type, optab_default);
optab4 = optab_for_tree_code (c2, intermediate_type, optab_default);
if (!optab3 || !optab4
|| (icode1 = optab_handler (optab1, prev_mode)) == CODE_FOR_nothing
|| insn_data[icode1].operand[0].mode != intermediate_mode
|| (icode2 = optab_handler (optab2, prev_mode)) == CODE_FOR_nothing
|| insn_data[icode2].operand[0].mode != intermediate_mode
|| ((icode1 = optab_handler (optab3, intermediate_mode))
== CODE_FOR_nothing)
|| ((icode2 = optab_handler (optab4, intermediate_mode))
== CODE_FOR_nothing))
break;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
interm_types->quick_push (intermediate_type);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
(*multi_step_cvt)++;
if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
&& insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
return (!VECTOR_BOOLEAN_TYPE_P (vectype)
|| (TYPE_VECTOR_SUBPARTS (intermediate_type) / 2
== TYPE_VECTOR_SUBPARTS (wide_vectype)));
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
prev_type = intermediate_type;
prev_mode = intermediate_mode;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
interm_types->release ();
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
return false;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
/* Function supportable_narrowing_operation
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
Check whether an operation represented by the code CODE is a
narrowing operation that is supported by the target platform in
vector form (i.e., when operating on arguments of type VECTYPE_IN
and producing a result of type VECTYPE_OUT).
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
Narrowing operations we currently support are NOP (CONVERT) and
FIX_TRUNC. This function checks if these operations are supported by
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
the target platform directly via vector tree-codes.
Output:
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
- CODE1 is the code of a vector operation to be used when
vectorizing the operation, if available.
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
- MULTI_STEP_CVT determines the number of required intermediate steps in
case of multi-step conversion (like int->short->char - in that case
MULTI_STEP_CVT will be 1).
- INTERM_TYPES contains the intermediate type required to perform the
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
narrowing operation (short in the above example). */
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
bool
supportable_narrowing_operation (enum tree_code code,
tree vectype_out, tree vectype_in,
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum tree_code *code1, int *multi_step_cvt,
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> *interm_types)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
{
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 vec_mode;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum insn_code icode1;
optab optab1, interm_optab;
tree vectype = vectype_in;
tree narrow_vectype = vectype_out;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
enum tree_code c1;
tree intermediate_type, prev_type;
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 intermediate_mode, prev_mode;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
int i;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
bool uns;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
*multi_step_cvt = 0;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
switch (code)
{
CASE_CONVERT:
c1 = VEC_PACK_TRUNC_EXPR;
break;
case FIX_TRUNC_EXPR:
c1 = VEC_PACK_FIX_TRUNC_EXPR;
break;
case FLOAT_EXPR:
/* ??? Not yet implemented due to missing VEC_PACK_FLOAT_EXPR
tree code and optabs used for computing the operation. */
return false;
default:
gcc_unreachable ();
}
if (code == FIX_TRUNC_EXPR)
/* The signedness is determined from output operand. */
optab1 = optab_for_tree_code (c1, vectype_out, optab_default);
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
else
optab1 = optab_for_tree_code (c1, vectype, optab_default);
if (!optab1)
return false;
vec_mode = TYPE_MODE (vectype);
if ((icode1 = optab_handler (optab1, vec_mode)) == CODE_FOR_nothing)
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
return false;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
*code1 = c1;
if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
/* For scalar masks we may have different boolean
vector types having the same QImode. Thus we
add additional check for elements number. */
return (!VECTOR_BOOLEAN_TYPE_P (vectype)
|| (TYPE_VECTOR_SUBPARTS (vectype) * 2
== TYPE_VECTOR_SUBPARTS (narrow_vectype)));
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
/* Check if it's a multi-step conversion that can be done using intermediate
types. */
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
prev_mode = vec_mode;
prev_type = vectype;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
if (code == FIX_TRUNC_EXPR)
uns = TYPE_UNSIGNED (vectype_out);
else
uns = TYPE_UNSIGNED (vectype);
/* For multi-step FIX_TRUNC_EXPR prefer signed floating to integer
conversion over unsigned, as unsigned FIX_TRUNC_EXPR is often more
costly than signed. */
if (code == FIX_TRUNC_EXPR && uns)
{
enum insn_code icode2;
intermediate_type
= lang_hooks.types.type_for_mode (TYPE_MODE (vectype_out), 0);
interm_optab
= optab_for_tree_code (c1, intermediate_type, optab_default);
if (interm_optab != unknown_optab
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
&& (icode2 = optab_handler (optab1, vec_mode)) != CODE_FOR_nothing
&& insn_data[icode1].operand[0].mode
== insn_data[icode2].operand[0].mode)
{
uns = false;
optab1 = interm_optab;
icode1 = icode2;
}
}
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
/* We assume here that there will not be more than MAX_INTERM_CVT_STEPS
intermediate steps in promotion sequence. We try
MAX_INTERM_CVT_STEPS to get to NARROW_VECTYPE, and fail if we do not. */
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
interm_types->create (MAX_INTERM_CVT_STEPS);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
for (i = 0; i < MAX_INTERM_CVT_STEPS; i++)
{
intermediate_mode = insn_data[icode1].operand[0].mode;
if (VECTOR_BOOLEAN_TYPE_P (prev_type))
{
intermediate_type
= build_truth_vector_type (TYPE_VECTOR_SUBPARTS (prev_type) * 2,
current_vector_size);
if (intermediate_mode != TYPE_MODE (intermediate_type))
return false;
}
else
intermediate_type
= lang_hooks.types.type_for_mode (intermediate_mode, uns);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
interm_optab
= optab_for_tree_code (VEC_PACK_TRUNC_EXPR, intermediate_type,
optab_default);
if (!interm_optab
|| ((icode1 = optab_handler (optab1, prev_mode)) == CODE_FOR_nothing)
|| insn_data[icode1].operand[0].mode != intermediate_mode
|| ((icode1 = optab_handler (interm_optab, intermediate_mode))
== CODE_FOR_nothing))
break;
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
interm_types->quick_push (intermediate_type);
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
(*multi_step_cvt)++;
if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
return (!VECTOR_BOOLEAN_TYPE_P (vectype)
|| (TYPE_VECTOR_SUBPARTS (intermediate_type) * 2
== TYPE_VECTOR_SUBPARTS (narrow_vectype)));
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
prev_mode = intermediate_mode;
prev_type = intermediate_type;
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
optab1 = interm_optab;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
interm_types->release ();
tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR... * tree-vect-stmts.c (vectorizable_conversion): Rewritten to handle not just FLOAT_EXPR and FIX_TRUNC_EXPR, but also CONVERT_EXPR_CODE_P, WIDEN_MULT_EXPR and WIDEN_LSHIFT_EXPR to handle what vectorizable_type_demotion and vectorizable_type_promotion did. Additionally handle FLOAT_EXPR and FIX_TRUNC_EXPR where the integer is {,un}signed {char,short}. (vect_create_vectorized_demotion_stmts): Fix comment typo. For recursive calls unconditionally use VEC_PACK_TRUNC_EXPR. Push vec_dest back to the vec_dsts vector at the end. (vect_create_vectorized_promotion_stmts): Don't recurse, do just one step. Removed multi_step_cvt, vec_dsts, slp_node and prev_stmt_info arguments, add vec_dest argument. Push always into vec_tmp, not just when multi_step_cvt != 0, replace *vec_oprdn0 with vec_tmp at the end after freeing old *vec_oprnd0 vector. (vectorizable_type_demotion, vectorizable_type_promotion): Removed. (vect_analyze_stmt): Don't call vectorizable_type_demotion and vectorizable_type_promotion. Call vectorizable_conversion even for SLP bb vectorization. (vect_transform_stmt): Call vectorizable_conversion instead of vectorizable_type_demotion and vectorizable_type_promotion. (supportable_widening_operation): Clear *multi_step_cvt first, simplify c1/c2 computation, free *interm_types vector on failure. (supportable_narrowing_operation): Clear *multi_step_cvt first, free *interm_types vector on failure, handle multi-step FIX_TRUNC_EXPR. * gcc.dg/torture/vec-cvt-1.c: New test. From-SVN: r180932
2011-11-04 11:35:44 +01:00
return false;
tree-vect-loop-manip.c: New file. * tree-vect-loop-manip.c: New file. * tree-vectorizer.c: Update documentation and included files. (vect_loop_location): Make extern. (rename_use_op): Move to tree-vect-loop-manip.c (rename_variables_in_bb, rename_variables_in_loop, slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_make_loop_iterate_ntimes, slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_add_loop_guard, slpeel_can_duplicate_loop_p, slpeel_verify_cfg_after_peeling, set_prologue_iterations, slpeel_tree_peel_loop_to_edge, find_loop_location): Likewise. (new_stmt_vec_info): Move to tree-vect-stmts.c. (init_stmt_vec_info_vec, free_stmt_vec_info_vec, free_stmt_vec_info, get_vectype_for_scalar_type, vect_is_simple_use, supportable_widening_operation, supportable_narrowing_operation): Likewise. (bb_in_loop_p): Move to tree-vect-loop.c. (new_loop_vec_info, destroy_loop_vec_info, reduction_code_for_scalar_code, report_vect_op, vect_is_simple_reduction, vect_is_simple_iv_evolution): Likewise. (vect_can_force_dr_alignment_p): Move to tree-vect-data-refs.c. (vect_supportable_dr_alignment): Likewise. * tree-vectorizer.h (tree-data-ref.h): Include. (vect_loop_location): Declare. Reorganize function declarations according to the new file structure. * tree-vect-loop.c: New file. * tree-vect-analyze.c: Remove. Move functions to tree-vect-data-refs.c, tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * tree-vect-data-refs.c: New file. * tree-vect-patterns.c (timevar.h): Don't include. * tree-vect-stmts.c: New file. * tree-vect-transform.c: Remove. Move functions to tree-vect-stmts.c, tree-vect-slp.c, tree-vect-loop.c. * Makefile.in (OBJS-common): Remove tree-vect-analyze.o and tree-vect-transform.o. Add tree-vect-data-refs.o, tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o. (tree-vect-analyze.o): Remove. (tree-vect-transform.o): Likewise. (tree-vect-data-refs.o): Add rule. (tree-vect-stmts.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-slp.o): Likewise. (tree-vect-patterns.o): Remove redundant dependencies. (tree-vectorizer.o): Likewise. * tree-vect-slp.c: New file. From-SVN: r145280
2009-03-30 09:22:04 +02:00
}