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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|zero extend not moved out   |zero extend not sunk out of
                   |of the loop after IV-OPTS   |the loop after IV-OPTS in
                   |                            |the sink pass

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note there's pass_sink_code after IVOPTs which is what is designed to perform
sinking.  That is probably confused by seeing

  <bb 5> [local count: 1014686026]:
  # ivtmp.7_15 = PHI <ivtmp.7_7(7), 2(3)>
  _4 = (unsigned int) ivtmp.7_15;
  _3 = MEM[(const uint8_t *)buf_9(D) + ivtmp.7_15 * 1];
  _6 = MEM[(const uint8_t *)buf_back_11(D) + ivtmp.7_15 * 1];
  if (_3 == _6)
    goto <bb 4>; [94.50%]
  else
    goto <bb 10>; [5.50%]

  <bb 10> [local count: 55807731]:

  <bb 6> [local count: 114863531]:
  # len_test_14 = PHI <len_test_12(9), _4(10), 2(8)>
  return len_test_14;

where it doesn't consider inserting on edges because usually the pred works
fine but here it's a no-op sink and splitting the edge might be profitable
because its a loop exit.

So the sinking pass needs tweaking for such case (but _not_ split the edge
in case the PHI use is on a simple merge)

Reply via email to