Fix PR94401 by considering reverse overrun
authorKewen Lin <linkw@linux.ibm.com>
Thu, 2 Apr 2020 13:48:03 +0000 (08:48 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Thu, 2 Apr 2020 13:54:11 +0000 (08:54 -0500)
commit81ce375d1fdd99f9d93b00f4895eab74c3d8b54a
treeacc2712194440216d6a4a94c1d4c92ce520ae591
parent68cbee9bf53332721ae33c517ca46039368c0a95
Fix PR94401 by considering reverse overrun

The commit r10-7415 brings scalar type consideration
to eliminate epilogue peeling for gaps, but it exposed
one problem that the current handling doesn't consider
the memory access type VMAT_CONTIGUOUS_REVERSE, for
which the overrun happens on low address side.  This
patch is to make the code take care of it by updating
the offset and construction element order accordingly.

Bootstrapped/regtested on powerpc64le-linux-gnu P8
and aarch64-linux-gnu.

2020-04-02  Kewen Lin  <linkw@gcc.gnu.org>

gcc/ChangeLog

    PR tree-optimization/94401
    * tree-vect-loop.c (vectorizable_load): Handle VMAT_CONTIGUOUS_REVERSE
    access type when loading halves of vector to avoid peeling for gaps.
gcc/ChangeLog
gcc/tree-vect-stmts.c