public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/98697] New: shl not vectorized for v16qi and v8hi with MVE
@ 2021-01-15 10:44 clyon at gcc dot gnu.org
  2021-01-15 10:55 ` [Bug target/98697] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: clyon at gcc dot gnu.org @ 2021-01-15 10:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98697

            Bug ID: 98697
           Summary: shl not vectorized for v16qi and v8hi with MVE
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: clyon at gcc dot gnu.org
  Target Milestone: ---

As described in
https://gcc.gnu.org/pipermail/gcc-patches/2020-December/562235.html we
currently fail to vectorize

dest[i] = a[i] << b[i]
when the element types are v16qi or v8hi

I've committed the support for shl auto-vectorization for MVE in
g:7432f255b70811dafaf325d94036ac580891de69 (r11-6707)

I haven't yet found why the v16qi and v8hi tests are not vectorized.
With dest[i] = a[i] << b[i] and:
  {
    int i;
    unsigned int i.24_1;
    unsigned int _2;
    int16_t * _3;
    short int _4;
    int _5;
    int16_t * _6;
    short int _7;
    int _8;
    int _9;
    int16_t * _10;
    short int _11;
    unsigned int ivtmp_42;
    unsigned int ivtmp_43;

    <bb 2> [local count: 119292720]:

    <bb 3> [local count: 954449105]:
    i.24_1 = (unsigned int) i_23;
    _2 = i.24_1 * 2;
    _3 = a_15(D) + _2;
    _4 = *_3;
    _5 = (int) _4;
    _6 = b_16(D) + _2;
    _7 = *_6;
    _8 = (int) _7;
    _9 = _5 << _8;
    _10 = dest_17(D) + _2;
    _11 = (short int) _9;
    *_10 = _11;
    i_19 = i_23 + 1;
    ivtmp_42 = ivtmp_43 - 1;
    if (ivtmp_42 != 0)
      goto <bb 5>; [87.50%]
    else
      goto <bb 4>; [12.50%]

    <bb 5> [local count: 835156386]:
    goto <bb 3>; [100.00%]

    <bb 4> [local count: 119292720]:
    return;

  }
the vectorizer says:
mve-vshl.c:37:96: note:   ==> examining statement: _5 = (int) _4;
mve-vshl.c:37:96: note:   vect_is_simple_use: operand *_3, type of def:
internal
mve-vshl.c:37:96: note:   vect_is_simple_use: vectype vector(8) short int
mve-vshl.c:37:96: missed:   conversion not supported by target.
mve-vshl.c:37:96: note:   vect_is_simple_use: operand *_3, type of def:
internal
mve-vshl.c:37:96: note:   vect_is_simple_use: vectype vector(8) short int
mve-vshl.c:37:96: note:   vect_is_simple_use: operand *_3, type of def:
internal
mve-vshl.c:37:96: note:   vect_is_simple_use: vectype vector(8) short int
mve-vshl.c:37:117: missed:   not vectorized: relevant stmt not supported: _5 =
(int) _4;
mve-vshl.c:37:96: missed:  bad operation or unsupported loop bound.
mve-vshl.c:37:96: note:  ***** Analysis failed with vector mode V8HI

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

* [Bug target/98697] shl not vectorized for v16qi and v8hi with MVE
  2021-01-15 10:44 [Bug target/98697] New: shl not vectorized for v16qi and v8hi with MVE clyon at gcc dot gnu.org
@ 2021-01-15 10:55 ` rguenth at gcc dot gnu.org
  2021-01-21 14:41 ` clyon at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-15 10:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98697

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
it looks like unpack from short int to int is not supported?  That is,
the usual issue is that a[i] << b[i] is a shift of int << ... because
of C integral promotion rules.

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

* [Bug target/98697] shl not vectorized for v16qi and v8hi with MVE
  2021-01-15 10:44 [Bug target/98697] New: shl not vectorized for v16qi and v8hi with MVE clyon at gcc dot gnu.org
  2021-01-15 10:55 ` [Bug target/98697] " rguenth at gcc dot gnu.org
@ 2021-01-21 14:41 ` clyon at gcc dot gnu.org
  2021-01-22  1:24 ` crazylht at gmail dot com
  2021-01-22  1:26 ` crazylht at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: clyon at gcc dot gnu.org @ 2021-01-21 14:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98697

--- Comment #2 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Why would this be different from right shift, where we don't miss the
optimization?

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

* [Bug target/98697] shl not vectorized for v16qi and v8hi with MVE
  2021-01-15 10:44 [Bug target/98697] New: shl not vectorized for v16qi and v8hi with MVE clyon at gcc dot gnu.org
  2021-01-15 10:55 ` [Bug target/98697] " rguenth at gcc dot gnu.org
  2021-01-21 14:41 ` clyon at gcc dot gnu.org
@ 2021-01-22  1:24 ` crazylht at gmail dot com
  2021-01-22  1:26 ` crazylht at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: crazylht at gmail dot com @ 2021-01-22  1:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98697

--- Comment #3 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Christophe Lyon from comment #2)
> Why would this be different from right shift, where we don't miss the
> optimization?

It's supposed to be handled in vect_recog_over_widening_pattern, but failed
since it may overflow?

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

* [Bug target/98697] shl not vectorized for v16qi and v8hi with MVE
  2021-01-15 10:44 [Bug target/98697] New: shl not vectorized for v16qi and v8hi with MVE clyon at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-01-22  1:24 ` crazylht at gmail dot com
@ 2021-01-22  1:26 ` crazylht at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: crazylht at gmail dot com @ 2021-01-22  1:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98697

--- Comment #4 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Hongtao.liu from comment #3)
> (In reply to Christophe Lyon from comment #2)
> > Why would this be different from right shift, where we don't miss the
> > optimization?
> 
> It's supposed to be handled in vect_recog_over_widening_pattern, but failed
> since it may overflow?

x86 also have same problem for vpsllvw.

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

end of thread, other threads:[~2021-01-22  1:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 10:44 [Bug target/98697] New: shl not vectorized for v16qi and v8hi with MVE clyon at gcc dot gnu.org
2021-01-15 10:55 ` [Bug target/98697] " rguenth at gcc dot gnu.org
2021-01-21 14:41 ` clyon at gcc dot gnu.org
2021-01-22  1:24 ` crazylht at gmail dot com
2021-01-22  1:26 ` crazylht at gmail dot com

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).