public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/109046] New: 13 regresion caused by complex lower.
@ 2023-03-07  5:40 crazylht at gmail dot com
  2023-03-07  9:14 ` [Bug tree-optimization/109046] [13 Regresion] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: crazylht at gmail dot com @ 2023-03-07  5:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109046
           Summary: 13 regresion caused by complex lower.
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
  Target Milestone: ---

commit f9d4c3b45c5ed5f45c8089c990dbd4e181929c3d
Author: liuhongt <hongtao.liu@intel.com>
Date:   Tue Jul 19 17:24:52 2022 +0800

    Lower complex type move to enable vectorization for complex type
load&store.

    2022-07-20  Richard Biener  <richard.guenther@gmail.com>
                Hongtao Liu  <hongtao.liu@intel.com>

    gcc/ChangeLog:

            PR tree-optimization/106010
            * tree-complex.cc (init_dont_simulate_again): Lower complex
            type move.
            (expand_complex_move): Also expand COMPLEX_CST for rhs.


My r13-1762-gf9d4c3b45c5ed5 lower complex type for load&store but somehow
caused a regression in phoronix benchmark

#include <complex.h>

extern void push1(void *p, float _Complex x);

void foo(void * _q, float _Complex * _x)
{
    push1(_q, *_x);
}


foo(void*, float _Complex*):
        vmovss  4(%rsi), %xmm0
        vmovss  (%rsi), %xmm1
        vmovss  %xmm0, -12(%rsp)
        vmovss  %xmm1, -16(%rsp)
        vmovq   -16(%rsp), %xmm0
        jmp     push1(void*, float _Complex)

gcc12 generates

foo(void*, float _Complex*):
        vmovq   (%rsi), %xmm0
        jmp     push1(void*, float _Complex)

Since complex lower is only for vectorization, maybe it should be gimplified
back to a complex load after vectorization if there're things like

  _6 = REALPART_EXPR <*_x_3(D)>;
  _7 = IMAGPART_EXPR <*_x_3(D)>;
  _1 = COMPLEX_EXPR <_6, _7>;

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

* [Bug tree-optimization/109046] [13 Regresion] caused by complex lower.
  2023-03-07  5:40 [Bug tree-optimization/109046] New: 13 regresion caused by complex lower crazylht at gmail dot com
@ 2023-03-07  9:14 ` rguenth at gcc dot gnu.org
  2023-03-13  8:49 ` cvs-commit at gcc dot gnu.org
  2023-03-13  8:49 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-07  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Target Milestone|---                         |13.0
     Ever confirmed|0                           |1
            Summary|13 regresion caused by      |[13 Regresion] caused by
                   |complex lower.              |complex lower.
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
   Last reconfirmed|                            |2023-03-07

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I have a patch.

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

* [Bug tree-optimization/109046] [13 Regresion] caused by complex lower.
  2023-03-07  5:40 [Bug tree-optimization/109046] New: 13 regresion caused by complex lower crazylht at gmail dot com
  2023-03-07  9:14 ` [Bug tree-optimization/109046] [13 Regresion] " rguenth at gcc dot gnu.org
@ 2023-03-13  8:49 ` cvs-commit at gcc dot gnu.org
  2023-03-13  8:49 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-13  8:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:eb337d28c32b1b460cc85b3c00f8418ca535c77b

commit r13-6624-geb337d28c32b1b460cc85b3c00f8418ca535c77b
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Mar 7 11:04:55 2023 +0100

    tree-optimization/109046 - re-combine complex loads

    The following addresses PR109046 by adding an optimization to forwprop
    to combine a piecewise complex load to a complex load when there are
    no other uses of the components.  That's something useful in general and
    easier to do than avoiding the splitting in complex lowering.

    The testcase exercises both the manual and the complex lowering case.

            PR tree-optimization/109046
            * tree-ssa-forwprop.cc (pass_forwprop::execute): Combine
            piecewise complex loads.

            * gcc.dg/tree-ssa/forwprop-39.c: New testcase.

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

* [Bug tree-optimization/109046] [13 Regresion] caused by complex lower.
  2023-03-07  5:40 [Bug tree-optimization/109046] New: 13 regresion caused by complex lower crazylht at gmail dot com
  2023-03-07  9:14 ` [Bug tree-optimization/109046] [13 Regresion] " rguenth at gcc dot gnu.org
  2023-03-13  8:49 ` cvs-commit at gcc dot gnu.org
@ 2023-03-13  8:49 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-13  8:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-03-13  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07  5:40 [Bug tree-optimization/109046] New: 13 regresion caused by complex lower crazylht at gmail dot com
2023-03-07  9:14 ` [Bug tree-optimization/109046] [13 Regresion] " rguenth at gcc dot gnu.org
2023-03-13  8:49 ` cvs-commit at gcc dot gnu.org
2023-03-13  8:49 ` rguenth 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).