Commit Graph

73 Commits

Author SHA1 Message Date
Ira Rosen 5181cd6a44 re PR tree-optimization/49478 (ice in expand_widen_pattern_expr with -O3)
PR tree-optimization/49478
        * tree-vect-loop.c (vectorizable_reduction): Handle DOT_PROD_EXPR
        with constant operand.

From-SVN: r175255
2011-06-21 11:58:33 +00:00
Ira Rosen 5131223306 tree-vectorizer.h (vect_recog_func_ptr): Change the first argument to be a VEC of statements.
* tree-vectorizer.h (vect_recog_func_ptr): Change the first
        argument to be a VEC of statements.
        * tree-vect-loop.c (vect_determine_vectorization_factor):
        Remove the assert that pattern statements have to have their
        vector type set.
        * tree-vect-patterns.c (vect_recog_widen_sum_pattern):
        Change the first argument to be a VEC of statements.  Update
        documentation.
        (vect_recog_dot_prod_pattern, vect_recog_pow_pattern): Likewise.
        (vect_handle_widen_mult_by_const): New function.
        (vect_recog_widen_mult_pattern):  Change the first argument to
        be a VEC of statements.  Update documentation.  Check that the
        constant is INTEGER_CST.  Support multiplication by a constant
        that fits an intermediate type - call
        vect_handle_widen_mult_by_const.
        (vect_pattern_recog_1): Update vect_recog_func_ptr and its
        call.  Handle additional pattern statements if necessary.

From-SVN: r175102
2011-06-16 12:08:37 +00:00
Ira Rosen 9d5e7640c3 tree-vect-loop-manip.c (remove_dead_stmts_from_loop): Remove.
* tree-vect-loop-manip.c (remove_dead_stmts_from_loop): Remove.
        (slpeel_tree_peel_loop_to_edge): Don't call
        remove_dead_stmts_from_loop.
        * tree-vect-loop.c (vect_determine_vectorization_factor): Don't
        remove irrelevant pattern statements.  For irrelevant statements
        check if it is the last statement of a detected pattern, use
        corresponding pattern statement instead.
        (destroy_loop_vec_info): No need to remove pattern statements,
        only free stmt_vec_info.
        (vect_transform_loop): For irrelevant statements check if it is
        the last statement of a detected pattern, use corresponding
        pattern statement instead.
        * tree-vect-patterns.c (vect_pattern_recog_1): Don't insert
        pattern statements.  Set basic block for the new statement.
        (vect_pattern_recog): Update documentation.
        * tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Scan
        operands of pattern statements.
        (vectorizable_call): Fix printing.  In case of a pattern
        statement use the lhs of the original statement when creating
        a dummy statement to replace the original call.
        (vect_analyze_stmt): For irrelevant statements check if it is
        the last statement of a detected pattern, use corresponding
        pattern statement instead.
        * tree-vect-slp.c (vect_schedule_slp_instance): For pattern
        statements use gsi of the original statement.

From-SVN: r175074
2011-06-15 06:27:32 +00:00
Jakub Jelinek 29f8523742 re PR tree-optimization/49352 (-fcompare-debug failure with -O2 -ftree-vectorize)
PR tree-optimization/49352
        * tree-vect-loop.c (vect_is_slp_reduction): Don't count debug
        uses at all, make sure loop_use_stmt after the loop is a def
        stmt of a used SSA_NAME that is the only one defined inside
        of the loop.  Don't check for COND_EXPR and GIMPLE_BINARY_RHS.
        (vect_is_simple_reduction_1): Call vect_is_slp_reduction only
        if check_reduction is true.


Co-Authored-By: Ira Rosen <ira.rosen@linaro.org>

From-SVN: r174982
2011-06-13 06:10:20 +00:00
Ira Rosen f2164f876f re PR tree-optimization/49318 (177.mesa in SPEC CPU 2000 failed to build)
PR tree-optimization/49318
        * tree-vect-loop.c (vect_determine_vectorization_factor):
        Remove irrelevant pattern statements.

From-SVN: r174891
2011-06-10 07:19:28 +00:00
Ira Rosen 69940d4d9e re PR tree-optimization/49199 (ICE: in vect_create_epilog_for_reduction at tree-vect-loop.c:3445 with -O -fno-tree-scev-cprop -ftree-vectorize -funswitch-loops)
PR tree-optimization/49199
        * tree-vect-loop.c (vect_is_slp_reduction): Check that the 
        non-reduction operands are either defined in the loop or
        by induction.

From-SVN: r174425
2011-05-30 07:15:31 +00:00
Ira Rosen 48df3fa66c re PR tree-optimization/49038 (-ftree-vectorise introduces reads past end of array)
PR tree-optimization/49038
        * tree-vect-loop-manip.c (vect_generate_tmps_on_preheader):
        Ensure at least one epilogue iteration if required by data
        accesses with gaps.
        * tree-vectorizer.h (struct _loop_vec_info): Add new field 
        to mark loops that require peeling for gaps.
        * tree-vect-loop.c (new_loop_vec_info): Initialize new field.
        (vect_get_known_peeling_cost): Take peeling for gaps into 
        account.
        (vect_transform_loop): Generate epilogue if required by data
        access with gaps.
        * tree-vect-data-refs.c (vect_analyze_group_access): Mark the
        loop as requiring an epilogue if there are gaps in the end of
        the strided group.

From-SVN: r174265
2011-05-26 07:50:09 +00:00
Ira Rosen e38fdc948a re PR tree-optimization/49087 (crash in vect_is_slp_reduction)
PR tree-optimization/49087
        * tree-vect-loop.c (vect_is_slp_reduction): Fail if
        LHS has no uses.

From-SVN: r174026
2011-05-22 08:04:43 +00:00
Ira Rosen b010117a6c re PR tree-optimization/41881 (Complete unrolling (inner) versus vectorization of reduction)
PR tree-optimization/41881
        * tree-vectorizer.h (struct _loop_vec_info): Add new field
        reduction_chains along with a macro for its access.
        * tree-vect-loop.c (new_loop_vec_info): Initialize
        reduction chains.
        (destroy_loop_vec_info): Free reduction chains.
        (vect_analyze_loop_2): Return false if
        vect_analyze_slp() returns false.
        (vect_is_slp_reduction): New function.
        (vect_is_simple_reduction_1): Call
        vect_is_slp_reduction.
        (vect_create_epilog_for_reduction): Support SLP
        reduction chains.
        * tree-vect-slp.c (vect_get_and_check_slp_defs): Allow
        different definition types for reduction chains.
        (vect_supported_load_permutation_p): Don't allow
        permutations for reduction chains.
        (vect_analyze_slp_instance): Support reduction chains.
        (vect_analyze_slp): Try to build SLP instance from
        reduction chains.
        (vect_get_constant_vectors):  Handle reduction chains.
        (vect_schedule_slp_instance): Mark the first statement
        of the reduction chain as reduction.

