This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Mostly minor technical cleanups I ran across - missing new lines, 80 column overflow, outdated documentation, etc. The only two bits of new functionality in this patch are: 1) don't fail vectorization in the presence of a computation that is used out of the loop, if this computation is loop invariant. In this special case we can leave the scalar computation in place even if the loop gets vectorized. This is handled by a new function - vectorizable_live_operation. Currently this function handles only invariants (cause these can be trivially handled, by simply doing nothing). In the future it will also handle other cases, like inducion variables (for which we'd want to compute the last value of the induction at the loop exit). 2) don't vectorize the loop if there's no operation that actually needs to be transformed. This happens for example in cases that a loop computes an invariant value and can be removed (such loops may exist after PRE, see vect-62.c - the second loop in this testcase is left unvectorized). Bootstrapped and tested on powerpc-apple-darwin, committed to autovect-branch. dorit Changelog: * tree-vect-analyze.c (vect_determine_vectorization_factor): Fix 80 columns overflow. (vect_analyze_operations): Check RELEVANT_P stmts and LIVE_P stmts separately. Call vectorizable_live_operation. Check if vectorization is needed. (vect_enhance_data_refs_alignment): New line after declarations. (vect_stmt_relevant_p): Remove redundant comment. (vect_mark_stmts_to_be_vectorized): Add comments. Move invariant computation out of the loop. (vect_can_advance_ivs_p): Fix print format. (vect_analyze_loop): Fix comment. * tree-vect-transform (vectorizable_assignment): Remove handling of LIVE_P case (factored out to vectorizable_live_operation). (vectorizable_live_operation): New. (vect_transform_stmt): Handle RELEVANT_P stmts and LIVE_P stmts separately. Call vectorizable_live_operation. * tree-vectorizer.h (vectorizable_live_operation): New declaration. testsuite/Changelog: * gcc.dg/vect/no_version/vect-62.c: Update comment. Check that we don't vectorize the second loop cause we chose not to. * gcc.dg/vect/no_version/vect-91.c: Duplicate of vect-71.c. Changed to check a different functionality. * gcc.dg/vect/vect-reduc-1.c: Remove include of stdio.h. * gcc.dg/vect/vect-reduc-2.c: Likewise. * gcc.dg/vect/vect-reduc-3.c: Likewise. * gcc.dg/vect/vect-reduc-4.c: Likewise. Remove option -fno-tree-vect-loop-version. * gcc.dg/vect/vect-reduc-5.c: Likewise. * gcc.dg/vect/vect-reduc-6.c: Remove include of stdio.h. Change effective_target to vect_float. Patch: (See attached file: autovect.cleanups)
Attachment:
autovect.cleanups
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |