aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
AgeCommit message (Collapse)AuthorFilesLines
2016-08-12re PR tree-optimization/69848 (poor vectorization of a loop from SPEC2006 ↵Bin Cheng1-23/+69
464.h264ref) PR tree-optimization/69848 * tree-vectorizer.h (enum vect_def_type): New condition reduction type CONST_COND_REDUCTION. * tree-vect-loop.c (vectorizable_reduction): Support new condition reudction type CONST_COND_REDUCTION. gcc/testsuite PR tree-optimization/69848 * gcc.dg/vect/vect-pr69848.c: New test. From-SVN: r239416
2016-07-29re PR tree-optimization/57558 (Loop not vectorized if iteration count could ↵Bin Cheng1-32/+111
be infinite) PR tree-optimization/57558 * tree-vect-loop-manip.c (vect_create_cond_for_niters_checks): New function. (vect_loop_versioning): Support versioning with niter assumptions. * tree-vect-loop.c (tree-ssa-loop.h): Include header file. (vect_get_loop_niters): New parameter. Reimplement to support assumptions in loop niter info. (vect_analyze_loop_form_1, vect_analyze_loop_form): Ditto. (new_loop_vec_info): Init LOOP_VINFO_NITERS_ASSUMPTIONS. (vect_estimate_min_profitable_iters): Use LOOP_REQUIRES_VERSIONING. Support loop versioning for niters. * tree-vectorizer.c (tree-ssa-loop-niter.h): Include header file. (vect_free_loop_info_assumptions): New function. (vectorize_loops): Free loop niter info for loops with flag LOOP_F_ASSUMPTIONS set if vectorization failed. * tree-vectorizer.h (struct _loop_vec_info): New field num_iters_assumptions. (LOOP_VINFO_NITERS_ASSUMPTIONS): New macro. (LOOP_REQUIRES_VERSIONING_FOR_NITERS): New macro. (LOOP_REQUIRES_VERSIONING): New macro. (vect_free_loop_info_assumptions): New decl. gcc/testsuite PR tree-optimization/57558 * gcc.dg/vect/pr57558-1.c: New test. * gcc.dg/vect/pr57558-2.c: New test. From-SVN: r238877
2016-07-19tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Update comment.Ilya Enkovich1-1/+9
gcc/ * tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Update comment. (vect_update_inits_of_drs): Likewise. (vect_create_cond_for_alias_checks): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Likewise. From-SVN: r238466
2016-07-13tree-vect-data-refs.c (vect_no_alias_p): New function.Bin Cheng1-9/+1
* tree-vect-data-refs.c (vect_no_alias_p): New function. (vect_prune_runtime_alias_test_list): Call vect_no_alias_p to resolve alias checks which are known at compilation time. Truncate vector LOOP_VINFO_MAY_ALIAS_DDRS(loop_vinfo) if all alias checks are resolved. Move dump info for too many runtime alias checks to here... * tree-vect-loop.c (vect_analyze_loop_2): ...From here. gcc/testsuite * gcc.dg/vect/vect-35-big-array.c: Refine comment and test. * gcc.dg/vect/vect-35.c: Ditto. * gcc.dg/vect/vect-alias-check-2.c: New test. From-SVN: r238301
2016-07-08re PR debug/71667 (ICE in as_a, at is-a.h:192 w/ -g -O2 -ftree-vectorize)Alan Hayward1-3/+4
2016-07-08 Alan Hayward <alan.hayward@arm.com> gcc/ PR tree-optimization/71667 * tree-vect-loop.c (vectorizable_live_operation): ignore DEBUG stmts testsuite/ PR tree-optimization/71667 * gcc.dg/vect/pr71667.c: New From-SVN: r238160
2016-07-06[5/7] Move the fix for PR65518Richard Sandiford1-1/+3
This patch moves the fix for PR65518 to the code that checks whether load-and-permute operations are supported. If the group size is greater than the vectorisation factor, it would still be possible to fall back to elementwise loads (as for strided groups) rather than fail vectorisation entirely. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_grouped_load_supported): Add a single_element_p parameter. * tree-vect-data-refs.c (vect_grouped_load_supported): Likewise. Check the PR65518 case here rather than in vectorizable_load. * tree-vect-loop.c (vect_analyze_loop_2): Update call accordignly. * tree-vect-stmts.c (vectorizable_load): Likewise. From-SVN: r238037
2016-06-29re PR tree-optimization/70729 (Loop marked with omp simd pragma is not ↵Yuri Rumyantsev1-0/+3
vectorized) gcc/ 2016-06-29 Yuri Rumyantsev <ysrumyan@gmail.com> PR tree-optimization/70729 * tree-ssa-loop-im.c (ref_indep_loop_p_1): Consider memory reference as independent in loops having positive safelen value. * tree-vect-loop.c (vect_transform_loop): Clear-up safelen value since it may be not valid after vectorization. gcc/testsuite/ 2016-06-29 Yuri Rumyantsev <ysrumyan@gmail.com> PR tree-optimization/70729 * g++.dg/vect/pr70729.cc: New test. From-SVN: r237844
2016-06-17tree-vect-loop.c (vect_create_epilog_for_reduction): Only insert gimple seq ↵Bin Cheng1-1/+3
if it's not empty. * tree-vect-loop.c (vect_create_epilog_for_reduction): Only insert gimple seq if it's not empty. From-SVN: r237550
2016-06-15re PR tree-optimization/71483 (g++ ICE at -O3 on valid code on ↵Alan Hayward1-11/+7
x86_64-linux-gnu with “Floating point exception”) 2016-06-15 Alan Hayward <alan.hayward@arm.com> gcc/ PR tree-optimization/71483 * tree-vect-loop.c (vectorizable_live_operation): Pick correct index for slp testsuite/ PR tree-optimization/71483 * g++.dg/vect/pr71483.c: New From-SVN: r237483
2016-06-15re PR tree-optimization/71439 (wrong code at -O3 in 32-bit and 64-bit mode ↵Alan Hayward1-1/+5
on x86_64-linux-gnu) 2016-06-15 Alan Hayward <alan.hayward@arm.com> gcc/ PR tree-optimization/71439 * tree-vect-loop.c (vect_analyze_loop_operations): Additional check for live PHIs. testsuite/ PR tree-optimization/71439 * gcc.dg/vect/pr71439.c: New From-SVN: r237476
2016-06-13re PR tree-optimization/71416 (ICE at -O3 in 32-bit and 64-bit modes on ↵Alan Hayward1-4/+7
x86_64-linux-gnu (vectorizable_live_operation)) 2016-06-13 Alan Hayward <alan.hayward@arm.com> gcc/ PR tree-optimization/71416 * tree-vect-loop.c (vectorizable_live_operation): Let worklist have multiple entries From-SVN: r237375
2016-06-10re PR tree-optimization/71407 (ICE at -O3 in 32-bit and 64-bit modes on ↵Alan Hayward1-6/+9
x86_64-linux-gnu (verify_gimple: integral result type precision does not match field size of BIT_FIELD_REF)) 2016-06-10 Alan Hayward <alan.hayward@arm.com> gcc/ PR tree-optimization/71407 PR tree-optimization/71416 * tree-vect-loop.c (vectorizable_live_operation): Use vectype for BIT_FIELD_REF type. testsuite/ PR tree-optimization/71407 PR tree-optimization/71416 * gcc.dg/vect/pr71407.c: New * gcc.dg/vect/pr71416-1.c: New * gcc.dg/vect/pr71416-2.c: New From-SVN: r237288
2016-06-08tree-vect-data-refs.c (vect_analyze_data_refs): Remove debug newline.Alan Hayward1-27/+1
2016-06-08 Alan Hayward <alan.hayward@arm.com> gcc/ * tree-vect-data-refs.c (vect_analyze_data_refs): Remove debug newline. * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): likewise. (vect_can_advance_ivs_p): likewise. (vect_update_ivs_after_vectorizer): likewise. * tree-vect-loop.c (vect_determine_vectorization_factor): likewise. (vect_analyze_scalar_cycles_1): likewise. (vect_analyze_loop_operations): likewise. (report_vect_op): likewise. (vect_is_slp_reduction): likewise. (vect_is_simple_reduction): likewise. (get_initial_def_for_induction): likewise. (vect_transform_loop): likewise. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): likewise. (vect_recog_sad_pattern): likewise. (vect_recog_widen_sum_pattern): likewise. (vect_recog_widening_pattern): likewise. (vect_recog_divmod_pattern): likewise. * tree-vect-slp.c (vect-build-slp_tree_1): likewise. (vect_analyze_slp_instance): likewise. (vect_transform_slp_perm_load): likewise. (vect_schedule_slp_instance): likewise. From-SVN: r237198
2016-06-03[3/3] No need to vectorize simple only-live stmtsAlan Hayward1-4/+5
2016-06-03 Alan Hayward <alan.hayward@arm.com> [3/3] No need to vectorize simple only-live stmts gcc/ * tree-vect-stmts.c (vect_stmt_relevant_p): Do not vectorize non live relevant stmts which are simple and invariant. * tree-vect-loop.c (vectorizable_live_operation): Check relevance instead of simple and invariant testsuite/ * gcc.dg/vect/vect-live-slp-5.c: Remove dg check. From-SVN: r237065
2016-06-03[2/3] Vectorize inductions that are live after the loopAlan Hayward1-66/+91
2016-06-03 Alan Hayward <alan.hayward@arm.com> [2/3] Vectorize inductions that are live after the loop gcc/ * tree-vect-loop.c (vect_analyze_loop_operations): Allow live stmts. (vectorizable_reduction): Check for new relevant state. (vectorizable_live_operation): vectorize live stmts using BIT_FIELD_REF. Remove special case for gimple assigns stmts. * tree-vect-stmts.c (is_simple_and_all_uses_invariant): New function. (vect_stmt_relevant_p): Check for stmts which are only used live. (process_use): Use of a stmt does not inherit it's live value. (vect_mark_stmts_to_be_vectorized): Simplify relevance inheritance. (vect_analyze_stmt): Check for new relevant state. * tree-vectorizer.h (vect_relevant): New entry for a stmt which is used outside the loop, but not inside it. testsuite/ * gcc.dg/tree-ssa/pr64183.c: Ensure test does not vectorize. * testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c: Remove xfail. * gcc.dg/vect/vect-live-1.c: New test. * gcc.dg/vect/vect-live-2.c: New test. * gcc.dg/vect/vect-live-3.c: New test. * gcc.dg/vect/vect-live-4.c: New test. * gcc.dg/vect/vect-live-5.c: New test. * gcc.dg/vect/vect-live-slp-1.c: New test. * gcc.dg/vect/vect-live-slp-2.c: New test. * gcc.dg/vect/vect-live-slp-3.c: New test. From-SVN: r237064
2016-06-01tree-vect-loop.c (vect_determine_vectorization_factor): Also compute the ↵Eric Botcazou1-1/+2
factor for live Phi nodes. * tree-vect-loop.c (vect_determine_vectorization_factor): Also compute the factor for live Phi nodes. From-SVN: r236999
2016-06-01tree-vect-loop.c (vect_determine_vectorization_factor): Also take into ↵Eric Botcazou1-1/+2
account live statements for mask producers. * tree-vect-loop.c (vect_determine_vectorization_factor): Also take into account live statements for mask producers. From-SVN: r236981
2016-05-30* tree-vect-loop.c (vect_transform_loop): Update likely bounds.Jan Hubicka1-3/+11
From-SVN: r236880
2016-05-30tree-vect-loop.c (vect_analyze_loop_2): Use likely_max_stmt_executions_int.Jan Hubicka1-1/+1
* tree-vect-loop.c (vect_analyze_loop_2): Use likely_max_stmt_executions_int. From-SVN: r236870
2016-05-24Clean up PURE_SLP_STMT handlingRichard Sandiford1-1/+1
The vectorizable_* routines had many instances of: slp_node || PURE_SLP_STMT (stmt_info) which gives the misleading impression that we can have !slp_node && PURE_SLP_STMT (stmt_info). In this context it's really enough to test slp_node on its own. There are three cases: loop vectorisation only: vectorizable_foo called only with !slp_node pure SLP: vectorizable_foo called only with slp_node hybrid SLP: (e.g. a vector that's used in SLP statements and also in a reduction) - vectorizable_foo called once with slp_node for the SLP uses. - vectorizable_foo called once with !slp_node for the non-SLP uses. Hybrid SLP isn't possible for stores, so I added an explicit assert for that. I also made vectorizable_comparison static, to make it obvious that no other callers outside tree-vect-stmts.c could use it with the !slp && PURE_SLP_STMT combination. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vectorizable_comparison): Delete. * tree-vect-loop.c (vectorizable_reduction): Remove redundant PURE_SLP_STMT check. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. (vectorizable_store): Likewise. Assert that we don't have hybrid SLP. (vectorizable_comparison): Make static. Remove redundant PURE_SLP_STMT check. (vect_transform_stmt): Assert that we always have an slp_node if PURE_SLP_STMT. From-SVN: r236642
2016-05-19tree-vect-loop.c (vect_analyze_loop_2): Use also max_loop_iterations_int.Jan Hubicka1-0/+2
* tree-vect-loop.c (vect_analyze_loop_2): Use also max_loop_iterations_int. From-SVN: r236478
2016-05-19re PR tree-optimization/69848 (poor vectorization of a loop from SPEC2006 ↵Bin Cheng1-12/+5
464.h264ref) PR tree-optimization/69848 * tree-vect-loop.c (vectorizable_reduction): Don't factor comparison expr out of VEC_COND_EXPR for COND_REDUCTION. From-SVN: r236447
2016-05-12re PR tree-optimization/71006 (ICE: verify_gimple failed (error: type ↵Ilya Enkovich1-1/+3
mismatch in conditional expression) w/ -O1 -ftree-loop-vectorize) gcc/ PR tree-optimization/71006 * tree-vect-loop.c (vect_determine_vectorization_factor): Don't consider COND_EXPR as a mask producer. gcc/testsuite/ PR tree-optimization/71006 * gcc.dg/pr71006.c: New test. From-SVN: r236171
2016-04-29tree-vect-loop.c (vect_transform_loop): Fix nb_iterations_upper_bound ↵Ilya Enkovich1-2/+4
computation for vectorized loop. gcc/ * tree-vect-loop.c (vect_transform_loop): Fix nb_iterations_upper_bound computation for vectorized loop. gcc/testsuite/ * gcc.target/i386/vect-unpack-2.c (avx512bw_test): Avoid optimization of vector loop. * gcc.target/i386/vect-unpack-3.c: New test. * gcc.dg/vect/vect-nb-iter-ub-1.c: New test. * gcc.dg/vect/vect-nb-iter-ub-2.c: New test. * gcc.dg/vect/vect-nb-iter-ub-3.c: New test. From-SVN: r235639
2016-04-12Revert r234572 (aka PR testsuite/70577)Martin Liska1-2/+0
Revert 2016-03-30 Jan Hubicka <hubicka@ucw.cz> * tree-ssa-loop-niter.c (idx_infer_loop_bounds): We can't get realistic estimates here. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Use also max_loop_iterations_int. (tree_unswitch_outer_loop): Likewise. * tree-ssa-loop-ivopts.c (avg_loop_niter): Likewise. * tree-vect-loop.c (vect_analyze_loop_2): Likewise. From-SVN: r234902
2016-03-30tree-ssa-loop-niter.c (idx_infer_loop_bounds): We can't get realistic ↵Jan Hubicka1-0/+2
estimates here. * tree-ssa-loop-niter.c (idx_infer_loop_bounds): We can't get realistic estimates here. * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Use also max_loop_iterations_int. (tree_unswitch_outer_loop): Likewise. * tree-ssa-loop-ivopts.c (avg_loop_niter): Likewise. * tree-vect-loop.c (vect_analyze_loop_2): Likewise. From-SVN: r234572
2016-03-16tree-vect-loop.c (vect_analyze_loop_2): Fix wrong dump info by reporting ↵Bin Cheng1-2/+3
malformed loop nest. * tree-vect-loop.c (vect_analyze_loop_2): Fix wrong dump info by reporting malformed loop nest. From-SVN: r234254
2016-03-03Skip properly debug stmt in optimize_mask_stores (PRMartin Liska1-1/+4
PR tree-optimization/70043 * tree-vect-loop.c (optimize_mask_stores): Move iterator to previous statement if we see a debug statement. * gfortran.dg/vect/pr70043.f90: New test. From-SVN: r233934
2016-02-29re PR tree-optimization/69720 (wrong code at -O3 on x86_64-linux-gnu)Richard Biener1-9/+22
2016-02-29 Richard Biener <rguenther@suse.de> PR tree-optimization/69720 * tree-vect-loop.c (get_initial_def_for_reduction): Avoid the adjustment_def path for possibly vectorized defs. (vect_create_epilog_for_reduction): Handle vectorized initial defs properly. * gcc.dg/vect/vect-outer-pr69720.c: New testcase. From-SVN: r233803
2016-02-22tree-vect-loop.c (vect_estimate_min_profitable_iters): Dump ↵Bin Cheng1-2/+2
min_profitable_estimate, rather than min_profitable_iters. * tree-vect-loop.c (vect_estimate_min_profitable_iters): Dump min_profitable_estimate, rather than min_profitable_iters. From-SVN: r233604
2016-02-10re PR tree-optimization/69652 ([ICE] verify_ssa fail w/ -O2 -ffast-math ↵Yuri Rumyantsev1-59/+75
-ftree-vectorize) gcc/ 2016-02-10 Yuri Rumyantsev <ysrumyan@gmail.com> PR tree-optimization/69652 * tree-vect-loop.c (optimize_mask_stores): Move declaration of STMT1 to nested loop, did source re-formatting, skip debug statements, add check on statement with volatile operand, remove dead scalar statements. gcc/testsuite/ 2016-02-10 Yuri Rumyantsev <ysrumyan@gmail.com> PR tree-optimization/69652 * gcc.dg/torture/pr69652.c: New test. From-SVN: r233275
2016-02-02re PR middle-end/68542 (10% 481.wrf performance regression)Yuri Rumyantsev1-0/+192
gcc/ 2016-02-02 Yuri Rumyantsev <ysrumyan@gmail.com> PR middle-end/68542 * config/i386/i386.c (ix86_expand_branch): Add support for conditional branch with vector comparison. * config/i386/sse.md (VI48_AVX): New mode iterator. (define_expand "cbranch<mode>4): Add support for conditional branch with vector comparison. * tree-vect-loop.c (optimize_mask_stores): New function. * tree-vect-stmts.c (vectorizable_mask_load_store): Initialize has_mask_store field of vect_info. * tree-vectorizer.c (vectorize_loops): Invoke optimaze_mask_stores for vectorized loops having masked stores after vec_info destroy. * tree-vectorizer.h (loop_vec_info): Add new has_mask_store field and correspondent macros. (optimize_mask_stores): Add prototype. gcc/testsuite 2016-02-02 Yuri Rumyantsev <ysrumyan@gmail.com> PR middle-end/68542 * gcc.dg/vect/vect-mask-store-move-1.c: New test. * gcc.target/i386/avx2-vect-mask-store-move1.c: New test. From-SVN: r233068
2016-01-27re PR tree-optimization/69166 (ICE in get_initial_def_for_reduction, at ↵Richard Biener1-14/+14
tree-vect-loop.c:4188) 2016-01-27 Richard Biener <rguenther@suse.de> PR tree-optimization/69166 * tree-vect-loop.c (vect_is_simple_reduction): Always check reduction code for commutativity / associativity. * gcc.dg/torture/pr69166.c: New testcase. From-SVN: r232878
2016-01-15re PR tree-optimization/66856 (ICE in compute_live_loop_exits, at ↵Richard Biener1-0/+7
tree-ssa-loop-manip.c:234) 2016-01-15 Richard Biener <rguenther@suse.de> PR tree-optimization/66856 * tree-vect-loop.c (vect_transform_loop): Free SLP instances here. * tree-vect-slp.c (vect_free_slp_tree): Decrement stmt reference count. (vect_create_new_slp_node): Increment stmt reference count. (vect_get_and_check_slp_defs): Make sure stmts are nor already in an SLP tree before swapping operands. (vect_build_slp_tree): Likewise. (destroy_bb_vec_info): Free stmt info after SLP instances. * tree-vect-stmts.c (new_stmt_vec_info): Initialize reference count. * tree-vectorizer.h (struct _stmt_vec_info): Add num_slp_uses field. (STMT_VINFO_NUM_SLP_USES): New macro. * gcc.dg/torture/pr66856-1.c: New testcase. * gcc.dg/torture/pr66856-2.c: Likewise. From-SVN: r232435
2016-01-14Tidy: remove reduc_xxx_optab migration code.Alan Lawrence1-8/+4
* doc/md.texi (reduc_smin_@var{m}, reduc_smax_@var{m}, reduc_umin_@var{m}, reduc_umax_@var{m}, reduc_splus_@var{m}, reduc_uplus_@var{m}): Remove. * expr.c (expand_expr_real_2): Remove expansion path for reduc_[us](min|max|plus) optabs. * optabs-tree.c (scalar_reduc_to_vector): Remove. * optabs-tree.h (scalar_reduc_to_vector): Remove. * optabs.def (reduc_smax_optab, reduc_smin_optab, reduc_splus_optab, reduc_umax_optab, reduc_umin_optab, reduc_uplus_optab): Remove. * tree-vect-loop.c (vectorizable_reduction): Remove test for reduc_[us](min|max|plus) optabs. From-SVN: r232373
2016-01-14re PR tree-optimization/68060 (ICE on valid code at -O3 on x86_64-linux-gnu ↵Richard Biener1-2/+5
in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1413) 2016-01-14 Richard Biener <rguenther@suse.de> PR tree-optimization/68060 * tree-vect-loop.c (vect_is_simple_reduction): Check the outer loop reduction is only used in the inner loop before detecting a double reduction. * gcc.dg/torture/pr68060-1.c: New testcase. * gcc.dg/torture/pr68060-2.c: Likewise. From-SVN: r232367
2016-01-12re PR target/69053 (ICE in build_vector_from_val)Richard Biener1-12/+5
2016-01-12 Richard Biener <rguenther@suse.de> PR tree-optimization/69053 * tree-vect-loop.c (get_initial_def_for_reduction): Properly convert initial value for cond reductions. * g++.dg/torture/pr69053.C: New testcase. From-SVN: r232263
2016-01-12re PR tree-optimization/69168 (ICE in vect_analyze_loop_2, at ↵Richard Biener1-2/+2
tree-vect-loop.c:2182) 2016-01-12 Richard Biener <rguenther@suse.de> PR tree-optimization/69168 * tree-vect-loop.c (vect_analyze_loop_2): Reset both main and pattern stmt SLP type. * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Patterns may end up unused so cope with that case. * gcc.dg/torture/pr69168.c: New testcase. From-SVN: r232261
2016-01-11re PR tree-optimization/69173 (ICE (segfault) in vinfo_for_stmt)Richard Biener1-3/+15
2016-01-11 Richard Biener <rguenther@suse.de> PR tree-optimization/69173 * tree-vect-loop.c (vect_fixup_scalar_cycles_with_patterns): Only fixup the cycle if all stmts are in a pattern. * gcc.dg/torture/pr69173.c: New testcase. From-SVN: r232230
2016-01-04Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r232055
2015-12-10re PR tree-optimization/68806 (internal compiler error: Segmentation fault)Richard Biener1-3/+6
2015-12-10 Richard Biener <rguenther@suse.de> PR tree-optimization/68806 * tree-vect-loop.c (vect_analyze_loop_2): Properly detect reduction chains and ignore SLP reductions. * gcc.dg/torture/pr68806.c: New testcase. From-SVN: r231493
2015-11-30re PR tree-optimization/68592 (ICE in vect_get_vec_def_for_operand, at ↵Richard Biener1-0/+7
tree-vect-stmts.c:1403 with -fprofile-generate) 2015-11-30 Richard Biener <rguenther@suse.de> PR tree-optimization/68592 * tree-vect-loop.c (vect_analyze_loop_2): Reset SLP type also on the pattern def sequence. * gfortran.dg/pr68592.f: New testcase. From-SVN: r231074
2015-11-27re PR tree-optimization/68559 (Excessive peeling for gaps)Richard Biener1-0/+1
2015-11-27 Richard Biener <rguenther@suse.de> PR tree-optimization/68559 * tree-vect-data-refs.c (vect_analyze_group_access_1): Move peeling for gap checks ... * tree-vect-stmts.c (vectorizable_load): ... here and relax for SLP. * tree-vect-loop.c (vect_analyze_loop_2): Re-set LOOP_VINFO_PEELING_FOR_GAPS before re-trying without SLP. * gcc.dg/vect/slp-perm-4.c: Adjust again. * gcc.dg/vect/pr45752.c: Likewise. From-SVN: r231015
2015-11-27Fix memory leak in loop_vec_infoMartin Liska1-0/+1
* tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Do not release memory for comp_alias_ddrs. * tree-vect-loop.c (destroy_loop_vec_info): Release the memory for all loop_vec_info. From-SVN: r230995
2015-11-26re PR tree-optimization/66721 (gcc.target/i386/pr61403.c FAILs)Richard Biener1-16/+98
2015-11-26 Richard Biener <rguenther@suse.de> PR tree-optimization/66721 * tree-vect-loop.c (vect_analyze_loop_2): Compute scalar iteration cost earlier. Re-do analysis without SLP when vectorization using SLP fails and without has a chance to succeed. From-SVN: r230956
2015-11-23re PR tree-optimization/68327 (ICE on valid code at -O3 on x86_64-linux-gnu ↵Ilya Enkovich1-1/+2
in vect_is_simple_use, at tree-vect-stmts.c:8562) gcc/ PR tree-optimization/68327 * tree-vect-loop.c (vect_determine_vectorization_factor): Don't compute vectype for non-relevant mask producers. * gcc/tree-vect-stmts.c (vectorizable_comparison): Check stmt relevance earlier. gcc/testsuite/ PR tree-optimization/68327 * gcc.dg/pr68327.c: New test. Co-Authored-By: Richard Biener <rguenther@suse.de> From-SVN: r230743
2015-11-20re PR tree-optimization/68413 (internal compiler error: in vect_transform_stmt)Alan Hayward1-18/+24
2015-11-20 Alan Hayward <alan.hayward@arm.com> PR tree-optimization/68413 * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Cache evolution base (vectorizable_reduction): Use cached base From-SVN: r230658
2015-11-18re PR middle-end/67790 (verify_ssa failed: definition in block 20 follows ↵Richard Biener1-47/+21
the use) 2015-11-18 Richard Biener <rguenther@suse.de> PR tree-optimization/67790 * tree-vect-loop.c (vect_is_simple_reduction_1): Remove IL rewrite for MINUS_EXPR reductions, rename back to ... (vect_is_simple_reduction): ... this, removing the wrapper. (vect_force_simple_reduction): Adjust. (vectorizable_reduction): Adjust reduc_index for MINUS_EXPR reductions and make use if reduc_index in all places. For the final reduction of MINUS_EXPR use PLUS_EXPR. * gcc.dg/vect/pr67790.c: New testcase. From-SVN: r230518
2015-11-13tree-vect-loop.c (vect_determine_vectorization_factor): Check mix of boolean ↵Ilya Enkovich1-0/+25
and integer vectors in a single statement. gcc/ * tree-vect-loop.c (vect_determine_vectorization_factor): Check mix of boolean and integer vectors in a single statement. * tree-vect-slp.c (vect_mask_constant_operand_p): New. (vect_get_constant_vectors): Use vect_mask_constant_operand_p to determine constant type. * tree-vect-stmts.c (vectorizable_comparison): Provide vectype for loop invariants. gcc/testsuite/ * g++.dg/vect/simd-bool-comparison-1.cc: New test. * g++.dg/vect/simd-bool-comparison-2.cc: New test. From-SVN: r230309
2015-11-13Optimize condition reductions where the result is an integer induction variableAlan Hayward1-8/+130
2015-11-13 Alan Hayward <alan.hayward@arm.com> gcc/ PR tree-optimization/66558 * tree-vect-loop.c (is_integer_induction):Add. (vectorizable_reduction): Add integer induction checks. gcc/testsuite/ PR tree-optimization/66558 * gcc.dg/vect/pr65947-1.c: Add checks. * gcc.dg/vect/pr65947-2.c: Add checks. * gcc.dg/vect/pr65947-3.c: Add checks. * gcc.dg/vect/pr65947-4.c: Add checks. * gcc.dg/vect/pr65947-5.c: Add checks. * gcc.dg/vect/pr65947-6.c: Add checks. * gcc.dg/vect/pr65947-10.c: Add checks. * gcc.dg/vect/pr65947-12.c: New test. * gcc.dg/vect/pr65947-13.c: New test. From-SVN: r230297