public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rsandifo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/102819] New: [11/12 Regression] IFN_COMPLEX_MUL matches things that it shouldn't
Date: Mon, 18 Oct 2021 18:34:09 +0000	[thread overview]
Message-ID: <bug-102819-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 102819
           Summary: [11/12 Regression] IFN_COMPLEX_MUL matches things that
                    it shouldn't
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
                CC: tnfchris at gcc dot gnu.org
  Target Milestone: ---

Created attachment 51625
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51625&action=edit
Examples of correct and incorrect matches

complex_mul_pattern::matches() seems to accept too much.  IIUC,
for the non-conjugate case, it matches if:

* the root is an interleaving of a SUB node and an ADD node
* the children of the ADD node are two multiplications
* the left-hand multiplication includes an EVEN/EVEN permute
  (i.e. multiplication by real)

However, for the non-conjugate case, there don't seem to be any
checks for the contents of the right-hand multiplication or how
they match up with the left-hand multiplication.  The later code
then drops one child of this right-hand node.

(If we don't currently check that the SUB node has the same children
as the ADD node then perhaps we should check that too.  Now that we
have general VEC_PERM_EXPR nodes, the children could in principle be
different.)

With -O3 -march=armv8.2-a+sve, all of the functions in the attached
test are recognised as complex multiplications, even though only
good1 and good2 really are.  There are quite a few other cases
in which we incorrectly match a COMPLEX_MUL but then bail out
due to:

  Built SLP cancelled: all SLP instances support load/store-lanes

(Perhaps we should have a --param to disable that load/store-lanes
check?)

             reply	other threads:[~2021-10-18 18:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 18:34 rsandifo at gcc dot gnu.org [this message]
2021-10-18 20:05 ` [Bug tree-optimization/102819] " tnfchris at gcc dot gnu.org
2021-10-19  7:42 ` rguenth at gcc dot gnu.org
2022-02-02 10:54 ` cvs-commit at gcc dot gnu.org
2022-02-02 10:54 ` cvs-commit at gcc dot gnu.org
2022-02-02 10:54 ` cvs-commit at gcc dot gnu.org
2022-02-02 10:57 ` [Bug tree-optimization/102819] [11 " tnfchris at gcc dot gnu.org
2022-02-25 12:13 ` cvs-commit at gcc dot gnu.org
2022-02-25 12:13 ` cvs-commit at gcc dot gnu.org
2022-02-25 12:13 ` cvs-commit at gcc dot gnu.org
2022-02-25 12:14 ` tnfchris 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-102819-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).