This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [5/6] Insert pattern statements into vec_basic_blocks
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, richard dot sandiford at arm dot com
- Date: Wed, 29 Aug 2018 09:55:47 +0200
- Subject: Re: [5/6] Insert pattern statements into vec_basic_blocks
- References: <87tvnerb5m.fsf@arm.com> <878t4qray1.fsf@arm.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Aug 28, 2018 at 12:24:06PM +0100, Richard Sandiford wrote:
> The point of this patch is to put pattern statements in the same
> vec_basic_block as the statements they replace, with the pattern
> statements for S coming between S and S's original predecessor.
> This removes the need to handle them specially in various places.
My preferred way to handle pattern stmts would be to do what we do in
tree-if-conversion, i.e. whenever creating first pattern stmt for certain
loop, duplicate that loop directly in the IL guarded with an ifn
and modify directly one copy of the loop (the one meant to be vectorized).
If we aren't cycling over multiple vectorization factors, that could be even
done directly on the tree-if-conversion created vector loop copy, otherwise
we'd need more.
For tree-if-conversion, we have:
if (LOOP_VECTORIZED (num))
loop;
else
loop; // scalar loop, to use if vectorization fails
so for multiple vfs we could have:
if (LOOP_VECTORIZED (num))
{
if (LOOP_VECTORIZED (num, 8))
loop; // if vf is 8
else if (LOOP_VECTORIZED (num, 4))
loop; // if vf is 4
else
loop; // otherwise
}
else
loop; // scalar loop, to use if vectorization fails
Jakub