public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/99856] [9/10/11 Regression] Alpha Compositing auto vectorization regression
Date: Thu, 01 Apr 2021 07:21:41 +0000	[thread overview]
Message-ID: <bug-99856-4-IMjJo6zaKJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99856-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |9.3.0
           Priority|P3                          |P2
             Status|NEW                         |ASSIGNED
   Target Milestone|---                         |9.4
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
             Target|                            |x86_64-*-*

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
t.c:16:14: note:   op template: patt_266 = (<unnamed-unsigned:17>) _8;
t.c:16:14: note:        stmt 0 patt_266 = (<unnamed-unsigned:17>) _8;
t.c:16:14: note:        stmt 1 patt_243 = (<unnamed-unsigned:17>) _28;
t.c:16:14: note:        stmt 2 patt_220 = (<unnamed-unsigned:17>) _46;
t.c:16:14: note:        stmt 3 patt_198 = (<unnamed-unsigned:17>) _60;
t.c:16:14: note:        children 0x38267e0

WTF

t.c:16:14: note:   ==> examining pattern def stmt: patt_266 =
(<unnamed-unsigned:17>) _8;
t.c:16:14: note:   precomputed vectype: vector(8) unsigned int
t.c:16:14: note:   get vectype for smallest scalar type: unsigned char

the dumps do not show who creates this 17 bit precision temporary, but clearly
this causes

t.c:16:14: note:   ==> examining statement: patt_266 = (<unnamed-unsigned:17>)
_8;
t.c:16:14: note:   vect_is_simple_use: operand *_7, type of def: internal
t.c:16:14: missed:   type conversion to/from bit-precision unsupported.
t.c:16:14: missed:   bit-precision arithmetic not supported.
t.c:16:14: note:   vect_is_simple_use: operand *_7, type of def: internal
t.c:11:1: missed:   not vectorized: relevant stmt not supported: patt_266 =
(<unnamed-unsigned:17>) _8;
t.c:16:14: note:   removing SLP instance operations starting from: *_20 = _21;
t.c:16:14: missed:  unsupported SLP instances
t.c:16:14: note:  re-trying with SLP disabled
...
t.c:16:14: note:   ==> examining statement: patt_266 = (<unnamed-unsigned:17>)
_8;
t.c:16:14: note:   vect_is_simple_use: operand *_7, type of def: internal
t.c:16:14: note:   vect_is_simple_use: vectype const vector(32) unsigned char
t.c:16:14: missed:   type conversion to/from bit-precision unsupported.
t.c:16:14: missed:   bit-precision arithmetic not supported.
t.c:16:14: note:   vect_is_simple_use: operand *_7, type of def: internal
t.c:16:14: note:   vect_is_simple_use: vectype const vector(32) unsigned char
t.c:11:1: missed:   not vectorized: relevant stmt not supported: patt_266 =
(<unnamed-unsigned:17>) _8;
t.c:16:14: missed:  bad operation or unsupported loop bound.


Breakpoint 6, build_nonstandard_integer_type (precision=17, unsignedp=1)
    at /home/rguenther/src/gcc3/gcc/tree.c:8090
8090      if (unsignedp)
(gdb) bt
#0  build_nonstandard_integer_type (precision=17, unsignedp=1)
    at /home/rguenther/src/gcc3/gcc/tree.c:8090
#1  0x00000000024461ab in vect_recog_over_widening_pattern (vinfo=0x385bf60, 
    last_stmt_info=0x38d1130, type_out=0x7fffffffc7d0)
    at /home/rguenther/src/gcc3/gcc/tree-vect-patterns.c:1719
#2  0x0000000002453c10 in vect_pattern_recog_1 (vinfo=0x385bf60, 
    recog_func=0x359bf80 <vect_vect_recog_func_ptrs>, stmt_info=0x38d1130)
    at /home/rguenther/src/gcc3/gcc/tree-vect-patterns.c:5463
#3  0x0000000002453fee in vect_pattern_recog (vinfo=0x385bf60)
    at /home/rguenther/src/gcc3/gcc/tree-vect-patterns.c:5603

where

(gdb) p last_stmt_info->min_output_precision
$9 = 17
(gdb) p last_stmt_info->operation_precision
$10 = 8

and the min_output_precision is determined from the defs uses
min_input_precision.

I didn't trace further where we arrive at '17', but

diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index b575b456301..803de3fc287 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -1705,6 +1705,7 @@ vect_recog_over_widening_pattern (vec_info *vinfo,
   /* Apply the minimum efficient precision we just calculated.  */
   if (new_precision < min_precision)
     new_precision = min_precision;
+  new_precision = vect_element_precision (new_precision);
   if (new_precision >= TYPE_PRECISION (type))
     return NULL;

restores vectorization.

  parent reply	other threads:[~2021-04-01  7:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31 20:24 [Bug c/99856] New: Alpha Compositing auto vectorization regression: 8.3 -> 9.1 dushistov at mail dot ru
2021-04-01  4:42 ` [Bug tree-optimization/99856] [9/10/11 Regression] Alpha Compositing auto vectorization regression marxin at gcc dot gnu.org
2021-04-01  7:21 ` rguenth at gcc dot gnu.org [this message]
2021-04-01  8:23 ` cvs-commit at gcc dot gnu.org
2021-04-01  9:14 ` [Bug tree-optimization/99856] [9/10 " cvs-commit at gcc dot gnu.org
2021-04-01  9:42 ` [Bug tree-optimization/99856] [9 " cvs-commit at gcc dot gnu.org
2021-04-01  9:43 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-99856-4-IMjJo6zaKJ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).