public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/101612] New: _Complex float multiply expansion does not allow for a tail call to __mulsc3
@ 2021-07-24  8:48 pinskia at gcc dot gnu.org
  2021-07-27 10:47 ` [Bug tree-optimization/101612] " rguenth at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-24  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101612
           Summary: _Complex float multiply expansion does not allow for a
                    tail call to __mulsc3
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
_Complex float f(_Complex float x, _Complex float y) {
  return x*y;
}
----- CUT -----
At -O2, we produce during complex lowering:
  if (_13 unord _14)
    goto <bb 4>; [0.05%]
  else
    goto <bb 3>; [99.95%]

  <bb 4> [local count: 536864]:
  _15 = __mulsc3 (x$real_5, x$imag_6, y$real_7, y$imag_8);
  _16 = REALPART_EXPR <_15>;
  _17 = IMAGPART_EXPR <_15>;
  GIMPLE_NOP

  <bb 3> [local count: 1073741824]:
  # _18 = PHI <_13(2), _16(4)>
  # _19 = PHI <_14(2), _17(4)>
  _3 = COMPLEX_EXPR <_18, _19>;

This does allow __mulsc3 to be tailed call as the tail call coding does not
know anything about COMPLEX_EXPR and REAL/IMAGPART_EXPR.

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

* [Bug tree-optimization/101612] _Complex float multiply expansion does not allow for a tail call to __mulsc3
  2021-07-24  8:48 [Bug tree-optimization/101612] New: _Complex float multiply expansion does not allow for a tail call to __mulsc3 pinskia at gcc dot gnu.org
@ 2021-07-27 10:47 ` rguenth at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-27 10:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm, looks like missed PRE of the COMPLEX_EXPR to me.

simplifying {complex_expr,_18,_19} translated 4 -> 3 to {complex_expr,_16,_17}
to _15

Starting insert iteration 1
Skipping partial redundancy for expression {complex_expr,_18,_19} (0003), no
redundancy on to be optimized for speed edge

indeed there's no redundancy on the speed edge and we'd end up splitting the
edge for the insertion on the speed edge.

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

end of thread, other threads:[~2021-07-27 10:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-24  8:48 [Bug tree-optimization/101612] New: _Complex float multiply expansion does not allow for a tail call to __mulsc3 pinskia at gcc dot gnu.org
2021-07-27 10:47 ` [Bug tree-optimization/101612] " 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).