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]

Re: [5/6] Insert pattern statements into vec_basic_blocks


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]