public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95084] New: code sinking prevents if-conversion
@ 2020-05-12 13:46 rguenth at gcc dot gnu.org
  2022-01-31 15:24 ` [Bug tree-optimization/95084] [11/12 Regression] " rsandifo at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-12 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95084
           Summary: code sinking prevents if-conversion
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

There's a pass ordering issue between the sink pass and tree-if-conv, if
conversion for vectorization.  When sink sinks a possibly trapping operation
to a place that is only conditionally executed if-conversion fails which
results in failed vectorization.  This can be seen with
https://gcc.gnu.org/pipermail/gcc-patches/2020-May/545588.html applied
for gcc.dg/vect/pr56541.c (and it's ifcvt counterpart
gcc.dg/tree-ssa/ifc-pr56541.c).  But I've also seen this in other context.

Here

  iftmp.2_17 = rR_19 < rL_20 ? rR_19 : rL_20;
  iftmp.3_3 = rR_19 < rL_20 ? rL_20 : rR_19;
  if (iftmp.3_3 > 0.0)
    goto <bb 5>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :

  <bb 5> :
  # iftmp.4_14 = PHI <iftmp.2_17(3), 1.5e+2(4)>
  if (iftmp.4_14 > 0.0)

becomes

  iftmp.3_3 = rR_17 < rL_18 ? rL_18 : rR_17;
  if (iftmp.3_3 > 0.0)
    goto <bb 4>; [59.00%]
  else
    goto <bb 9>; [41.00%]

  <bb 9> [local count: 435831803]:
  goto <bb 6>; [100.00%]

  <bb 4> [local count: 627172605]:
  iftmp.2_15 = rR_17 < rL_18 ? rR_17 : rL_18;
  if (iftmp.2_15 > 0.0)

and the now conditionally executed FP comparison can trap.

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

end of thread, other threads:[~2023-08-04 17:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 13:46 [Bug tree-optimization/95084] New: code sinking prevents if-conversion rguenth at gcc dot gnu.org
2022-01-31 15:24 ` [Bug tree-optimization/95084] [11/12 Regression] " rsandifo at gcc dot gnu.org
2022-01-31 21:02 ` pinskia at gcc dot gnu.org
2022-02-01  7:31 ` rguenth at gcc dot gnu.org
2022-04-21  7:47 ` rguenth at gcc dot gnu.org
2022-07-06 21:17 ` [Bug tree-optimization/95084] [11/12/13 " pinskia at gcc dot gnu.org
2023-05-29 10:02 ` [Bug tree-optimization/95084] [11/12/13/14 " jakub at gcc dot gnu.org
2023-08-04 17:26 ` pinskia 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).