From-SVN: r173856
2011-05-18 11:27:51 +00:00
Ira Rosen e14c105000 tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use new names for group elements access.
* tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Use new
        names for group elements access.
        * tree-vectorizer.h (struct _stmt_vec_info): Use interleaving info for
        reduction chains as well.  Remove data reference and interleaving
        related words from the fields names.
        * tree-vect-loop.c (vect_transform_loop): Use new names for group
        elements access.
        * tree-vect-data-refs.c (vect_get_place_in_interleaving_chain,
         vect_insert_into_interleaving_chain, vect_update_interleaving_chain,
        vect_update_interleaving_chain, vect_same_range_drs,
        vect_analyze_data_ref_dependence, vect_update_misalignment_for_peel,
        vect_verify_datarefs_alignment, vector_alignment_reachable_p,
        vect_peeling_hash_get_lowest_cost, vect_enhance_data_refs_alignment,
        vect_analyze_group_access, vect_analyze_data_ref_access,
        vect_create_data_ref_ptr, vect_transform_strided_load,
        vect_record_strided_load_vectors): Likewise.
        * tree-vect-stmts.c (vect_model_simple_cost, vect_model_store_cost,
        vect_model_load_cost, vectorizable_store, vectorizable_load,
        vect_remove_stores, new_stmt_vec_info): Likewise.
        * tree-vect-slp.c (vect_build_slp_tree, 
        vect_supported_slp_permutation_p, vect_analyze_slp_instance): Likewise.

From-SVN: r173855
2011-05-18 11:09:44 +00:00
Richard Sandiford fdabf26955 tree-vect-loop.c (vectorizable_reduction): Check reduction cost before setting STMT_VINFO_TYPE.
gcc/
	* tree-vect-loop.c (vectorizable_reduction): Check reduction cost
	before setting STMT_VINFO_TYPE.

From-SVN: r173373
2011-05-04 13:09:26 +00:00
Ira Rosen 437f4a0024 re PR tree-optimization/48765 (ICE in vect_transform_stmt)
PR tree-optimization/48765
        * tree-vectorizer.h (vect_make_slp_decision): Return bool.
        * tree-vect-loop.c (vect_analyze_loop_operations): Add new
        argument to indicate if loop aware SLP is being used.  Scan
        the statements and update the vectorization factor
        according to the type of
        vectorization before statement analysis.
        (vect_analyze_loop_2): Get a return value from
        vect_make_slp_decision, pass it to 
        vect_analyze_loop_operations.
        (vectorizable_reduction): Set number of copies to 1 in case of
        pure SLP statement.
        * tree-vect-stmts.c (vectorizable_conversion,
        vectorizable_assignment, vectorizable_shift,
        vectorizable_operation, vectorizable_type_demotion,
        vectorizable_type_promotion, vectorizable_store,
        vectorizable_load): Likewise.
        (vectorizable_condition): Move the check that it is not SLP
        vectorization before the number of copies check.
        * tree-vect-slp.c (vect_make_slp_decision): Return TRUE if
        decided to vectorize the loop using SLP.

From-SVN: r173132
2011-04-28 19:50:28 +00:00
Ira Rosen 86c8d1f646 re PR tree-optimization/48290 (FAIL: gcc.dg/vect/pr38529.c, ICE in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1072)
PR tree-optimization/48290
        * tree-vect-loop.c (vect_analyze_loop_operations): In outer loop
        vectorization, check that relevant phis in the basic block after 
        the inner loop are really inner loop's exit phis.

From-SVN: r171657
2011-03-29 10:26:25 +00:00
Richard Guenther f471fe729f gimple.c (gimple_rhs_class_table): POLYNOMIAL_CHREC is not a valid RHS.
2011-03-22  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_rhs_class_table): POLYNOMIAL_CHREC is not
	a valid RHS.  Make DOT_PROD_EXPR and REALIGN_LOAD_EXPR ternary.
	* tree-cfg.c (verify_gimple_assign_ternary): Allow DOT_PROD_EXPR
	and REALIGN_LOAD_EXPR.
	(verify_gimple_assign_single): Do not allow POLYNOMIAL_CHREC,
	DOT_PROD_EXPR or REALIGN_LOAD_EXPR.
	* expr.c (expand_expr_real_1): Move REALIGN_LOAD_EXPR and
	DOT_PROD_EXPR case ...
	(expand_expr_real_2): ... here.
	* gimple-pretty-print.c (dump_ternary_rhs): Handle DOT_PROD_EXPR
	and REALIGN_LOAD_EXPR.
	* tree-data-ref.c (split_constant_offset): Bail out for all CHRECs.
	* tree-vect-loop.c (vect_model_reduction_cost): Handle ternaries.
	(vect_create_epilog_for_reduction): Likewise.
	(vectorizable_reduction): Likewise.
	* tree-vect-patterns.c (vect_recog_dot_prod_pattern): Adjust.
	* tree-vect-stmts.c (vectorizable_load): Likewise.

From-SVN: r171284
2011-03-22 11:12:57 +00:00
Richard Guenther f2ca11ca97 re PR tree-optimization/47890 (internal compiler error: in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1186)
2011-03-01  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/47890
	* tree-vect-loop.c (get_initial_def_for_induction): Set
	related stmt properly.

	* gcc.dg/torture/pr47890.c: New testcase.

From-SVN: r170593
2011-03-01 13:18:25 +00:00
Ira Rosen 210dedfec3 re PR tree-optimization/47139 (ice in process_use, at tree-vect-stmts.c:290)
PR tree-optimization/47139
        * tree-vect-loop.c (vect_is_simple_reduction_1): Check that 
        only the last reduction value is used outside the loop. Update
        documentation.

From-SVN: r168535
2011-01-06 07:34:24 +00:00
Sebastian Pop 01be8516aa Fix PR47002: memory leaks.
2010-12-23  Sebastian Pop  <sebastian.pop@amd.com>

	PR tree-optimization/47002
	* tree-data-ref.c (compute_data_dependences_for_loop): Pass in a
	pointer to the loop_nest.
	(analyze_all_data_dependences): Initialize and free the loop_nest.
	(free_dependence_relations): Do not free loop_nest.
	(build_rdg): Pass in the loop_nest, datarefs, and dependence_relations.
	(free_rdg): Also free the data on edges.
	* tree-data-ref.h (build_rdg): Update declaration.
	(compute_data_dependences_for_loop): Same.
	* tree-if-conv.c (if_convertible_loop_p_1): Pass in the loop_nest.
	(if_convertible_loop_p): Allocate and free loop_nest.
	* tree-loop-distribution.c (rdg_flag_loop_exits): Free conds.
	(free_rdg_components): VEC_free components.
	(distribute_loop): Update call to build_rdg.  Allocate and free
	loop_nest, datarefs, and dependence_relations.
	* tree-loop-linear.c (linear_transform_loops): Allocate and free
	loop_nest.
	* tree-parloops.c (loop_parallel_p): Same.
	* tree-predcom.c (tree_predictive_commoning_loop): Same.
	* tree-vect-data-refs.c (vect_analyze_data_refs): Pass to
	compute_data_dependences_for_loop a pointer to LOOP_VINFO_LOOP_NEST.
	* tree-vect-loop.c (new_loop_vec_info): Initialize LOOP_VINFO_LOOP_NEST.
	(destroy_loop_vec_info): Free LOOP_VINFO_MAY_ALIAS_DDRS and
	LOOP_VINFO_LOOP_NEST.
	* tree-vect-slp.c (destroy_bb_vec_info): Call free_data_refs and
	free_dependence_relations.
	* tree-vectorizer.h (struct _loop_vec_info): Add a field loop_nest.
	(LOOP_VINFO_LOOP_NEST): New.

