From 10230637c08834fadc222f87c2949f9c749d0f80 Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 8 Jul 2009 11:35:18 +0000 Subject: 2009-07-08 Shujing Zhao * basic-block.h (dump_regset, debug_regset): Remove duplicate prototypes. * c-objc-common.h (c_initialize_diagnostics): Ditto. * ebitmap.h (dump_ebitmap): Ditto. * optabs.h (optab_libfunc): Ditto. * tree.h (tree_expr_nonzero_warnv_p): Ditto. * tree-flow.h (vect_can_force_dr_alignment_p, get_vectype_for_scalar_type): Ditto. (vectorize_loops): Move prototype to ... * tree-vectorizer.h: ... here. Also, adjust comment. (vect_set_verbosity_level): Remove duplicate prototype. * tree-ssa-loop.c: Include tree-vectorizer.h. * Makefile.in (tree-ssa-loop.o): Depend on tree-vectorizer.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149364 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 6e8f879caf3..05f5e4783f7 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -861,8 +861,9 @@ typedef gimple (* vect_recog_func_ptr) (gimple, tree *, tree *); #define NUM_PATTERNS 4 void vect_pattern_recog (loop_vec_info); -/* Vectorization debug information - in tree-vectorizer.c. */ +/* In tree-vectorizer.c. */ +unsigned vectorize_loops (void); +/* Vectorization debug information */ extern bool vect_print_dump_info (enum verbosity_levels); -extern void vect_set_verbosity_level (const char *); #endif /* GCC_TREE_VECTORIZER_H */ -- cgit v1.2.1 From 7aa0d35066596b3c0fefb385bbe1ee43f75f8ec1 Mon Sep 17 00:00:00 2001 From: irar Date: Sun, 12 Jul 2009 07:09:07 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149526 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 05f5e4783f7..c7dab10c13f 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -61,6 +61,7 @@ enum vect_def_type { vect_internal_def, vect_induction_def, vect_reduction_def, + vect_double_reduction_def, vect_nested_cycle, vect_unknown_def_type }; @@ -822,7 +823,7 @@ extern tree vect_create_addr_base_for_vector_ref (gimple, gimple_seq *, /* In tree-vect-loop.c. */ /* FORNOW: Used in tree-parloops.c. */ extern void destroy_loop_vec_info (loop_vec_info, bool); -extern gimple vect_is_simple_reduction (loop_vec_info, gimple, bool); +extern gimple vect_is_simple_reduction (loop_vec_info, gimple, bool, bool *); /* Drive for loop analysis stage. */ extern loop_vec_info vect_analyze_loop (struct loop *); /* Drive for loop transformation stage. */ -- cgit v1.2.1 From 0df23b96b4542b1d28ebb6eb669b0de339989e44 Mon Sep 17 00:00:00 2001 From: irar Date: Mon, 20 Jul 2009 11:59:10 +0000 Subject: * tree-vectorizer.h (vectorizable_condition): Add parameters. * tree-vect-loop.c (vect_is_simple_reduction): Support COND_EXPR. (get_initial_def_for_reduction): Likewise. (vectorizable_reduction): Skip the check of first operand in case of COND_EXPR. Add check that it is outer loop vectorization if nested cycle was detected. Call vectorizable_condition() for COND_EXPR. If reduction epilogue cannot be created do not fail for nested cycles (if it is not double reduction). Assert that there is only one type in the loop in case of COND_EXPR. Call vectorizable_condition() to vectorize COND_EXPR. * tree-vect-stmts.c (vectorizable_condition): Update comment. Add parameters. Allow nested cycles if called from vectorizable_reduction(). Use reduction vector variable if provided. (vect_analyze_stmt): Call vectorizable_reduction() before vectorizable_condition(). (vect_transform_stmt): Update call to vectorizable_condition(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149806 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index c7dab10c13f..31e9c185005 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -786,7 +786,9 @@ extern bool vect_transform_stmt (gimple, gimple_stmt_iterator *, bool *, slp_tree, slp_instance); extern void vect_remove_stores (gimple); extern bool vect_analyze_stmt (gimple, bool *, slp_tree); - +extern bool vectorizable_condition (gimple, gimple_stmt_iterator *, gimple *, + tree, int); + /* In tree-vect-data-refs.c. */ extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int); extern enum dr_alignment_support vect_supportable_dr_alignment -- cgit v1.2.1 From 48e1416a24d50cacbb2a5e06a9ee61dd8cbee313 Mon Sep 17 00:00:00 2001 From: hjl Date: Wed, 25 Nov 2009 10:55:54 +0000 Subject: Remove trailing white spaces. 2009-11-25 H.J. Lu * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154645 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 116 +++++++++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 58 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 31e9c185005..b7c6316f9c6 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1,5 +1,5 @@ /* Vectorizer - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Dorit Naishlos @@ -98,9 +98,9 @@ typedef struct _slp_tree { VEC (gimple, heap) *stmts; /* Vectorized stmt/s. */ VEC (gimple, heap) *vec_stmts; - /* Number of vector stmts that are created to replace the group of scalar - stmts. It is calculated during the transformation phase as the number of - scalar elements in one scalar iteration (GROUP_SIZE) multiplied by VF + /* Number of vector stmts that are created to replace the group of scalar + stmts. It is calculated during the transformation phase as the number of + scalar elements in one scalar iteration (GROUP_SIZE) multiplied by VF divided by vector size. */ unsigned int vec_stmts_size; /* Vectorization costs associated with SLP node. */ @@ -127,13 +127,13 @@ typedef struct _slp_instance { unsigned int unrolling_factor; /* Vectorization costs associated with SLP instance. */ - struct + struct { int outside_of_loop; /* Statements generated outside loop. */ int inside_of_loop; /* Statements generated inside loop. */ } cost; - /* Loads permutation relatively to the stores, NULL if there is no + /* Loads permutation relatively to the stores, NULL if there is no permutation. */ VEC (int, heap) *load_permutation; @@ -182,12 +182,12 @@ typedef struct _loop_vec_info { tree num_iters_unchanged; /* Minimum number of iterations below which vectorization is expected to - not be profitable (as estimated by the cost model). + not be profitable (as estimated by the cost model). -1 indicates that vectorization will not be profitable. FORNOW: This field is an int. Will be a tree in the future, to represent - values unknown at compile time. */ - int min_profitable_iters; - + values unknown at compile time. */ + int min_profitable_iters; + /* Is the loop vectorizable? */ bool vectorizable; @@ -235,7 +235,7 @@ typedef struct _loop_vec_info { of the loop. */ VEC(slp_instance, heap) *slp_instances; - /* The unrolling factor needed to SLP the loop. In case of that pure SLP is + /* The unrolling factor needed to SLP the loop. In case of that pure SLP is applied to the loop, i.e., no unrolling is needed, this is 1. */ unsigned slp_unrolling_factor; } *loop_vec_info; @@ -284,18 +284,18 @@ loop_vec_info_for_loop (struct loop *loop) static inline bool nested_in_vect_loop_p (struct loop *loop, gimple stmt) { - return (loop->inner + return (loop->inner && (loop->inner == (gimple_bb (stmt))->loop_father)); } typedef struct _bb_vec_info { basic_block bb; - /* All interleaving chains of stores in the basic block, represented by the + /* All interleaving chains of stores in the basic block, represented by the first stmt in the chain. */ VEC(gimple, heap) *strided_stores; - /* All SLP instances in the basic block. This is a subset of the set of + /* All SLP instances in the basic block. This is a subset of the set of STRIDED_STORES of the basic block. */ VEC(slp_instance, heap) *slp_instances; @@ -337,7 +337,7 @@ enum stmt_vec_info_type { loop_exit_ctrl_vec_info_type }; -/* Indicates whether/how a variable is used in the scope of loop/basic +/* Indicates whether/how a variable is used in the scope of loop/basic block. */ enum vect_relevant { vect_unused_in_scope = 0, @@ -349,33 +349,33 @@ enum vect_relevant { vect_used_in_outer, /* defs that feed computations that end up (only) in a reduction. These - defs may be used by non-reduction stmts, but eventually, any - computations/values that are affected by these defs are used to compute - a reduction (i.e. don't get stored to memory, for example). We use this - to identify computations that we can change the order in which they are + defs may be used by non-reduction stmts, but eventually, any + computations/values that are affected by these defs are used to compute + a reduction (i.e. don't get stored to memory, for example). We use this + to identify computations that we can change the order in which they are computed. */ vect_used_by_reduction, - vect_used_in_scope + vect_used_in_scope }; /* The type of vectorization that can be applied to the stmt: regular loop-based vectorization; pure SLP - the stmt is a part of SLP instances and does not have uses outside SLP instances; or hybrid SLP and loop-based - the stmt is a part of SLP instance and also must be loop-based vectorized, since it has - uses outside SLP sequences. - - In the loop context the meanings of pure and hybrid SLP are slightly - different. By saying that pure SLP is applied to the loop, we mean that we - exploit only intra-iteration parallelism in the loop; i.e., the loop can be - vectorized without doing any conceptual unrolling, cause we don't pack - together stmts from different iterations, only within a single iteration. - Loop hybrid SLP means that we exploit both intra-iteration and + uses outside SLP sequences. + + In the loop context the meanings of pure and hybrid SLP are slightly + different. By saying that pure SLP is applied to the loop, we mean that we + exploit only intra-iteration parallelism in the loop; i.e., the loop can be + vectorized without doing any conceptual unrolling, cause we don't pack + together stmts from different iterations, only within a single iteration. + Loop hybrid SLP means that we exploit both intra-iteration and inter-iteration parallelism (e.g., number of elements in the vector is 4 - and the slp-group-size is 2, in which case we don't have enough parallelism - within an iteration, so we obtain the rest of the parallelism from subsequent + and the slp-group-size is 2, in which case we don't have enough parallelism + within an iteration, so we obtain the rest of the parallelism from subsequent iterations by unrolling the loop by 2). */ -enum slp_vect_type { +enum slp_vect_type { loop_vect = 0, pure_slp, hybrid @@ -413,7 +413,7 @@ typedef struct _stmt_vec_info { /** The following is relevant only for stmts that contain a non-scalar - data-ref (array/pointer/struct access). A GIMPLE stmt is expected to have + data-ref (array/pointer/struct access). A GIMPLE stmt is expected to have at most one such data-ref. **/ /* Information about the data-ref (access function, etc), @@ -431,14 +431,14 @@ typedef struct _stmt_vec_info { /* Stmt is part of some pattern (computation idiom) */ bool in_pattern_p; - /* Used for various bookkeeping purposes, generally holding a pointer to - some other stmt S that is in some way "related" to this stmt. + /* Used for various bookkeeping purposes, generally holding a pointer to + some other stmt S that is in some way "related" to this stmt. Current use of this field is: - If this stmt is part of a pattern (i.e. the field 'in_pattern_p' is - true): S is the "pattern stmt" that represents (and replaces) the - sequence of stmts that constitutes the pattern. Similarly, the - related_stmt of the "pattern stmt" points back to this stmt (which is - the last stmt in the original sequence of stmts that constitutes the + If this stmt is part of a pattern (i.e. the field 'in_pattern_p' is + true): S is the "pattern stmt" that represents (and replaces) the + sequence of stmts that constitutes the pattern. Similarly, the + related_stmt of the "pattern stmt" points back to this stmt (which is + the last stmt in the original sequence of stmts that constitutes the pattern). */ gimple related_stmt; @@ -470,7 +470,7 @@ typedef struct _stmt_vec_info { bool read_write_dep; /* Vectorization costs associated with statement. */ - struct + struct { int outside_of_loop; /* Statements generated outside loop. */ int inside_of_loop; /* Statements generated inside loop. */ @@ -478,7 +478,7 @@ typedef struct _stmt_vec_info { /* Whether the stmt is SLPed, loop-based vectorized, or both. */ enum slp_vect_type slp_type; - + /* The bb_vec_info with respect to which STMT is vectorized. */ bb_vec_info bb_vinfo; } *stmt_vec_info; @@ -558,7 +558,7 @@ typedef struct _stmt_vec_info { #endif /* Cost of any vector operation, excluding load, store or vector to scalar - operation. */ + operation. */ #ifndef TARG_VEC_STMT_COST #define TARG_VEC_STMT_COST 1 #endif @@ -683,25 +683,25 @@ is_loop_header_bb_p (basic_block bb) return false; } -static inline void -stmt_vinfo_set_inside_of_loop_cost (stmt_vec_info stmt_info, slp_tree slp_node, +static inline void +stmt_vinfo_set_inside_of_loop_cost (stmt_vec_info stmt_info, slp_tree slp_node, int cost) { if (slp_node) SLP_TREE_INSIDE_OF_LOOP_COST (slp_node) = cost; else STMT_VINFO_INSIDE_OF_LOOP_COST (stmt_info) = cost; -} +} -static inline void -stmt_vinfo_set_outside_of_loop_cost (stmt_vec_info stmt_info, slp_tree slp_node, +static inline void +stmt_vinfo_set_outside_of_loop_cost (stmt_vec_info stmt_info, slp_tree slp_node, int cost) { if (slp_node) SLP_TREE_OUTSIDE_OF_LOOP_COST (slp_node) = cost; else STMT_VINFO_OUTSIDE_OF_LOOP_COST (stmt_info) = cost; -} +} static inline int vect_pow2 (int x) @@ -743,7 +743,7 @@ extern LOC vect_loop_location; /* Function prototypes. */ /*-----------------------------------------------------------------*/ -/* Simple loop peeling and versioning utilities for vectorizer's purposes - +/* Simple loop peeling and versioning utilities for vectorizer's purposes - in tree-vect-loop-manip.c. */ extern void slpeel_make_loop_iterate_ntimes (struct loop *, tree); extern bool slpeel_can_duplicate_loop_p (const struct loop *, const_edge); @@ -759,13 +759,13 @@ extern tree get_vectype_for_scalar_type (tree); extern bool vect_is_simple_use (tree, loop_vec_info, bb_vec_info, gimple *, tree *, enum vect_def_type *); extern bool supportable_widening_operation (enum tree_code, gimple, tree, - tree *, tree *, enum tree_code *, - enum tree_code *, int *, + tree *, tree *, enum tree_code *, + enum tree_code *, int *, VEC (tree, heap) **); extern bool supportable_narrowing_operation (enum tree_code, const_gimple, - tree, enum tree_code *, int *, + tree, enum tree_code *, int *, VEC (tree, heap) **); -extern stmt_vec_info new_stmt_vec_info (gimple stmt, loop_vec_info, +extern stmt_vec_info new_stmt_vec_info (gimple stmt, loop_vec_info, bb_vec_info); extern void free_stmt_vec_info (gimple stmt); extern tree vectorizable_function (gimple, tree, tree); @@ -786,9 +786,9 @@ extern bool vect_transform_stmt (gimple, gimple_stmt_iterator *, bool *, slp_tree, slp_instance); extern void vect_remove_stores (gimple); extern bool vect_analyze_stmt (gimple, bool *, slp_tree); -extern bool vectorizable_condition (gimple, gimple_stmt_iterator *, gimple *, +extern bool vectorizable_condition (gimple, gimple_stmt_iterator *, gimple *, tree, int); - + /* In tree-vect-data-refs.c. */ extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int); extern enum dr_alignment_support vect_supportable_dr_alignment @@ -803,7 +803,7 @@ extern bool vect_analyze_data_ref_accesses (loop_vec_info, bb_vec_info); extern bool vect_prune_runtime_alias_test_list (loop_vec_info); extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info); extern tree vect_create_data_ref_ptr (gimple, struct loop *, tree, tree *, - gimple *, bool, bool *); + gimple *, bool, bool *); extern tree bump_vector_ptr (tree, gimple, gimple_stmt_iterator *, gimple, tree); extern tree vect_create_destination_var (tree, tree); extern bool vect_strided_store_supported (tree); @@ -811,7 +811,7 @@ extern bool vect_strided_load_supported (tree); extern bool vect_permute_store_chain (VEC(tree,heap) *,unsigned int, gimple, gimple_stmt_iterator *, VEC(tree,heap) **); extern tree vect_setup_realignment (gimple, gimple_stmt_iterator *, tree *, - enum dr_alignment_support, tree, + enum dr_alignment_support, tree, struct loop **); extern bool vect_permute_load_chain (VEC(tree,heap) *,unsigned int, gimple, gimple_stmt_iterator *, VEC(tree,heap) **); @@ -843,7 +843,7 @@ extern int vect_min_worthwhile_factor (enum tree_code); /* In tree-vect-slp.c. */ extern void vect_free_slp_instance (slp_instance); extern bool vect_transform_slp_perm_load (gimple, VEC (tree, heap) *, - gimple_stmt_iterator *, int, + gimple_stmt_iterator *, int, slp_instance, bool); extern bool vect_schedule_slp (loop_vec_info, bb_vec_info); extern void vect_update_slp_costs_according_to_vf (loop_vec_info); -- cgit v1.2.1 From 07be02da583ec431d0e0bbffc96970e289e1e020 Mon Sep 17 00:00:00 2001 From: irar Date: Tue, 16 Feb 2010 11:35:03 +0000 Subject: PR tree-optimization/43074 * tree-vectorizer.h (VECTORIZABLE_CYCLE_DEF): New. * tree-vect-loop.c (vect_analyze_loop_operations): Add vectorizable cycles in hybrid SLP check. * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156800 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index b7c6316f9c6..2217a7ccc03 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -66,6 +66,10 @@ enum vect_def_type { vect_unknown_def_type }; +#define VECTORIZABLE_CYCLE_DEF(D) (((D) == vect_reduction_def) \ + || ((D) == vect_double_reduction_def) \ + || ((D) == vect_nested_cycle)) + /* Define verbosity levels. */ enum verbosity_levels { REPORT_NONE, -- cgit v1.2.1 From 7cf0dbf3e5eee1286c76c26a836622c9c9974736 Mon Sep 17 00:00:00 2001 From: steven Date: Fri, 2 Apr 2010 19:54:46 +0000 Subject: * ada/gcc-interface/Make-lang.in, alias.c, attribs.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, calls.c, c-common.c, cgraph.h, collect2.h, config/alpha/alpha.c, config/alpha/alpha.md, config/alpha/predicates.md, config/arm/arm.md, config/arm/lib1funcs.asm, config/arm/neon-schedgen.ml, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin.c, config/darwin9.h, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cpuid.h, config/i386/cygming.h, config/i386/cygwin.h, config/i386/mingw32.h, config/i386/msformat-c.c, config/i386/sol2-10.h, config/i386/xopintrin.h, config/ia64/ia64.c, config/ia64/ia64.md, config/ia64/sync.md, config/mep/mep.c, config/mips/mips.md, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.md, config/rs6000/aix.h, config/rs6000/dfp.md, config/rs6000/rs6000-builtin.def, config/rs6000/rs6000-c.c, config/rs6000/vector.md, config/rtems.h, config/rx/rx.md, config/s390/s390.md, config/sol2-c.c, config/sparc/sol2-bi.h, config/sparc/sol2-gas.h, config/sparc/sparc.h, config/sparc/sparc.md, config/sparc/sparc-protos.h, config/spu/spu.c, config/spu/spu-c.c, config/t-darwin, convert.c, c.opt, c-opts.c, cp/Make-lang.in, c-pretty-print.c, c-typeck.c, df-core.c, df-scan.c, diagnostic.c, diagnostic.h, doc/cppopts.texi, doc/cpp.texi, doc/extend.texi, doc/gimple.texi, doc/languages.texi, doc/plugins.texi, doc/rtl.texi, doc/standards.texi, doc/tree-ssa.texi, doc/trouble.texi, dominance.c, fold-const.c, fortran/Make-lang.in, fwprop.c, gcc-plugin.h, gensupport.c, gimple.h, gimple-iterator.c, graphite.c, graphite-clast-to-gimple.c, graphite-clast-to-gimple.h, graphite-dependences.c, graphite-poly.c, graphite-poly.h, graphite-ppl.c, graphite-ppl.h, graphite-scop-detection.c, graphite-sese-to-poly.c, graphite-sese-to-poly.h, ifcvt.c, intl.c, intl.h, ipa.c, ipa-cp.c, ipa-inline.c, ipa-prop.c, ipa-prop.h, ipa-pure-const.c, ipa-reference.c, ipa-type-escape.c, ira-color.c, ira-conflicts.c, ira-lives.c, java/Make-lang.in, lambda-code.c, loop-invariant.c, lto/Make-lang.in, lto-streamer.h, lto-streamer-in.c, objc/Make-lang.in, objcp/Make-lang.in, omp-low.c, optc-gen.awk, opt-functions.awk, opth-gen.awk, params.def, passes.c, postreload-gcse.c, print-tree.c, recog.c, regrename.c, reload.h, rtl.def, sched-int.h, sched-rgn.c, sel-sched-dump.c, sese.c, sese.h, store-motion.c, stor-layout.c, tree-cfgcleanup.c, tree-chrec.c, tree-complex.c, tree-data-ref.c, tree.def, tree-eh.c, tree-flow.h, tree-flow-inline.h, tree.h, tree-loop-distribution.c, tree-outof-ssa.c, tree-parloops.c, tree-pass.h, tree-predcom.c, tree-profile.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-manip.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-pre.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.h, tree-vect-slp.c, tree-vrp.c, unwind-dw2-fde-darwin.c, varpool.c: Update copyright years. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157950 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 2217a7ccc03..53a15e131cf 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1,6 +1,6 @@ /* Vectorizer - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free - Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. Contributed by Dorit Naishlos This file is part of GCC. -- cgit v1.2.1 From b334cbba7fd3fdc5b6ab35291a0715563f8bb3c8 Mon Sep 17 00:00:00 2001 From: rguenth Date: Fri, 9 Apr 2010 10:40:14 +0000 Subject: 2010-04-09 Richard Guenther * tree-vectorizer.h (struct _stmt_vec_info): Document that vectype is the type of the LHS. (supportable_widening_operation, supportable_narrowing_operation): Get both input and output vector types as arguments. (vect_is_simple_use_1): Declare. (get_same_sized_vectype): Likewise. * tree-vect-loop.c (vect_determine_vectorization_factor): Set STMT_VINFO_VECTYPE to the vector type of the def. (vectorizable_reduction): Adjust. * tree-vect-patterns.c (vect_recog_widen_mult_pattern): Adjust. Specify the output vector type. (vect_pattern_recog_1): Adjust. * tree-vect-stmts.c (get_same_sized_vectype): New function. (vectorizable_call): Adjust. (vectorizable_conversion): Likewise. (vectorizable_operation): Likewise. (vectorizable_type_demotion): Likewise. (vectorizable_type_promotion): Likewise. (vect_analyze_stmt): Set STMT_VINFO_VECTYPE to the vector type of the def. (vect_is_simple_use_1): New function. (supportable_widening_operation): Get both input and output vector types. (supportable_narrowing_operation): Likewise. * tree-vect-slp.c (vect_schedule_slp_instance): Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158157 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 53a15e131cf..b46bc52c25b 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -409,7 +409,7 @@ typedef struct _stmt_vec_info { used outside the loop. */ bool live; - /* The vector type to be used. */ + /* The vector type to be used for the LHS of this statement. */ tree vectype; /* The vectorized version of the stmt. */ @@ -760,15 +760,18 @@ extern bool vect_can_advance_ivs_p (loop_vec_info); /* In tree-vect-stmts.c. */ extern tree get_vectype_for_scalar_type (tree); +extern tree get_same_sized_vectype (tree, tree); extern bool vect_is_simple_use (tree, loop_vec_info, bb_vec_info, gimple *, tree *, enum vect_def_type *); -extern bool supportable_widening_operation (enum tree_code, gimple, tree, +extern bool vect_is_simple_use_1 (tree, loop_vec_info, bb_vec_info, gimple *, + tree *, enum vect_def_type *, tree *); +extern bool supportable_widening_operation (enum tree_code, gimple, tree, tree, tree *, tree *, enum tree_code *, enum tree_code *, int *, VEC (tree, heap) **); -extern bool supportable_narrowing_operation (enum tree_code, const_gimple, - tree, enum tree_code *, int *, - VEC (tree, heap) **); +extern bool supportable_narrowing_operation (enum tree_code, tree, tree, + enum tree_code *, + int *, VEC (tree, heap) **); extern stmt_vec_info new_stmt_vec_info (gimple stmt, loop_vec_info, bb_vec_info); extern void free_stmt_vec_info (gimple stmt); -- cgit v1.2.1 From 91a74fc6ef3473f7087e00a5861d01550afd166f Mon Sep 17 00:00:00 2001 From: rguenth Date: Tue, 13 Apr 2010 09:48:26 +0000 Subject: 2010-04-13 Richard Guenther * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Only add RW dependence for dependence distance zero. Adjust maximal vectorization factor according to dependences. Move alignment handling ... (vect_find_same_alignment_drs): ... here. New function. (vect_analyze_data_ref_dependences): Adjust. (vect_analyze_data_refs_alignment): Call vect_find_same_alignment_drs. (vect_analyze_data_refs): Adjust minimal vectorization factor according to data references. * tree-vect-loop.c (vect_analyze_loop): Analyze data-ref dependences before determining the vectorization factor. Analyze alignment after determining the vectorization factor. * tree-vect-slp.c ((vect_slp_analyze_bb): Analyze data-ref dependences before alignment. * tree-vectorizer.h (vect_analyze_data_ref_dependences): Adjust prototype. (vect_analyze_data_refs): Likewise. (MAX_VECTORIZATION_FACTOR): New define. * gcc.dg/vect/no-vfa-vect-depend-1.c: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158259 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index b46bc52c25b..52b2a7ec59f 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -601,6 +601,9 @@ typedef struct _stmt_vec_info { conversion. */ #define MAX_INTERM_CVT_STEPS 3 +/* The maximum vectorization factor supported by any target (V32QI). */ +#define MAX_VECTORIZATION_FACTOR 32 + /* Avoid GTY(()) on stmt_vec_info. */ typedef void *vec_void_p; DEF_VEC_P (vec_void_p); @@ -802,13 +805,14 @@ extern enum dr_alignment_support vect_supportable_dr_alignment (struct data_reference *); extern tree vect_get_smallest_scalar_type (gimple, HOST_WIDE_INT *, HOST_WIDE_INT *); -extern bool vect_analyze_data_ref_dependences (loop_vec_info, bb_vec_info); +extern bool vect_analyze_data_ref_dependences (loop_vec_info, bb_vec_info, + int *); extern bool vect_enhance_data_refs_alignment (loop_vec_info); extern bool vect_analyze_data_refs_alignment (loop_vec_info, bb_vec_info); extern bool vect_verify_datarefs_alignment (loop_vec_info, bb_vec_info); extern bool vect_analyze_data_ref_accesses (loop_vec_info, bb_vec_info); extern bool vect_prune_runtime_alias_test_list (loop_vec_info); -extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info); +extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info, int *); extern tree vect_create_data_ref_ptr (gimple, struct loop *, tree, tree *, gimple *, bool, bool *); extern tree bump_vector_ptr (tree, gimple, gimple_stmt_iterator *, gimple, tree); -- cgit v1.2.1 From eefa05c8770525ed2f8f7be166d395673acefd2c Mon Sep 17 00:00:00 2001 From: irar Date: Mon, 19 Apr 2010 09:10:45 +0000 Subject: 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158506 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 52b2a7ec59f..bd43a4bc173 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -242,6 +242,9 @@ typedef struct _loop_vec_info { /* The unrolling factor needed to SLP the loop. In case of that pure SLP is applied to the loop, i.e., no unrolling is needed, this is 1. */ unsigned slp_unrolling_factor; + + /* Reduction cycles detected in the loop. Used in loop-aware SLP. */ + VEC (gimple, heap) *reductions; } *loop_vec_info; /* Access Functions. */ @@ -266,6 +269,7 @@ typedef struct _loop_vec_info { #define LOOP_VINFO_STRIDED_STORES(L) (L)->strided_stores #define LOOP_VINFO_SLP_INSTANCES(L) (L)->slp_instances #define LOOP_VINFO_SLP_UNROLLING_FACTOR(L) (L)->slp_unrolling_factor +#define LOOP_VINFO_REDUCTIONS(L) (L)->reductions #define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \ VEC_length (gimple, (L)->may_misalign_stmts) > 0 @@ -844,7 +848,8 @@ extern void vect_transform_loop (loop_vec_info); extern loop_vec_info vect_analyze_loop_form (struct loop *); extern bool vectorizable_live_operation (gimple, gimple_stmt_iterator *, gimple *); -extern bool vectorizable_reduction (gimple, gimple_stmt_iterator *, gimple *); +extern bool vectorizable_reduction (gimple, gimple_stmt_iterator *, gimple *, + slp_tree); extern bool vectorizable_induction (gimple, gimple_stmt_iterator *, gimple *); extern int vect_estimate_min_profitable_iters (loop_vec_info); extern tree get_initial_def_for_reduction (gimple, tree, tree *); @@ -862,7 +867,7 @@ extern bool vect_analyze_slp (loop_vec_info, bb_vec_info); extern void vect_make_slp_decision (loop_vec_info); extern void vect_detect_hybrid_slp (loop_vec_info); extern void vect_get_slp_defs (slp_tree, VEC (tree,heap) **, - VEC (tree,heap) **); + VEC (tree,heap) **, int); extern LOC find_bb_location (basic_block); extern bb_vec_info vect_slp_analyze_bb (basic_block); extern void vect_slp_transform_bb (basic_block); -- cgit v1.2.1 From 6ea6a380355ec8324844a76243c61db77eab2b8b Mon Sep 17 00:00:00 2001 From: irar Date: Mon, 26 Apr 2010 06:39:27 +0000 Subject: * tree-vectorizer.h (struct _stmt_vec_info): Add new field to determine if the statement is vectorizable, and a macro to access it. * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Skip statements that can't be vectorized. If the analysis fails, mark the statement as unvectorizable if vectorizing basic block. (vect_compute_data_refs_alignment): Likewise. (vect_verify_datarefs_alignment): Skip statements marked as unvectorizable. Add print. (vect_analyze_group_access): Skip statements that can't be vectorized. If the analysis fails, mark the statement as unvectorizable if vectorizing basic block. (vect_analyze_data_ref_accesses, vect_analyze_data_refs): Likewise. * tree-vect-stmts.c (vectorizable_store): Fix the number of generated stmts for SLP. (new_stmt_vec_info): Initialize the new field. * tree-vect-slp.c (vect_build_slp_tree): Fail to vectorize statements marked as unvectorizable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158719 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index bd43a4bc173..c80c34529e4 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -489,6 +489,10 @@ typedef struct _stmt_vec_info { /* The bb_vec_info with respect to which STMT is vectorized. */ bb_vec_info bb_vinfo; + + /* Is this statement vectorizable or should it be skipped in (partial) + vectorization. */ + bool vectorizable; } *stmt_vec_info; /* Access Functions. */ @@ -500,6 +504,7 @@ typedef struct _stmt_vec_info { #define STMT_VINFO_LIVE_P(S) (S)->live #define STMT_VINFO_VECTYPE(S) (S)->vectype #define STMT_VINFO_VEC_STMT(S) (S)->vectorized_stmt +#define STMT_VINFO_VECTORIZABLE(S) (S)->vectorizable #define STMT_VINFO_DATA_REF(S) (S)->data_ref_info #define STMT_VINFO_DR_BASE_ADDRESS(S) (S)->dr_base_address -- cgit v1.2.1 From 609c710b62c353e5c6732db421774980ef5f0cc4 Mon Sep 17 00:00:00 2001 From: froydnj Date: Mon, 26 Apr 2010 18:21:17 +0000 Subject: * cfgloop.h (struct loop): Move can_be_parallel field up. * ipa-prop.h (struct ip_node_params): Move bitfields up. * tree-ssa-loop-ivopts.c (struct version_info): Move inv_id field down. (struct iv_cand): Convert pos field into a bitfield. * tree-vectorizer.h (struct _loop_vec_info): Move loop_line_number field up. (struct _stmt_vec_info): Shuffle fields for better packing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158743 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index c80c34529e4..fc9f0e93af0 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -198,6 +198,9 @@ typedef struct _loop_vec_info { /* Unrolling factor */ int vectorization_factor; + /* The loop location in the source. */ + LOC loop_line_number; + /* Unknown DRs according to which loop was peeled. */ struct data_reference *unaligned_dr; @@ -228,9 +231,6 @@ typedef struct _loop_vec_info { runtime (loop versioning) misalignment check. */ VEC(gimple,heap) *may_misalign_stmts; - /* The loop location in the source. */ - LOC loop_line_number; - /* All interleaving chains of stores in the loop, represented by the first stmt in the chain. */ VEC(gimple, heap) *strided_stores; @@ -398,21 +398,23 @@ typedef struct _stmt_vec_info { enum stmt_vec_info_type type; + /* Indicates whether this stmts is part of a computation whose result is + used outside the loop. */ + bool live; + + /* Stmt is part of some pattern (computation idiom) */ + bool in_pattern_p; + + /* For loads only, if there is a store with the same location, this field is + TRUE. */ + bool read_write_dep; + /* The stmt to which this info struct refers to. */ gimple stmt; /* The loop_vec_info with respect to which STMT is vectorized. */ loop_vec_info loop_vinfo; - /* Not all stmts in the loop need to be vectorized. e.g, the increment - of the loop induction variable and computation of array indexes. relevant - indicates whether the stmt needs to be vectorized. */ - enum vect_relevant relevant; - - /* Indicates whether this stmts is part of a computation whose result is - used outside the loop. */ - bool live; - /* The vector type to be used for the LHS of this statement. */ tree vectype; @@ -436,9 +438,6 @@ typedef struct _stmt_vec_info { tree dr_step; tree dr_aligned_to; - /* Stmt is part of some pattern (computation idiom) */ - bool in_pattern_p; - /* Used for various bookkeeping purposes, generally holding a pointer to some other stmt S that is in some way "related" to this stmt. Current use of this field is: @@ -457,11 +456,17 @@ typedef struct _stmt_vec_info { /* Classify the def of this stmt. */ enum vect_def_type def_type; + /* Whether the stmt is SLPed, loop-based vectorized, or both. */ + enum slp_vect_type slp_type; + /* Interleaving info. */ /* First data-ref in the interleaving group. */ gimple first_dr; /* Pointer to the next data-ref in the group. */ gimple next_dr; + /* In case that two or more stmts share data-ref, this is the pointer to the + previously detected stmt with the same dr. */ + gimple same_dr_stmt; /* The size of the interleaving group. */ unsigned int size; /* For stores, number of stores from this group seen. We vectorize the last @@ -470,12 +475,11 @@ typedef struct _stmt_vec_info { /* For loads only, the gap from the previous load. For consecutive loads, GAP is 1. */ unsigned int gap; - /* In case that two or more stmts share data-ref, this is the pointer to the - previously detected stmt with the same dr. */ - gimple same_dr_stmt; - /* For loads only, if there is a store with the same location, this field is - TRUE. */ - bool read_write_dep; + + /* Not all stmts in the loop need to be vectorized. e.g, the increment + of the loop induction variable and computation of array indexes. relevant + indicates whether the stmt needs to be vectorized. */ + enum vect_relevant relevant; /* Vectorization costs associated with statement. */ struct @@ -484,9 +488,6 @@ typedef struct _stmt_vec_info { int inside_of_loop; /* Statements generated inside loop. */ } cost; - /* Whether the stmt is SLPed, loop-based vectorized, or both. */ - enum slp_vect_type slp_type; - /* The bb_vec_info with respect to which STMT is vectorized. */ bb_vec_info bb_vinfo; -- cgit v1.2.1 From f4a50267b9196603596fb82bb914e9000848cc1a Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 10 May 2010 14:31:37 +0000 Subject: * tree-ssa-reassoc.c (undistribute_ops_list): Use create_tmp_reg. (can_reassociate_p): Use FLOAT_TYPE_P. * tree-vectorizer.h (vect_is_simple_reduction): Rename to ... (vect_force_simple_reduction): ... this. * tree-parloops.c (gather_scalar_reductions): Use vect_force_simple_reduction. * tree-vect-loop.c (vect_is_simple_reduction_1): Rename from vect_is_simple_reduction, add modify argument, if true rewrite "a-b" into "a+(-b)". (vect_is_simple_reduction, vect_force_simple_reduction): New functions. (vect_analyze_scalar_cycles_1): Use vect_force_simple_reduction. testsuite/ * gcc.dg/vect/fast-math-vect-reduc-8.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159226 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index fc9f0e93af0..79fe6abfa78 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -846,7 +846,7 @@ extern tree vect_create_addr_base_for_vector_ref (gimple, gimple_seq *, /* In tree-vect-loop.c. */ /* FORNOW: Used in tree-parloops.c. */ extern void destroy_loop_vec_info (loop_vec_info, bool); -extern gimple vect_is_simple_reduction (loop_vec_info, gimple, bool, bool *); +extern gimple vect_force_simple_reduction (loop_vec_info, gimple, bool, bool *); /* Drive for loop analysis stage. */ extern loop_vec_info vect_analyze_loop (struct loop *); /* Drive for loop transformation stage. */ -- cgit v1.2.1 From 559093aa044bc634faa14f8895ca037e8dde2715 Mon Sep 17 00:00:00 2001 From: irar Date: Mon, 7 Jun 2010 09:12:32 +0000 Subject: * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Update documentation. * targhooks.c (default_builtin_vectorization_cost): New function. * targhooks.h (default_builtin_vectorization_cost): Declare. * target.h (enum vect_cost_for_stmt): Define. (builtin_vectorization_cost): Change argument and comment. * tree-vectorizer.h: Remove cost model macros. * tree-vect-loop.c: Include target.h. (vect_get_cost): New function. (vect_estimate_min_profitable_iters): Replace cost model macros with calls to vect_get_cost. (vect_model_reduction_cost, vect_model_induction_cost): Likewise. * target-def.h (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Add default implementation. * tree-vect-stmts.c (cost_for_stmt): Replace cost model macros with calls to target hook builtin_vectorization_cost. (vect_model_simple_cost, vect_model_store_cost, vect_model_load_cost): Likewise. * Makefile.in (tree-vect-loop.o): Add dependency on TARGET_H. * config/spu/spu.c (spu_builtin_vectorization_cost): Replace with new implementation to return costs. * config/i386/i386.c (ix86_builtin_vectorization_cost): Likewise. * config/spu/spu.h: Remove vectorizer cost model macros. * config/i386/i386.h: Likewise. * tree-vect-slp.c (vect_build_slp_tree): Replace cost model macro with a call to target hook builtin_vectorization_cost. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160360 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 64 --------------------------------------------------- 1 file changed, 64 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 79fe6abfa78..11795d88632 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -543,70 +543,6 @@ typedef struct _stmt_vec_info { #define PURE_SLP_STMT(S) ((S)->slp_type == pure_slp) #define STMT_SLP_TYPE(S) (S)->slp_type -/* These are some defines for the initial implementation of the vectorizer's - cost model. These will later be target specific hooks. */ - -/* Cost of conditional taken branch. */ -#ifndef TARG_COND_TAKEN_BRANCH_COST -#define TARG_COND_TAKEN_BRANCH_COST 3 -#endif - -/* Cost of conditional not taken branch. */ -#ifndef TARG_COND_NOT_TAKEN_BRANCH_COST -#define TARG_COND_NOT_TAKEN_BRANCH_COST 1 -#endif - -/* Cost of any scalar operation, excluding load and store. */ -#ifndef TARG_SCALAR_STMT_COST -#define TARG_SCALAR_STMT_COST 1 -#endif - -/* Cost of scalar load. */ -#ifndef TARG_SCALAR_LOAD_COST -#define TARG_SCALAR_LOAD_COST 1 -#endif - -/* Cost of scalar store. */ -#ifndef TARG_SCALAR_STORE_COST -#define TARG_SCALAR_STORE_COST 1 -#endif - -/* Cost of any vector operation, excluding load, store or vector to scalar - operation. */ -#ifndef TARG_VEC_STMT_COST -#define TARG_VEC_STMT_COST 1 -#endif - -/* Cost of vector to scalar operation. */ -#ifndef TARG_VEC_TO_SCALAR_COST -#define TARG_VEC_TO_SCALAR_COST 1 -#endif - -/* Cost of scalar to vector operation. */ -#ifndef TARG_SCALAR_TO_VEC_COST -#define TARG_SCALAR_TO_VEC_COST 1 -#endif - -/* Cost of aligned vector load. */ -#ifndef TARG_VEC_LOAD_COST -#define TARG_VEC_LOAD_COST 1 -#endif - -/* Cost of misaligned vector load. */ -#ifndef TARG_VEC_UNALIGNED_LOAD_COST -#define TARG_VEC_UNALIGNED_LOAD_COST 2 -#endif - -/* Cost of vector store. */ -#ifndef TARG_VEC_STORE_COST -#define TARG_VEC_STORE_COST 1 -#endif - -/* Cost of vector permutation. */ -#ifndef TARG_VEC_PERMUTE_COST -#define TARG_VEC_PERMUTE_COST 1 -#endif - /* The maximum number of intermediate steps required in multi-step type conversion. */ #define MAX_INTERM_CVT_STEPS 3 -- cgit v1.2.1 From e95895ef52353afa8dc6426ed728a5a3b1d33cea Mon Sep 17 00:00:00 2001 From: hubicka Date: Wed, 9 Jun 2010 15:41:23 +0000 Subject: * cgraph.h (varpool_first_static_initializer, varpool_next_static_initializer): Make checking only when checking enabled. * tree-vectorizer.h (vinfo_for_stmt): Remove check. (set_vinfo_for_stmt, get_earlier_stmt, is_loop_header_bb_p): Change gcc_assert to gcc_checking_assert. * tree-flow-inline.h (gimple_vop, get_var_ann, relink_imm_use, phi_nodes set_phi_nodes, phi_arg_index_from_use, op_iter_next_use, op_iter_next_def, op_iter_next_tree, op_iter_init, op_iter_init_use, op_iter_init_phiuse, op_iter_init_phidef, array_ref_contains_indirect_ref, ref_contains_array_ref): Use gcc_checking_assert. * emit-rtl.h (set_first_insn, set_last_insn): Likewise. * tree-ssa-live.h (var_to_partition, var_to_partition_to_var, partition_is_global, live_on_entry, live_on_exit, live_merge_and_clear): Likewise. * system.h (gcc_checking_assert): New macro. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160489 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 11795d88632..bf6769c69a7 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -567,7 +567,6 @@ vinfo_for_stmt (gimple stmt) if (uid == 0) return NULL; - gcc_assert (uid <= VEC_length (vec_void_p, stmt_vec_info_vec)); return (stmt_vec_info) VEC_index (vec_void_p, stmt_vec_info_vec, uid - 1); } @@ -577,7 +576,7 @@ set_vinfo_for_stmt (gimple stmt, stmt_vec_info info) unsigned int uid = gimple_uid (stmt); if (uid == 0) { - gcc_assert (info); + gcc_checking_assert (info); uid = VEC_length (vec_void_p, stmt_vec_info_vec) + 1; gimple_set_uid (stmt, uid); VEC_safe_push (vec_void_p, heap, stmt_vec_info_vec, (vec_void_p) info); @@ -603,8 +602,8 @@ get_earlier_stmt (gimple stmt1, gimple stmt2) if (uid1 == 0 || uid2 == 0) return NULL; - gcc_assert (uid1 <= VEC_length (vec_void_p, stmt_vec_info_vec)); - gcc_assert (uid2 <= VEC_length (vec_void_p, stmt_vec_info_vec)); + gcc_checking_assert (uid1 <= VEC_length (vec_void_p, stmt_vec_info_vec) + && uid2 <= VEC_length (vec_void_p, stmt_vec_info_vec)); if (uid1 < uid2) return stmt1; @@ -632,7 +631,7 @@ is_loop_header_bb_p (basic_block bb) { if (bb == (bb->loop_father)->header) return true; - gcc_assert (EDGE_COUNT (bb->preds) == 1); + gcc_checking_assert (EDGE_COUNT (bb->preds) == 1); return false; } -- cgit v1.2.1 From 0822b158e9f917b79d48c9866ca15e6eb6179ff1 Mon Sep 17 00:00:00 2001 From: irar Date: Sun, 4 Jul 2010 08:54:52 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161797 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.h | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index bf6769c69a7..ed8ff58312a 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -170,6 +170,21 @@ DEF_VEC_ALLOC_P(slp_instance, heap); #define SLP_TREE_OUTSIDE_OF_LOOP_COST(S) (S)->cost.outside_of_loop #define SLP_TREE_INSIDE_OF_LOOP_COST(S) (S)->cost.inside_of_loop + +typedef struct _vect_peel_info +{ + int npeel; + struct data_reference *dr; + unsigned int count; +} *vect_peel_info; + +typedef struct _vect_peel_extended_info +{ + struct _vect_peel_info peel_info; + unsigned int inside_cost; + unsigned int outside_cost; +} *vect_peel_extended_info; + /*-----------------------------------------------------------------*/ /* Info on vectorized loops. */ /*-----------------------------------------------------------------*/ @@ -245,6 +260,10 @@ typedef struct _loop_vec_info { /* Reduction cycles detected in the loop. Used in loop-aware SLP. */ VEC (gimple, heap) *reductions; + + /* Hash table used to choose the best peeling option. */ + htab_t peeling_htab; + } *loop_vec_info; /* Access Functions. */ @@ -270,6 +289,7 @@ typedef struct _loop_vec_info { #define LOOP_VINFO_SLP_INSTANCES(L) (L)->slp_instances #define LOOP_VINFO_SLP_UNROLLING_FACTOR(L) (L)->slp_unrolling_factor #define LOOP_VINFO_REDUCTIONS(L) (L)->reductions +#define LOOP_VINFO_PEELING_HTAB(L) (L)->peeling_htab #define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \ VEC_length (gimple, (L)->may_misalign_stmts) > 0 @@ -543,6 +563,8 @@ typedef struct _stmt_vec_info { #define PURE_SLP_STMT(S) ((S)->slp_type == pure_slp) #define STMT_SLP_TYPE(S) (S)->slp_type +#define VECT_MAX_COST 1000 + /* The maximum number of intermediate steps required in multi-step type conversion. */ #define MAX_INTERM_CVT_STEPS 3 @@ -743,11 +765,14 @@ extern void vect_remove_stores (gimple); extern bool vect_analyze_stmt (gimple, bool *, slp_tree); extern bool vectorizable_condition (gimple, gimple_stmt_iterator *, gimple *, tree, int); +extern void vect_get_load_cost (struct data_reference *, int, bool, + unsigned int *, unsigned int *); +extern void vect_get_store_cost (struct data_reference *, int, unsigned int *); /* In tree-vect-data-refs.c. */ extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int); extern enum dr_alignment_support vect_supportable_dr_alignment - (struct data_reference *); + (struct data_reference *, bool); extern tree vect_get_smallest_scalar_type (gimple, HOST_WIDE_INT *, HOST_WIDE_INT *); extern bool vect_analyze_data_ref_dependences (loop_vec_info, bb_vec_info, @@ -795,7 +820,8 @@ extern bool vectorizable_induction (gimple, gimple_stmt_iterator *, gimple *); extern int vect_estimate_min_profitable_iters (loop_vec_info); extern tree get_initial_def_for_reduction (gimple, tree, tree *); extern int vect_min_worthwhile_factor (enum tree_code); - +extern int vect_get_known_peeling_cost (loop_vec_info, int, int *, int); +extern int vect_get_single_scalar_iteraion_cost (loop_vec_info); /* In tree-vect-slp.c. */ extern void vect_free_slp_instance (slp_instance); -- cgit v1.2.1