Created attachment 36434 [details]
A loop in the test attached compiled with -m32 -msse4.2 -O2 -ftree-vectorize -fPIE -pie -c is no more vectorized after r223525 (while on r223524 everything is OK) because of strange DOT_PROD_EXPR recognition (see below).
vect_is_simple_use: operand _15
def_stmt: _15 = _14 * 76;
type of def: internal
vect_recog_dot_prod_pattern: detected: patt_47 = DOT_PROD_EXPR <_2, 76, _17>;
pattern recognized: patt_47 = DOT_PROD_EXPR <_2, 76, _17>;
Nota bene: -fPIE -pie options can be ommited.
Mine. I think this particular issue was also noticed in another bug.
Richard, do you have any plans regarding this?
The other bug was PR67612. I have a half-way started DOT_PPROD (and SAD_EXPR)
support in vectorizable_conversion but it's not trivial as it doesn't fit there
very. I've got distracted meanwhile.
A way to fix the regressions (but not PR67612) is to revert the reduction
check parts of
2015-05-22 Richard Biener <firstname.lastname@example.org>
* tree-vect-patterns.c (vect_recog_dot_prod_pattern): Replace
assert with guard, remove check on detected reduction.
which was preparation for BB vectorization support for reductions (which
I didn't get to finish).
But I'd rather have non-reduction support for DOT_PROD and SAD_EXPR and hope
to get to that during stage3.
If you can beat me to it more power to you ;)
Richard, are there any updates on this?
If BB vectorization support for reductions does not fit your plans for stage3, we'd like to fix the regression by doing a partial revert described above.
On Tue, 1 Dec 2015, afomin.mailbox at gmail dot com wrote:
> --- Comment #5 from Alexander Fomin <afomin.mailbox at gmail dot com> ---
> Richard, are there any updates on this?
> If BB vectorization support for reductions does not fit your plans for stage3,
> we'd like to fix the regression by doing a partial revert described above.
I will fix this PR in stage3 by either improving vectoirzation here
or partially reverting the commit. Stay tuned.
Ah, so reverting these changes causes
FAIL: gcc.dg/vect/slp-reduc-sad.c scan-tree-dump vect "vectorizing stmts using SLP"
FAIL: gcc.dg/vect/slp-reduc-sad.c scan-tree-dump-times vect "vectorized 1 loops" 1
with similar testcases using a dot product or widening sum pattern would
need to be added. Note that the above are in reduction context but only
the first stmt of the reduction chain is marked as such.
Thus we need to amend the check with ! STMT_VINFO_GROUP_FIRST_ELEMENT (stmt_vinfo).
Testing that now.
Date: Thu Dec 3 08:43:22 2015
New Revision: 231221
2015-12-03 Richard Biener <email@example.com>
* tree-vect-patterns.c (vect_recog_dot_prod_pattern): Restore
restriction to reduction contexts but allow SLP reductions as well.
* gcc.target/i386/vect-pr67800.c: New testcase.
Thanks, closing it.