From-SVN: r168210
2010-12-23 16:25:52 +00:00
Richard Guenther 4fc7469aba re PR tree-optimization/46785 (Doesn't vectorize reduction x += y*y)
2010-12-06  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/46785
	* tree-vect-loop.c (vect_is_simple_reduction_1): Also allow
	call statements as operand definition.

	* gcc.dg/vect/fast-math-vect-reduc-9.c: New testcase.

From-SVN: r167486
2010-12-06 10:05:07 +00:00
Richard Guenther b2087e8dad tree-vect-loop.c (vect_analyze_scalar_cycles_1): Disregard sign-changing conversions for induction detection.
2010-12-02  Richard Guenther  <rguenther@suse.de>

	* tree-vect-loop.c (vect_analyze_scalar_cycles_1): Disregard
	sign-changing conversions for induction detection.

From-SVN: r167378
2010-12-02 16:26:22 +00:00
Richard Guenther 6dbbece65a re PR tree-optimization/46723 (internal compiler error: in get_initial_def_for_induction, at tree-vect-loop.c:2431)
2010-12-02  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/46723
	* tree-vect-loop.c (get_initial_def_for_induction): Strip
	conversions from the induction evolution and apply it to
	the result instead.
	* tree-vect-stmts.c (vect_get_vec_def_for_operand): Handle
	assigns for induction defs.

	* gcc.dg/torture/pr46723.c: New testcase.

From-SVN: r167377
2010-12-02 16:23:20 +00:00
Joseph Myers c59ffc4195 hwint.c: New.
* hwint.c:  New.  Extracted from toplev.c.
	* hwint.h (clz_hwi, ctz_hwi, ffs_hwi, exact_log2, floor_log2):
	Move from toplev.h.
	* toplev.c (clz_hwi, ctz_hwi, ffs_hwi, exact_log2, floor_log2):
	Move to hwint.c.
	* toplev.h (clz_hwi, ctz_hwi, ffs_hwi, exact_log2, floor_log2):
	Move to hwint.h.
	* builtins.c, combine.c, config/i386/winnt.c, double-int.c,
	explow.c, expmed.c, fold-const.c, ggc-page.c, ggc-zone.c, ifcvt.c,
	ipa-struct-reorg.c, ira-color.c, matrix-reorg.c, omp-low.c,
	real.c, recog.c, reload.c, rtlanal.c, simplify-rtx.c,
	stor-layout.c, tree-dfa.c, tree-ssa-alias.c,
	tree-ssa-loop-niter.c, tree-vect-data-refs.c,
	tree-vect-loop-manip.c, tree-vect-loop.c, tree-vect-stmts.c,
	tree-vrp.c: Don't include toplev.h.
	* genattrtab.c, genconditions.c, genemit.c, genextract.c,
	genoutput.c, genpeep.c, genpreds.c, genrecog.c: Don't include
	toplev.h in generated output.
	* Makefile.in (OBJS-common): Add hwint.o.
	Dependencies for above files changed to remove toplev.h.
	(hwint.o): New.
	(insn-attrtab.o, insn-emit.o, insn-extract.o, insn-output.o,
	insn-peep.o, insn-preds.o, insn-recog.o): Don't depend on
	toplev.h.
	* config/i386/t-cygming (winnt.o): Don't depend on toplev.h.
	* config/i386/t-interix (winnt.o): Don't depend on toplev.h.

fortran:
	* trans-common.c: Don't include toplev.h.

java:
	* boehm.c: Don't include toplev.h.
	* Make-lang.in (java/boehm.o): Don't depend on toplev.h.

lto:
	* lto-object.c: Don't include toplev.h.
	* Make-lang.in (lto/lto-object.o): Don't depend on toplev.h.

From-SVN: r167301
2010-11-30 16:36:19 +00:00
Ira Rosen 0532869d05 re PR tree-optimization/46213 (gfortran.dg/aliasing_array_result_1.f90 ICE: in vectorizable_reduction, at tree-vect-loop.c:4046 with custom compiler flags)
PR tree-optimization/46213
        * tree-vect-loop.c (vect_is_simple_reduction_1): Handle 
        MINUS_EXPR only if the first operand is reduction operand.

From-SVN: r166306
2010-11-04 11:51:09 +00:00
Richard Guenther 43427f3c58 re PR tree-optimization/46184 (ICE: SIGSEGV in vectorizable_reduction (tree-vect-loop.c:4067) with -O -ftree-vectorize -fno-tree-copy-prop -fno-tree-dce)
2010-11-02  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/46184
	* tree-vect-loop.c (vectorizable_reduction): Try to obtain the
	input vector type from the reduction operand as well.

	* gcc.dg/pr46184.c: New testcase.

From-SVN: r166194
2010-11-02 15:46:46 +00:00
Nathan Froyd b9acc9f1de fold-const.c (build_zero_vector): Use build_vector_from_val.
* fold-const.c (build_zero_vector): Use build_vector_from_val.
	* tree-vect-loop.c (get_initial_def_for_induction): Likewise.
	(get_initial_def_for_reduction): Likewise.
	* tree-vect-slp.c (vect_get_constant_vectors): Likewise.
	* tree-vect-stmts.c (vect_get_vec_def_for_operand): Likewise.
	* tree.c (build_one_cst): Likewise.
	(build_vector_from_val): Use types_compatible_p for assert.

From-SVN: r166102
2010-10-31 02:20:22 +00:00
Ira Rosen 9dc3f7de0d re PR tree-optimization/46049 (ICE: in expand_widen_pattern_expr, at optabs.c:522 with -ftree-vectorize)
PR tree-optimization/46049
	PR tree-optimization/46052
	* tree-vectorizer.h (enum stmt_vec_info_type): Add new value for
	shift.
	(vect_get_slp_defs): Add arguments.
	* tree-vect-loop.c (vect_create_epilog_for_reduction): Pass scalar
	operands to vect_get_slp_defs.
	(vectorizable_reduction): Fix comment, pass scalar operands to
	vect_get_slp_defs.
	* tree-vect-stmts.c (vect_get_vec_def_for_operand): Use operand's
	type to determine number of units in the created vector.
	(vect_get_vec_defs): Pass scalar operands to vect_get_slp_defs.
	(vectorizable_conversion): Fix comment.
	(vectorizable_shift): New function.
	(vectorizable_operation): Move code that handles shifts to
	vectorizable_shift.
	(vectorizable_type_demotion): Fix comment, pass scalar operands to
	vect_get_slp_defs.
	(vectorizable_type_promotion, vectorizable_store): Likewise.
	(vectorizable_condition): Fix comment.
	(vect_analyze_stmt): Call vectorizable_shift.
	(vect_transform_stmt): Likewise.
	* tree-vect-slp.c (vect_get_constant_vectors): Add new argument.
	Use it as the operand to create vectors for, except reduction
	initial definition and store.  Use operands type.
	(vect_get_slp_defs): Add new arguments.  Pass them to
	vect_get_constant_vectors.

From-SVN: r165777
2010-10-21 13:36:56 +00:00
Richard Guenther bb67d9c7ce machmode.h (mode_for_vector): Declare.
2010-10-07  Richard Guenther  <rguenther@suse.de>

	* machmode.h (mode_for_vector): Declare.
	* stor-layout.c (mode_for_vector): New function, split out from ...
	(layout_type): ... here.
	* tree-vectorizer.h (current_vector_size): Declare.
	* tree-vect-stmts.c (perm_mask_for_reverse): Check if the
	mask vector type is available.
	(get_vectype_for_scalar_type): Rename to ...
	(get_vectype_for_scalar_type_and_size): ... this.  Get a vector
	size argument.
	(get_vectype_for_scalar_type): New wrapper around
	get_vectype_for_scalar_type_and_size using current_vector_size.
	(get_same_sized_vectype): Use get_vectype_for_scalar_type_and_size.
	* tree-vect-loop.c (vect_analyze_loop_2): Split out core part
	of vect_analyze_loop here.
	(vect_analyze_loop): Loop over vector sizes calling vect_analyze_loop_3.
	* tree-vect-slp.c (vect_slp_analyze_bb): Set current_vector_size
	to autodetect.
	* config/i386/i386.c (ix86_vectorize_builtin_conversion): Fix
	V8SF to V8SI conversion builtin.

From-SVN: r165116
2010-10-07 14:36:38 +00:00
Ira Rosen ff802fa1f3 tree-vectorizer.c: Fix documentation.
* tree-vectorizer.c: Fix documentation.
	* tree-vectorizer.h (vinfo_for_stmt): Add documentation.
	(set_vinfo_for_stmt, get_earlier_stmt, get_later_stmt,
	is_pattern_stmt_p, is_loop_header_bb_p,
	stmt_vinfo_set_inside_of_loop_cost,
	stmt_vinfo_set_outside_of_loop_cost, vect_pow2, aligned_access_p,
	known_alignment_for_access_p): Likewise.
	* tree-vect-loop.c: Fix documentation.
	(vect_get_cost): Start function name from new line.
	* tree-vect-data-refs.c: Fix documentation.
	* tree-vect_stmts.c: Likewise.
	(vect_create_vectorized_promotion_stmts): Always free vec_tmp.
	(vectorizable_store): Free vec_oprnds if allocated.
	(vectorizable_condition): Initialize several variables to avoid
	warnings.
	* tree-vect-slp.c: Fix documentation.

From-SVN: r164332
2010-09-16 10:35:14 +00:00
H.J. Lu 26983c2253 Turn UNITS_PER_SIMD_WORD into a target hook.
2010-09-14  H.J. Lu  <hongjiu.lu@intel.com>

	* defaults.h (UNITS_PER_SIMD_WORD): Removed.
	* config/arm/arm.h (UNITS_PER_SIMD_WORD): Likewise.
	* config/i386/i386.h (UNITS_PER_SIMD_WORD): Likewise.
	* config/mips/mips.h (UNITS_PER_SIMD_WORD): Likewise.
	* config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Likewise.
	* config/sparc/sparc.h (UNITS_PER_SIMD_WORD): Likewise.

	* target.def: Add units_per_simd_word to vectorize.

	* targhooks.c (default_units_per_simd_word): New.
	* targhooks.h (default_units_per_simd_word): Likewise.
	* config/arm/arm.c (arm_units_per_simd_word): Likewise.
	(TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise.
	* config/mips/mips.c (mips_units_per_simd_word): Likewise.
	(TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise.
	* config/rs6000/rs6000.c (rs6000_units_per_simd_word): Likewise.
	(TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise.
	* config/sparc/sparc.c (sparc_units_per_simd_word): Likewise.
	(TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise.

	* tree-vect-loop.c: Replace UNITS_PER_SIMD_WORD with
	TARGET_VECTORIZE_UNITS_PER_SIMD_WORD in comments.

	* tree-vect-stmts.c (get_vectype_for_scalar_type): Replace
	UNITS_PER_SIMD_WORD with targetm.vectorize.units_per_simd_word.

	* system.h (UNITS_PER_SIMD_WORD): Poisoned.

	* config/i386/i386-protos.h (ix86_units_per_simd_word): Removed.

	* config/i386/i386.c (ix86_units_per_simd_word): Make it
	static.
	(TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): New.

	* doc/tm.texi.in: Remove UNITS_PER_SIMD_WORD.  Add
	TARGET_VECTORIZE_UNITS_PER_SIMD_WORD.

	* doc/tm.texi: Regenerated.

From-SVN: r164285
2010-09-14 10:02:10 -07:00
Ira Rosen e4a707c492 tree-vectorizer.h (get_later_stmt): New function.
* tree-vectorizer.h (get_later_stmt): New function.
	(vect_analyze_data_ref_dependences): Add argument.
	* tree-vect-loop.c (vect_analyze_loop): Update call to
	vect_analyze_data_ref_dependences.
	* tree-vect-data-refs.c (vect_drs_dependent_in_basic_block):
	New function.
	(vect_analyze_data_ref_dependence): Add argument for basic block
	dependencies. Check dependencies in basic block vectorization.
	(vect_analyze_data_ref_dependences): Add argument and update call to
	vect_analyze_data_ref_dependences.
	* tree-vect-slp.c (vect_find_last_store_in_slp_instance): New.
	(vect_bb_vectorizable_with_dependencies): New.
	(vect_slp_analyze_bb): Check dependencies in basic block.
	(vect_schedule_slp_instance): Insert stores before the last store in
	SLP instance.

From-SVN: r163757
2010-09-02 06:04:34 +00:00
Kai Tietz 0b3f008892 tree-vect-loop.c (vect_get_single_scalar_iteraion_cost): Pre-initialize innerloop_iters to one.
2010-08-23  Kai Tietz  <kai.tietz@onevision.com>

        * tree-vect-loop.c (vect_get_single_scalar_iteraion_cost):
        Pre-initialize innerloop_iters to one.

From-SVN: r163477
2010-08-23 20:08:47 +02:00
Nathan Froyd ac47786e99 vec.h (FOR_EACH_VEC_ELT): Define.
gcc/
	* vec.h (FOR_EACH_VEC_ELT): Define.
	* c-decl.c: Use it.
	* cfgloop.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* dbxout.c: Likewise.
	* df-scan.c: Likewise.
	* dominance.c: Likewise.
	* dse.c: Likewise.
	* dwarf2out.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* function.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* ggc-common.c: Likewise.
	* gimplify.c: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* haifa-sched.c: Likewise.
	* ifcvt.c: Likewise.
	* implicit-zee.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-emit.c: Likewise.
	* lambda-code.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* lto-symtab.c: Likewise.
	* matrix-reorg.c: Likewise.
	* opts.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched.c: Likewise.
	* sese.c: Likewise.
	* stor-layout.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-emutls.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-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-scalar-evolution.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-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* vmsdbgout.c: Likewise.

gcc/ada/
	* gcc-interface/decl.c: Use FOR_EACH_VEC_ELT.
	* gcc-interface/trans.c: Likewise.
	* gcc-interface/utils.c: Likewise.

gcc/c-family/
	* c-common.c: Use FOR_EACH_VEC_ELT.
	* c-gimplify.c: Likewise.
	* c-pragma.c: Likewise.

gcc/cp/
	* call.c: Use FOR_EACH_VEC_ELT.
	* class.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* error.c: Likewise.
	* except.c: Likewise.
	* mangle.c: Likewise.
	* method.c: Likewise.
	* name-lookup.c: Likewise.
	* parser.c: Likewise.
	* pt.c: Likewise.
	* repo.c: Likewise.
	* semantics.c: Likewise.
	* typeck2.c: Likewise.

gcc/fortran/
	* trans-openmp.c: Use FOR_EACH_VEC_ELT.

gcc/java/
	* class.c: Use FOR_EACH_VEC_ELT.
	* expr.c: Likewise.
	* jcf-parse.c: Likewise.
	* resource.c: Likewise.

gcc/lto/
	* lto.c: Use FOR_EACH_VEC_ELT.

From-SVN: r163401
2010-08-20 12:48:59 +00:00
Ira Rosen 61869cc95e tree-vect-loop.c (vect_create_epilog_for_reduction): Switch to outer loop when creating reduction epilogue for double reduction...
* tree-vect-loop.c (vect_create_epilog_for_reduction): Switch
	to outer loop when creating reduction epilogue for double reduction,
	and switch back to the inner loop when updating the phi nodes.
	Update uses of outer loop exit phi nodes in double reduction (instead
	of uses of reduction).

From-SVN: r162668
2010-07-29 06:02:34 +00:00
Anatoly Sokolov 9a9d280e02 tree.h (enum tree_index): Add TI_INTEGER_THREE.
* tree.h (enum tree_index): Add TI_INTEGER_THREE.
	(integer_three_node): Add.
	* tree.c (build_common_tree_nodes_2): Use integer_type_node insead of
	NULL_TREE in build_int_cst calls. Initialize the integer_three_node.
	* builtins.c (expand_builtin_prefetch): Use common tree nodes instead
	of call build_int_cst.
	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Ditto.
	* tree-ssa-loop-ivopts.c (idx_find_step): Ditto.
	(find_interesting_uses_address): Ditto.
	* tree-ssa-alias.c (ao_ref_init_from_ptr_and_size): Ditto.
	* tree-eh.c (lower_eh_constructs_2): Ditto.
	* tree-vect-loop.c (get_initial_def_for_induction): Ditto.
	* c-typeck.c (really_start_incremental_init, push_init_level): Ditto.
	* expmed.c (expand_divmod): Ditto.
	* tree-mudflap.c (mx_register_decls): Ditto.
	* varasm.c (array_size_for_constructor): Ditto.
	* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Ditto.
	* c-parser.c (c_parser_postfix_expression): Ditto.
	
/cp
	* decl.c (integer_three_node): Remove.
	(cxx_init_decl_processing): Do not initialize the integer_three_node.
	* cp-tree.h (integer_three_node): Remove.

From-SVN: r162230
2010-07-15 22:47:23 +04:00
Manuel López-Ibáñez 718f9c0f87 toplev.h: Do not include diagnostic-core.h.
2010-07-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* toplev.h: Do not include diagnostic-core.h.
	Include diagnostic-core.h in every file that includes toplev.h.
	* c-tree.h: Do not include toplev.h.
	* pretty-print.h: Update comment.
	* Makefile.in: Update dependencies.
	* alias.c: Include diagnostic-core.h in every file that includes
	toplev.h.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* bb-reorder.c: Likewise.
	* bt-load.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfghooks.c: Likewise.
	* cfgloop.c: Likewise.
	* combine.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/arc/arc.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/arm/pe.c: Likewise.
	* config/avr/avr.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/cris/cris.c: Likewise.
	* config/crx/crx.c: Likewise.
	* config/darwin-c.c: Likewise.
	* config/darwin.c: Likewise.
	* config/fr30/fr30.c: Likewise.
	* config/frv/frv.c: Likewise.
	* config/h8300/h8300.c: Likewise.
	* config/host-darwin.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/i386/netware.c: Likewise.
	* config/i386/nwld.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/m68hc11/m68hc11.c: Likewise.
	* config/m68k/m68k.c: Likewise.
	* config/mcore/mcore.c: Likewise.
	* config/mep/mep-pragma.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/mmix/mmix.c: Likewise.
	* config/mn10300/mn10300.c: Likewise.
	* config/moxie/moxie.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/pdp11/pdp11.c: Likewise.
	* config/picochip/picochip.c: Likewise.
	* config/rs6000/rs6000-c.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/rx/rx.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/score/score.c: Likewise.
	* config/score/score3.c: Likewise.
	* config/score/score7.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/symbian-base.c: Likewise.
	* config/sh/symbian-c.c: Likewise.
	* config/sh/symbian-cxx.c: Likewise.
	* config/sol2-c.c: Likewise.
	* config/sol2.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/spu/spu.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/v850/v850-c.c: Likewise.
	* config/v850/v850.c: Likewise.
	* config/vax/vax.c: Likewise.
	* config/vxworks.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.
	* convert.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* dbgcnt.c: Likewise.
	* dbxout.c: Likewise.
	* ddg.c: Likewise.
	* dominance.c: Likewise.
	* emit-rtl.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* fwprop.c: Likewise.
	* gcse.c: Likewise.
	* ggc-common.c: Likewise.
	* ggc-page.c: Likewise.
	* ggc-zone.c: Likewise.
	* gimple-low.c: Likewise.
	* gimplify.c: Likewise.
	* graph.c: Likewise.
	* haifa-sched.c: Likewise.
	* ifcvt.c: Likewise.
	* implicit-zee.c: Likewise.
	* integrate.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* lists.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-iv.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-symtab.c: Likewise.
	* main.c: Likewise.
	* modulo-sched.c: Likewise.
	* optabs.c: Likewise.
	* params.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* profile.c: Likewise.
	* real.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regmove.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl.c: Likewise.
	* rtlanal.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* simplify-rtx.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* targhooks.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-nomudflap.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vrp.c: Likewise.
	* varasm.c: Likewise.
	* vec.c: Likewise.
	* web.c: Likewise.
	* xcoffout.c: Likewise.

c-family/
	* c-common.h: Include diagnostic-core.h. Error if already
	included.
	* c-semantics.c: Do not define GCC_DIAG_STYLE here.
cp/
	* cp-tree.h: Do not include toplev.h.
	
java/
	* boehm.c: Include diagnostic-core.h in every file that includes
	toplev.h.
	* class.c: Likewise.
	* constants.c: Likewise.
	* decl.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* jcf-parse.c: Likewise.
	* mangle.c: Likewise.
	* mangle_name.c: Likewise.
	* resource.c: Likewise.
	* typeck.c: Likewise.
	* verify-glue.c: Likewise.
ada/
	* gcc-interface/utils.c: Include diagnostic-core.h in every file
	that includes toplev.h.
lto/
	* lto-coff.c: Include diagnostic-core.h in every file that
	includes toplev.h.
	* lto-elf.c: Likewise.
	* lto-lang.c: Likewise.
	* lto-macho.c: Likewise.

From-SVN: r161943
2010-07-08 04:22:54 +00:00
Ira Rosen 9940b13ce7 tree-vect-loop.c (vect_get_single_scalar_iteraion_cost): Skip statements that are not vectorized.
* tree-vect-loop.c (vect_get_single_scalar_iteraion_cost): Skip
	statements that are not vectorized.
	* tree-vect-stmts.c (vect_get_load_cost): Update the value stored
	in INSIDE_COST.

From-SVN: r161827
2010-07-05 10:41:25 +00:00
Richard Sandiford 947131ba4e optabs.h (optab_handler, [...]): Turn into inline functions that return an insn code.
gcc/
	* optabs.h (optab_handler, convert_optab_handler): Turn into
	inline functions that return an insn code.
	(set_optab_handler, set_convert_optab_handler): New functions.
	* builtins.c: Replace optab_handler(X)->insn_code with
	optab_handler or set_optab_handler thoughout.  Likewise
	convert_optab_handler(X)->insn_code with convert_optab_handler
	and set_convert_optab_handler.
	* expmed.c, expr.c, genopinit.c, ifcvt.c, optabs.c, reload.c,
	reload1.c, stmt.c, targhooks.c, tree-ssa-loop-prefetch.c,
	tree-ssa-math-opts.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, config/m32c/m32c.c, config/rs6000/rs6000.c,
	config/spu/spu.c: Likewise.

From-SVN: r161808
2010-07-04 22:13:09 +00:00
Ira Rosen 720f52395d 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 08:54:52 +00:00
Ira Rosen c1e822d590 re PR tree-optimization/44507 (vectorization ANDs array elements together incorrectly)
PR tree-optimization/44507 
	* tree-vect-loop.c (get_initial_def_for_reduction): Use -1
	to build initial vector for BIT_AND_EXPR.
	* tree-vect-slp.c (vect_get_constant_vectors): Likewise.

From-SVN: r160727
2010-06-14 12:22:13 +00:00
Ira Rosen 35e1a5e7cf tm.texi (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Update documentation.
* 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.

From-SVN: r160360
2010-06-07 09:12:32 +00:00
Steven Bosscher 2eb79bbbb3 gimplify.c: Do not include except.h and optabs.h.
* gimplify.c: Do not include except.h and optabs.h.
	(gimplify_body): Do not initialize RTL profiling.
	* gimple-low.c: Do not include rtl.h, diagnostic.h, langhooks.h,
	langhooks-def.h, timevar.h, except.h, hashtab.h, and expr.h.
	* gimple-fold.c: Do not include rtl.h, tm_p.h, ggc.h, basic-block.h,
	output.h, expr.h, diagnostic.h, timevar.h, value-prof.h, and
	langhooks.h.

	* tree-pretty-print.h: Include pretty-print.h.
	* gimple-pretty-print.h: Include pretty-print.h.

	* tree-pretty-print.c: Do not include diagnostic.h.
	* tree-vrp.c: Likewise.
	* tree-tailcall.c: Likewise
	* tree-scalar-evolution.c: Likewise
	* tree-ssa-dse.c: Likewise
	* tree-chrec.c: Likewise
	* tree-ssa-sccvn.c: Likewise
	* tree-ssa-copyrename.c: Likewise
	* tree-nomudflap.c: Likewise
	* tree-call-cdce.c: Likewise
	* tree-stdarg.c: Likewise
	* tree-ssa-math-opts.c: Likewise
	* tree-nrv.c: Likewise
	* tree-ssa-sink.c: Likewise
	* tree-browser.c: Likewise
	* tree-ssa-loop-ivcanon.c: Likewise
	* tree-ssa-loop.c: Likewise
	* tree-parloops.c: Likewise
	* tree-ssa-address.c: Likewise
	* tree-ssa-ifcombine.c: Likewise
	* tree-if-conv.c: Likewise
	* tree-data-ref.c: Likewise
	* tree-affine.c: Likewise
	* tree-ssa-phiopt.c: Likewise
	* tree-ssa-coalesce.c: Likewise
	* tree-ssa-pre.c: Likewise
	* tree-ssa-live.c: Likewise
	* tree-predcom.c: Likewise
	* tree-ssa-forwprop.c: Likewise
	* tree-ssa-dce.c: Likewise
	* tree-ssa-ter.c: Likewise
	* tree-ssa-loop-prefetch.c: Likewise
	* tree-optimize.c: Likewise
	* tree-ssa-phiprop.c: Likewise
	* tree-object-size.c: Likewise
	* tree-outof-ssa.c: Likewise
	* tree-ssa-structalias.c: Likewise
	* tree-switch-conversion.c: Likewise
	* tree-ssa-reassoc.c: Likewise
	* tree-ssa-operands.c: Likewise
	* tree-vectorizer.c: Likewise
	* tree-vect-data-refs.c: Likewise
	* tree-vect-generic.c: Likewise
	* tree-vect-stmts.c: Likewise
	* tree-vect-patterns.c: Likewise
	* tree-vect-slp.c: Likewise
	* tree-vect-loop.c: Likewise
	* tree-ssa-loop-ivopts.c: Likewise
	* tree-ssa-loop-im.c: Likewise
	* tree-ssa-loop-niter.c: Likewise
	* tree-ssa-loop-unswitch.c: Likewise
	* tree-ssa-loop-manip.c: Likewise
	* tree-ssa-loop-ch.c: Likewise
	* tree-dump.c: Likewise
	* tree-complex.c: Likewise

	* tree-into-ssa.c: Do not include diagnostic.h and expr.h.
	* tree-ssa-uninit.c: Likewise
	* tree-ssa-threadupdate.c: Likewise
	* tree-ssa-uncprop.c: Likewise
	* tree-ssa-ccp.c: Likewise
	* tree-ssa-dom.c: Likewise
	* tree-ssa-propagate.c: Likewise
	* tree-ssa-alias.c: Likewise
	* tree-dfa.c: Likewise
	* tree-cfgcleanup.c: Likewise
	* tree-sra.c: Likewise
	* tree-ssa-copy.c: Likewise
	* tree-ssa.c: Likewise
	* tree-profile.c: Likewise
	* tree-cfg.c: Likewise
	* tree-ssa-threadedge.c: Likewise
	* tree-vect-loop-manip.c: Likewise

	* tree-inline.c: Do not include diagnostic.h and expr.h.
	Include rtl.h.
	(copy_decl_for_dup_finish): Do not use NULL_RTX.

	* tree-loop-linear.c: Do not include diagnostic.h, expr.h,
	and optabs.h.
	* tree-loop-distribution.c: Likewise.

From-SVN: r160125
2010-06-01 22:00:56 +00:00
Joseph Myers cf8358387d diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h.
* diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or
	langhooks-def.h.
	(diagnostic_initialize): Initialize x_data not last_function.
	(diagnostic_report_current_function): Move to tree-diagnostic.c.
	(default_diagnostic_starter): Call
	diagnostic_report_current_module not
	diagnostic_report_current_function.
	(diagnostic_report_diagnostic): Initialize x_data not
	abstract_origin.
	(verbatim): Likewise.
	* diagnostic.h (struct diagnostic_info): Change abstract_origin to
	x_data.
	(struct diagnostic_context): Change last_function to x_data.
	(diagnostic_auxiliary_data): Replace with
	diagnostic_context_auxiliary_data and
	diagnostic_info_auxiliary_data.
	(diagnostic_last_function_changed, diagnostic_set_last_function,
	diagnostic_report_current_function): Move to tree-diagnostic.h.
	(print_declaration, dump_generic_node, print_generic_stmt,
	print_generic_stmt_indented, print_generic_expr,
	print_generic_decl, debug_c_tree, dump_omp_clauses,
	print_call_name, debug_generic_expr, debug_generic_stmt,
	debug_tree_chain, default_tree_printer): Move to
	tree-pretty-print.h.
	(debug_gimple_stmt, debug_gimple_seq, print_gimple_seq,
	print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to
	gimple-pretty-print.h.
	* pretty-print.c: Don't include tree.h
	(pp_base_format): Don't handle %K here.
	(pp_base_tree_identifier): Move to tree-pretty-print.c.
	* pretty-print.h (text_info): Change abstract_origin to x_data.
	(pp_tree_identifier, pp_unsupported_tree,
	pp_base_tree_identifier): Move to tree-pretty-print.h.
	* gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h,
	tree-pretty-print.h: New files.
	* tree-pretty-print.c: Include tree-pretty-print.h.
	(percent_K_format): New.  Moved from pretty-print.c.
	(pp_base_tree_identifier): Move from pretty-print.c.
	* c-objc-common.c: Include tree-pretty-print.h.
	(c_tree_printer): Handle %K here.
	* langhooks.c: Include tree-diagnostic.h.
	(lhd_print_error_function): Use diagnostic_abstract_origin macro.
	* toplev.c: Include tree-diagnostic.h and tree-pretty-print.h.
	(default_tree_printer): Handle %K using percent_K_format.
	(general_init): Use default_tree_diagnostic_starter.
	* tree.c: Include tree-diagnostic.h and tree-pretty-print.h.
	(free_lang_data): Use default_tree_diagnostic_starter.
	* c-pretty-print.c: Include tree-pretty-print.h.
	* cfgexpand.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* cgraphunit.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* dwarf2out.c: Include tree-pretty-print.h.
	* except.c: Include tree-pretty-print.h.
	* gimple-pretty-print.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* gimplify.c: Include tree-pretty-print.h.
	* graphite-poly.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* ipa-cp.c: Include tree-pretty-print.h.
	* ipa-inline.c: Include gimple-pretty-print.h.
	* ipa-prop.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* ipa-pure-const.c: Include gimple-pretty-print.h.
	* ipa-struct-reorg.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* ipa-type-escape.c: Include tree-pretty-print.h.
	* print-rtl.c: Include tree-pretty-print.h.
	* print-tree.c: Include gimple-pretty-print.h.
	* sese.c: Include tree-pretty-print.h.
	* tree-affine.c: Include tree-pretty-print.h.
	* tree-browser.c: Include tree-pretty-print.h.
	* tree-call-cdce.c: Include gimple-pretty-print.h.
	* tree-cfg.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-chrec.c: Include tree-pretty-print.h.
	* tree-data-ref.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-dfa.c: Include tree-pretty-print.h.
	* tree-if-conv.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-inline.c: Include tree-pretty-print.h.
	* tree-into-ssa.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-nrv.c: Include tree-pretty-print.h.
	* tree-object-size.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-outof-ssa.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-parloops.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-predcom.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-scalar-evolution.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-sra.c: Include tree-pretty-print.h.
	* tree-ssa-address.c: Include tree-pretty-print.h.
	* tree-ssa-alias.c: Include tree-pretty-print.h.
	* tree-ssa-ccp.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-coalesce.c: Include tree-pretty-print.h.
	* tree-ssa-copy.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-copyrename.c: Include tree-pretty-print.h.
	* tree-ssa-dce.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-dom.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-dse.c: Include gimple-pretty-print.h.
	* tree-ssa-forwprop.c: Include tree-pretty-print.h.
	* tree-ssa-ifcombine.c: Include tree-pretty-print.h.
	* tree-ssa-live.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-im.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-niter.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-prefetch.c: Include tree-pretty-print.h.
	* tree-ssa-math-opts.c: Include gimple-pretty-print.h.
	* tree-ssa-operands.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-phiprop.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-pre.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-propagate.c: Include gimple-pretty-print.h.
	* tree-ssa-reassoc.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-sccvn.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-sink.c: Include gimple-pretty-print.h.
	* tree-ssa-ter.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-uninit.c: Include gimple-pretty-print.h.
	* tree-ssa.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-stdarg.c: Include gimple-pretty-print.h.
	* tree-switch-conversion.c: Include gimple-pretty-print.h.
	* tree-tailcall.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-data-refs.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-loop-manip.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-loop.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-patterns.c: Include gimple-pretty-print.h.
	* tree-vect-slp.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-stmts.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vectorizer.c: Include tree-pretty-print.h.
	* tree-vrp.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* value-prof.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* var-tracking.c: Include tree-pretty-print.h.
	* Makefile.in (OBJS-common): Add tree-diagnostic.o.
	(tree-diagnostic.o): New dependencies.
	(c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o,
	tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o,
	tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o,
	tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o,
	tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o,
	tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o,
	tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o,
	tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o,
	tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o,
	tree-ssa-address.o, tree-ssa-loop-niter.o,
	tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o,
	tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o,
	tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o,
	gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o,
	tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o,
	tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o,
	tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o,
	tree-parloops.o, tree-stdarg.o, tree-object-size.o,
	gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o,
	toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o,
	ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o,
	ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o,
	tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o,
	tree-switch-conversion.o, var-tracking.o, value-prof.o,
	cfgexpand.o, pretty-print.o): Update dependencies.

cp:
	* error.c: Include tree-diagnostic.h and tree-pretty-print.h.
	(cp_print_error_function): Use diagnostic_abstract_origin macro.
	(cp_printer): Handle %K here using percent_K_format.
	* cxx-pretty-print.c: Include tree-pretty-print.h.
	* Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
	dependencies.

From-SVN: r159685
2010-05-21 23:34:26 +01:00
Michael Matz 8a9ecffd3f tree-ssa-reassoc.c (undistribute_ops_list): Use create_tmp_reg.
* 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.

From-SVN: r159226
2010-05-10 14:31:37 +00:00
Ira Rosen 74500b3e10 re PR tree-optimization/43842 (ice in vect_create_epilog_for_reduction)
PR tree-optimization/43842
	* tree-vect-loop.c (vect_create_epilog_for_reduction): Handle 
	loop unrolling in update of exit phis. Fix comment.
	* tree-vect-slp.c (vect_analyze_slp): Check that there are at
	least two reduction statements in the loop before starting SLP 
	analysis.

From-SVN: r158650
2010-04-22 18:03:01 +00:00
Ira Rosen b5aeb3bb3e 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 09:10:45 +00:00
Richard Guenther 777e1f09ff tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Only add RW dependence for dependence distance zero.
2010-04-13  Richard Guenther  <rguenther@suse.de>

	* 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.

From-SVN: r158259
2010-04-13 09:48:26 +00:00
Richard Guenther b690cc0f33 tree-vectorizer.h (struct _stmt_vec_info): Document that vectype is the type of the LHS.
2010-04-09  Richard Guenther  <rguenther@suse.de>

	* 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.

From-SVN: r158157
2010-04-09 10:40:14 +00:00
Steven Bosscher c75c517d53 Make-lang.in, [...]: Update copyright years.
* ada/gcc-interface/Make-lang.in, alias.c, attribs.c, auto-inc-dec.c, 
	basic-block.h, bb-reorder.c, calls.c, c-common.c, cgraph.h,
	collect2.h, config/alpha/alpha.c, config/alpha/alpha.md,
	config/alpha/predicates.md, config/arm/arm.md,
	config/arm/lib1funcs.asm, config/arm/neon-schedgen.ml,
	config/avr/avr.c, config/avr/avr.md, config/bfin/bfin.c,
	config/darwin9.h, config/darwin.c, config/darwin.h,
	config/h8300/h8300.c, config/i386/cpuid.h, config/i386/cygming.h,
	config/i386/cygwin.h, config/i386/mingw32.h, config/i386/msformat-c.c,
	config/i386/sol2-10.h, config/i386/xopintrin.h, config/ia64/ia64.c,
	config/ia64/ia64.md, config/ia64/sync.md, config/mep/mep.c,
	config/mips/mips.md, config/mn10300/mn10300.c,
	config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.md,
	config/rs6000/aix.h, config/rs6000/dfp.md,
	config/rs6000/rs6000-builtin.def, config/rs6000/rs6000-c.c,
	config/rs6000/vector.md, config/rtems.h, config/rx/rx.md,
	config/s390/s390.md, config/sol2-c.c, config/sparc/sol2-bi.h,
	config/sparc/sol2-gas.h, config/sparc/sparc.h, config/sparc/sparc.md,
	config/sparc/sparc-protos.h, config/spu/spu.c, config/spu/spu-c.c,
	config/t-darwin, convert.c, c.opt, c-opts.c, cp/Make-lang.in,
	c-pretty-print.c, c-typeck.c, df-core.c, df-scan.c, diagnostic.c,
	diagnostic.h, doc/cppopts.texi, doc/cpp.texi, doc/extend.texi,
	doc/gimple.texi, doc/languages.texi, doc/plugins.texi, doc/rtl.texi,
	doc/standards.texi, doc/tree-ssa.texi, doc/trouble.texi, dominance.c,
	fold-const.c, fortran/Make-lang.in, fwprop.c, gcc-plugin.h,
	gensupport.c, gimple.h, gimple-iterator.c, graphite.c,
	graphite-clast-to-gimple.c, graphite-clast-to-gimple.h,
	graphite-dependences.c, graphite-poly.c, graphite-poly.h,
	graphite-ppl.c, graphite-ppl.h, graphite-scop-detection.c,
	graphite-sese-to-poly.c, graphite-sese-to-poly.h, ifcvt.c, intl.c,
	intl.h, ipa.c, ipa-cp.c, ipa-inline.c, ipa-prop.c, ipa-prop.h,
	ipa-pure-const.c, ipa-reference.c, ipa-type-escape.c, ira-color.c,
	ira-conflicts.c, ira-lives.c, java/Make-lang.in, lambda-code.c,
	loop-invariant.c, lto/Make-lang.in, lto-streamer.h, lto-streamer-in.c,
	objc/Make-lang.in, objcp/Make-lang.in, omp-low.c, optc-gen.awk,
	opt-functions.awk, opth-gen.awk, params.def, passes.c,
	postreload-gcse.c, print-tree.c, recog.c, regrename.c, reload.h,
	rtl.def, sched-int.h, sched-rgn.c, sel-sched-dump.c, sese.c, sese.h,
	store-motion.c, stor-layout.c, tree-cfgcleanup.c, tree-chrec.c,
	tree-complex.c, tree-data-ref.c, tree.def, tree-eh.c, tree-flow.h,
	tree-flow-inline.h, tree.h, tree-loop-distribution.c, tree-outof-ssa.c,
	tree-parloops.c, tree-pass.h, tree-predcom.c, tree-profile.c,
	tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-alias.c,
	tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c,
	tree-ssa-dse.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c,
	tree-ssa-loop-manip.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
	tree-ssa-pre.c, tree-ssa-sccvn.c, tree-ssa-structalias.c,
	tree-ssa-uncprop.c, tree-tailcall.c, tree-vect-data-refs.c,
	tree-vect-loop.c, tree-vectorizer.h, tree-vect-slp.c, tree-vrp.c,
	unwind-dw2-fde-darwin.c, varpool.c: Update copyright years.

From-SVN: r157950
2010-04-02 19:54:46 +00:00
Sebastian Pop 49a71bc8d6 Improve vectorization cost model diagnostic.
2010-03-29  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/43431
	* tree-vect-loop.c (vect_estimate_min_profitable_iters):
	Improve vectorization cost model diagnostic.

From-SVN: r157801
2010-03-29 16:38:40 +00:00
Alexandre Oliva aba09491c2 re PR debug/42897 (yet another ice in verify_ssa)
PR debug/42897
* tree-vect-loop.c (vect_transform_loop): Kill out-of-loop debug
uses of relevant DEFs that are dead outside the loop too.

From-SVN: r157258
2010-03-06 20:28:04 +00:00
Ira Rosen 99f51320d4 re PR tree-optimization/43074 (ICE in vectorizable_reduction, at tree-vect-loop.c:3491)
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.

From-SVN: r156800
2010-02-16 11:35:03 +00:00