This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: Cong Hou <congh at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 13 Jan 2014 14:45:01 +0100
- Subject: Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.
- Authentication-results: sourceware.org; auth=none
- References: <CAK=A3=3m-dK_HHR8K5CF0n+uTnu5k4=swXHf3SzdH3KHoLzuTw at mail dot gmail dot com> <alpine dot LNX dot 2 dot 00 dot 1311271020320 dot 8615 at zhemvz dot fhfr dot qr> <20131127113730 dot GZ892 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1401131430090 dot 4623 at zhemvz dot fhfr dot qr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jan 13, 2014 at 02:37:38PM +0100, Richard Biener wrote:
> 2014-01-13 Richard Biener <rguenther@suse.de>
>
> PR tree-optimization/58921
> PR tree-optimization/59006
> * tree-vect-loop-manip.c (vect_loop_versioning): Remove code
> hoisting invariant stmts.
> * tree-vect-stmts.c (vectorizable_load): Insert the splat of
> invariant loads on the preheader edge if possible.
>
> * gcc.dg/torture/pr58921.c: New testcase.
> * gcc.dg/torture/pr59006.c: Likewise.
> * gcc.dg/vect/pr58508.c: XFAIL no longer handled cases.
Looks good to me. If you want, I can add another bool to loop_vinfo, which
would say if in the vectorized loop could be aliasing preventing the
hoisting (i.e. set to false always, unless the loop->simdlen > 0, when it
would be set if we would without loop->simdlen > 0 use versioning for alias
or punting, but loop->simdlen > 0 resulted in vectorization of the loop
anyway). Then, as a follow-up we could use that predicate instead of
LOOP_REQUIRES_VERSIONING_FOR_ALIAS in vectorizable_load.
Jakub