public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/109046] New: 13 regresion caused by complex lower.
Date: Tue, 07 Mar 2023 05:40:10 +0000	[thread overview]
Message-ID: <bug-109046-4@http.gcc.gnu.org/bugzilla/> (raw)

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>;

             reply	other threads:[~2023-03-07  5:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07  5:40 crazylht at gmail dot com [this message]
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

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-109046-4@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).