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]

[00/11] Add a vec_basic_block of scalar statements


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


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