public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/70314] AVX512 not using kandw to combine comparison results
       [not found] <bug-70314-4@http.gcc.gnu.org/bugzilla/>
@ 2020-08-05 14:47 ` cvs-commit at gcc dot gnu.org
  2020-08-05 15:01 ` glisse at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-05 14:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marc Glisse <glisse@gcc.gnu.org>:

https://gcc.gnu.org/g:229752afe3156a3990dacaedb94c76846cebf132

commit r11-2577-g229752afe3156a3990dacaedb94c76846cebf132
Author: Marc Glisse <marc.glisse@inria.fr>
Date:   Wed Aug 5 16:45:33 2020 +0200

    VEC_COND_EXPR optimizations

    When vector comparisons were forced to use vec_cond_expr, we lost a number
of optimizations (my fault for not adding enough testcases to
    prevent that). This patch tries to unwrap vec_cond_expr a bit so some
optimizations can still happen.

    I wasn't planning to add all those transformations together, but adding one
caused a regression, whose fix introduced a second regression,
    etc.

    Restricting to constant folding would not be sufficient, we also need at
least things like X|0 or X&X. The transformations are quite
    conservative with :s and folding only if everything simplifies, we may want
to relax this later. And of course we are going to miss things
    like a?b:c + a?c:b -> b+c.

    In terms of number of operations, some transformations turning 2
VEC_COND_EXPR into VEC_COND_EXPR + BIT_IOR_EXPR + BIT_NOT_EXPR might not look
    like a gain... I expect the bit_not disappears in most cases, and
VEC_COND_EXPR looks more costly than a simpler BIT_IOR_EXPR.

    2020-08-05  Marc Glisse  <marc.glisse@inria.fr>

            PR tree-optimization/95906
            PR target/70314
            * match.pd ((c ? a : b) op d, (c ? a : b) op (c ? d : e),
            (v ? w : 0) ? a : b, c1 ? c2 ? a : b : b): New transformations.
            (op (c ? a : b)): Update to match the new transformations.

            * gcc.dg/tree-ssa/andnot-2.c: New file.
            * gcc.dg/tree-ssa/pr95906.c: Likewise.
            * gcc.target/i386/pr70314.c: Likewise.

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

* [Bug target/70314] AVX512 not using kandw to combine comparison results
       [not found] <bug-70314-4@http.gcc.gnu.org/bugzilla/>
  2020-08-05 14:47 ` [Bug target/70314] AVX512 not using kandw to combine comparison results cvs-commit at gcc dot gnu.org
@ 2020-08-05 15:01 ` glisse at gcc dot gnu.org
  2020-08-06  3:16 ` crazylht at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: glisse at gcc dot gnu.org @ 2020-08-05 15:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> ---
We now generate for the original testcase

        vpcmpd  $1, %zmm3, %zmm2, %k1
        vpcmpd  $1, %zmm1, %zmm0, %k0{%k1}
        vpmovm2d        %k0, %zmm0

which looks great.

However, using | instead of &, we get

        vpcmpd  $1, %zmm1, %zmm0, %k0
        vpcmpd  $1, %zmm3, %zmm2, %k1
        kmovw   %k0, %eax
        kmovw   %k1, %edx
        orl     %edx, %eax
        kmovw   %eax, %k2
        vpmovm2d        %k2, %zmm0

Well, at least gimple did what it could, and it is now up to the target to
handle logical operations on bool vectors / k* registers. There is probably
already another bug report about that...

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

* [Bug target/70314] AVX512 not using kandw to combine comparison results
       [not found] <bug-70314-4@http.gcc.gnu.org/bugzilla/>
  2020-08-05 14:47 ` [Bug target/70314] AVX512 not using kandw to combine comparison results cvs-commit at gcc dot gnu.org
  2020-08-05 15:01 ` glisse at gcc dot gnu.org
@ 2020-08-06  3:16 ` crazylht at gmail dot com
  2020-08-06  3:50 ` crazylht at gmail dot com
  2020-08-06  6:16 ` glisse at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: crazylht at gmail dot com @ 2020-08-06  3:16 UTC (permalink / raw)
  To: gcc-bugs

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

Hongtao.liu <crazylht at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crazylht at gmail dot com

--- Comment #5 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Marc Glisse from comment #4)
> We now generate for the original testcase
> 
> 	vpcmpd	$1, %zmm3, %zmm2, %k1
> 	vpcmpd	$1, %zmm1, %zmm0, %k0{%k1}
> 	vpmovm2d	%k0, %zmm0
> 
> which looks great.
> 
> However, using | instead of &, we get
> 
> 	vpcmpd	$1, %zmm1, %zmm0, %k0
> 	vpcmpd	$1, %zmm3, %zmm2, %k1
> 	kmovw	%k0, %eax
> 	kmovw	%k1, %edx
> 	orl	%edx, %eax
> 	kmovw	%eax, %k2

Yes, korw %k0, %k1, %k2 should be used
i'll take a look.

> 	vpmovm2d	%k2, %zmm0
> 
> Well, at least gimple did what it could, and it is now up to the target to
> handle logical operations on bool vectors / k* registers. There is probably
> already another bug report about that...

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

* [Bug target/70314] AVX512 not using kandw to combine comparison results
       [not found] <bug-70314-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-08-06  3:16 ` crazylht at gmail dot com
@ 2020-08-06  3:50 ` crazylht at gmail dot com
  2020-08-06  6:16 ` glisse at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: crazylht at gmail dot com @ 2020-08-06  3:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Hongtao.liu <crazylht at gmail dot com> ---
Same issue mentioned in PR88808

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

* [Bug target/70314] AVX512 not using kandw to combine comparison results
       [not found] <bug-70314-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-08-06  3:50 ` crazylht at gmail dot com
@ 2020-08-06  6:16 ` glisse at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: glisse at gcc dot gnu.org @ 2020-08-06  6:16 UTC (permalink / raw)
  To: gcc-bugs

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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> ---
Ok, there are enough duplicates for that part, this particular bug report was
mostly about the gimple part, which is fixed now. Closing.

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

end of thread, other threads:[~2020-08-06  6:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-70314-4@http.gcc.gnu.org/bugzilla/>
2020-08-05 14:47 ` [Bug target/70314] AVX512 not using kandw to combine comparison results cvs-commit at gcc dot gnu.org
2020-08-05 15:01 ` glisse at gcc dot gnu.org
2020-08-06  3:16 ` crazylht at gmail dot com
2020-08-06  3:50 ` crazylht at gmail dot com
2020-08-06  6:16 ` glisse at gcc dot gnu.org

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