public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [00/11] Add a vec_basic_block of scalar statements
@ 2018-07-30 11:36 Richard Sandiford
  2018-07-30 11:37 ` [01/11] Schedule SLP earlier Richard Sandiford
                   ` (10 more replies)
  0 siblings, 11 replies; 20+ messages in thread
From: Richard Sandiford @ 2018-07-30 11:36 UTC (permalink / raw)
  To: gcc-patches

This series puts the statements that need to be vectorised into a
"vec_basic_block" structure of linked stmt_vec_infos, and then puts
pattern statements into this block rather than hanging them off the
original scalar statement.

Partly this is clean-up, since making pattern statements more like
first-class statements removes a lot of indirection.  The diffstat
for the series is:

 7 files changed, 691 insertions(+), 978 deletions(-)

It also makes it easier to do something approaching proper DCE
on the scalar code (patch 10).  However, the main motivation is
to allow the result of an earlier pattern statement to be reused
as the STMT_VINFO_RELATED_STMT for a later (non-pattern) statement.
I have two current uses for this:

(1) The way overwidening detection works means that we can sometimes
    be left with sequences of the form:

      type1 narrowed = ... + ...;   // originally done in type2
      type2 extended = (type2) narrowed;
      type3 truncated = (type3) extended;

    which cast_forwprop can simplify to:

      type1 narrowed = ... + ...;   // originally done in type2
      type3 truncated = (type3) narrowed;

    But if type3 == type1, we really want to replace truncated
    directly with narrowed.  The current representation doesn't
    allow this.

(2) For SVE extending loads, we want to look for:

      type1 narrow = *ptr;
      type2 extended = (type2) narrow; // only use of narrow

    replace narrow with:

      type2 tmp = .LOAD_EXT (ptr, ...);

    and replace extended directly with tmp.  (Deleting narrow and
    replacing tmp with a .LOAD_EXT would move the location of the
    load and so wouldn't be safe in general.)

The series doesn't do either of these things, it's just laying the
groundwork.  It applies on top of:

https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01308.html

I tested each individual patch on aarch64-linux-gnu and the series as a
whole on aarch64-linux-gnu with SVE, aarch64_be-elf and x86_64-linux-gnu.
OK to install?

Thanks,
Richard

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-08-01 13:01 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-30 11:36 [00/11] Add a vec_basic_block of scalar statements Richard Sandiford
2018-07-30 11:37 ` [01/11] Schedule SLP earlier Richard Sandiford
2018-08-01 12:49   ` Richard Biener
2018-07-30 11:37 ` [02/11] Remove vect_schedule_slp return value Richard Sandiford
2018-08-01 12:49   ` Richard Biener
2018-07-30 11:38 ` [03/11] Remove vect_transform_stmt grouped_store argument Richard Sandiford
2018-08-01 12:49   ` Richard Biener
2018-07-30 11:38 ` [04/11] Add a vect_orig_stmt helper function Richard Sandiford
2018-08-01 12:50   ` Richard Biener
2018-07-30 11:39 ` [05/11] Add a vect_stmt_to_vectorize " Richard Sandiford
2018-08-01 12:51   ` Richard Biener
2018-07-30 11:41 ` [06/11] Handle VMAT_INVARIANT separately Richard Sandiford
2018-08-01 12:52   ` Richard Biener
2018-07-30 11:42 ` [07/11] Use single basic block array in loop_vec_info Richard Sandiford
2018-08-01 12:58   ` Richard Biener
2018-07-30 11:43 ` [08/11] Make hoist_defs_of_uses use vec_info::lookup_def Richard Sandiford
2018-08-01 13:01   ` Richard Biener
2018-07-30 11:46 ` [09/11] Add a vec_basic_block structure Richard Sandiford
2018-07-30 11:46 ` [10/11] Make the vectoriser do its own DCE Richard Sandiford
2018-07-30 11:47 ` [11/11] Insert pattern statements into vec_basic_blocks Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).