public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/88531] Index data types when targeting AVX-512 vectorization with gather/scatter
       [not found] <bug-88531-4@http.gcc.gnu.org/bugzilla/>
@ 2021-07-21  3:36 ` pinskia at gcc dot gnu.org
  2021-08-06  7:23 ` crazylht at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-21  3:36 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Blocks|                            |53947
           Severity|normal                      |enhancement


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations

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

* [Bug tree-optimization/88531] Index data types when targeting AVX-512 vectorization with gather/scatter
       [not found] <bug-88531-4@http.gcc.gnu.org/bugzilla/>
  2021-07-21  3:36 ` [Bug tree-optimization/88531] Index data types when targeting AVX-512 vectorization with gather/scatter pinskia at gcc dot gnu.org
@ 2021-08-06  7:23 ` crazylht at gmail dot com
  2021-08-06 13:01 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: crazylht at gmail dot com @ 2021-08-06  7:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Hongtao.liu <crazylht at gmail dot com> ---
I notice this testcase can be vectorized w/ gcc version 12.0.0 20210805
(experimental) (GCC) 

Guess it's related to Richi's
https://gcc.gnu.org/pipermail/gcc-patches/2021-August/576527.html

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

* [Bug tree-optimization/88531] Index data types when targeting AVX-512 vectorization with gather/scatter
       [not found] <bug-88531-4@http.gcc.gnu.org/bugzilla/>
  2021-07-21  3:36 ` [Bug tree-optimization/88531] Index data types when targeting AVX-512 vectorization with gather/scatter pinskia at gcc dot gnu.org
  2021-08-06  7:23 ` crazylht at gmail dot com
@ 2021-08-06 13:01 ` hjl.tools at gmail dot com
  2021-08-06 13:29 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2021-08-06 13:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> ---
It is fixed by r12-2733.

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

* [Bug tree-optimization/88531] Index data types when targeting AVX-512 vectorization with gather/scatter
       [not found] <bug-88531-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-08-06 13:01 ` hjl.tools at gmail dot com
@ 2021-08-06 13:29 ` rguenth at gcc dot gnu.org
  2021-08-06 13:29 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-08-06 13:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, that probably was an unintended side-effect of now doing

          /* Include the conversion if it is widening and we're using
             the IFN path or the target can handle the converted from
             offset or the current size is not already the same as the
             data vector element size.  */
          if ((TYPE_PRECISION (TREE_TYPE (op0))
               < TYPE_PRECISION (TREE_TYPE (off)))
              && (use_ifn_p
                  || (DR_IS_READ (dr)
                      ? (targetm.vectorize.builtin_gather
                         && targetm.vectorize.builtin_gather (vectype,
                                                              TREE_TYPE (op0),
                                                              scale))
                      : (targetm.vectorize.builtin_scatter
                         && targetm.vectorize.builtin_scatter (vectype,
                                                               TREE_TYPE (op0),
                                                               scale)))
                  || !operand_equal_p (TYPE_SIZE (TREE_TYPE (off)),
                                       TYPE_SIZE (TREE_TYPE (vectype)), 0)))
            {
              off = op0;
              offtype = TREE_TYPE (off);
              STRIP_NOPS (off);
              continue;
            }

that is we no longer try to consume the conversion because with the conversion
source the gather is not supported and the offset is also already of the
size of the data.

We should probably add this testcase to make sure any other heuristic
improvements in the above code doesn't break it again.

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

* [Bug tree-optimization/88531] Index data types when targeting AVX-512 vectorization with gather/scatter
       [not found] <bug-88531-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-08-06 13:29 ` rguenth at gcc dot gnu.org
@ 2021-08-06 13:29 ` hjl.tools at gmail dot com
  2021-08-06 13:31 ` hjl.tools at gmail dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2021-08-06 13:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from H.J. Lu <hjl.tools at gmail dot com> ---
For some reason,

-march=x86-64 -mx32

and

-march=x86-64 -m32 -mfpmath=sse

won't vectorize the loop.

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

* [Bug tree-optimization/88531] Index data types when targeting AVX-512 vectorization with gather/scatter
       [not found] <bug-88531-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-08-06 13:29 ` hjl.tools at gmail dot com
@ 2021-08-06 13:31 ` hjl.tools at gmail dot com
  2021-08-07 14:35 ` cvs-commit at gcc dot gnu.org
  2021-08-07 14:42 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2021-08-06 13:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from H.J. Lu <hjl.tools at gmail dot com> ---
Here is the equivalent C code:

---
#include <stdint.h>

#define loop_t uint32_t
#define idx_t uint32_t

void loop(double * const __restrict__ dst,
          double const * const __restrict__ src,
          idx_t const * const __restrict__ idx,
          loop_t const begin,
          loop_t const end)
{
  for (loop_t i = begin; i < end; ++i)
    dst[i] = 42.0 * src[idx[i]];
}
---

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

* [Bug tree-optimization/88531] Index data types when targeting AVX-512 vectorization with gather/scatter
       [not found] <bug-88531-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-08-06 13:31 ` hjl.tools at gmail dot com
@ 2021-08-07 14:35 ` cvs-commit at gcc dot gnu.org
  2021-08-07 14:42 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-07 14:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:

https://gcc.gnu.org/g:6866f4819ad8e6e62fef2177520f9fb217dfa353

commit r12-2795-g6866f4819ad8e6e62fef2177520f9fb217dfa353
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Aug 7 07:29:04 2021 -0700

    Add tests for PR tree-optimization/88531

            PR tree-optimization/88531
            * gcc.target/i386/pr88531-1a.c: New test.
            * gcc.target/i386/pr88531-1b.c: Likewise.
            * gcc.target/i386/pr88531-1c.c: Likewise.
            * gcc.target/i386/pr88531-2a.c: Likewise.
            * gcc.target/i386/pr88531-2b.c: Likewise.
            * gcc.target/i386/pr88531-2c.c: Likewise.

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

* [Bug tree-optimization/88531] Index data types when targeting AVX-512 vectorization with gather/scatter
       [not found] <bug-88531-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2021-08-07 14:35 ` cvs-commit at gcc dot gnu.org
@ 2021-08-07 14:42 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2021-08-07 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #15 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for GCC 12.

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

end of thread, other threads:[~2021-08-07 14:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-88531-4@http.gcc.gnu.org/bugzilla/>
2021-07-21  3:36 ` [Bug tree-optimization/88531] Index data types when targeting AVX-512 vectorization with gather/scatter pinskia at gcc dot gnu.org
2021-08-06  7:23 ` crazylht at gmail dot com
2021-08-06 13:01 ` hjl.tools at gmail dot com
2021-08-06 13:29 ` rguenth at gcc dot gnu.org
2021-08-06 13:29 ` hjl.tools at gmail dot com
2021-08-06 13:31 ` hjl.tools at gmail dot com
2021-08-07 14:35 ` cvs-commit at gcc dot gnu.org
2021-08-07 14:42 ` hjl.tools 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).