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

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