public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/102819] New: [11/12 Regression] IFN_COMPLEX_MUL matches things that it shouldn't
@ 2021-10-18 18:34 rsandifo at gcc dot gnu.org
  2021-10-18 20:05 ` [Bug tree-optimization/102819] " tnfchris at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2021-10-18 18:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

end of thread, other threads:[~2022-02-25 12:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 18:34 [Bug tree-optimization/102819] New: [11/12 Regression] IFN_COMPLEX_MUL matches things that it shouldn't rsandifo at gcc dot gnu.org
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

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