]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/tree-vect-stmts.c
Add clobbers around IFN_LOAD/STORE_LANES
authorRichard Sandiford <richard.sandiford@linaro.org>
Wed, 9 May 2018 10:35:31 +0000 (10:35 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 9 May 2018 10:35:31 +0000 (10:35 +0000)
commit3ba4ff4130903a3ded931d715a2204bd8834fe60
treeb4169b8ee2397d6e437e42db8eb32d752bd0347b
parent82191cbf3f277d73b52a79599b329b52fd567f83
Add clobbers around IFN_LOAD/STORE_LANES

We build up the input to IFN_STORE_LANES one vector at a time.
In RTL, each of these vector assignments becomes a write to
subregs of the form (subreg:VEC (reg:AGGR R)), where R is the
eventual input to the store lanes instruction.  The problem is
that RTL isn't very good at tracking liveness when things are
initialised piecemeal by subregs, so R tends to end up being
live on all paths from the entry block to the store.  This in
turn leads to unnecessary spilling around calls, as well as to
excess register pressure in vector loops.

This patch adds gimple clobbers to indicate the liveness of the
IFN_STORE_LANES variable and makes sure that gimple clobbers are
expanded to rtl clobbers where useful.  For consistency it also
uses clobbers to mark the point at which an IFN_LOAD_LANES
variable is no longer needed.

2018-05-08  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* cfgexpand.c (expand_clobber): New function.
(expand_gimple_stmt_1): Use it.
* tree-vect-stmts.c (vect_clobber_variable): New function,
split out from...
(vectorizable_simd_clone_call): ...here.
(vectorizable_store): Emit a clobber either side of an
IFN_STORE_LANES sequence.
(vectorizable_load): Emit a clobber after an IFN_LOAD_LANES sequence.

gcc/testsuite/
* gcc.target/aarch64/store_lane_spill_1.c: New test.
* gcc.target/aarch64/sve/store_lane_spill_1.c: Likewise.

From-SVN: r260073
gcc/ChangeLog
gcc/cfgexpand.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/store_lane_spill_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/store_lane_spill_1.c [new file with mode: 0644]
gcc/tree-vect-stmts.c