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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> But cselim does not know how to handle the {} I think.

Yes it does not. Part of cselim can be fixed easily and I filed PR 122153 for
that and I have a patch for that.

As far as the other part; I am going to change how cselim-limited and cselim
work for the trailing-store case instead of just a single store we can look at
the final trailing store and then do that for cselim-limited we can loop until
we don't find any; similar to how factor out operation works. I have to think
if we need a cost model or not still.
But once we do that we should be able to get to phiopt1:

```
  if (c$_M_value_21 == 1)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  goto <bb 8>; [INV]

  <bb 7> :

  <bb 8> :
  _9 = PHI<x_3(D)(7), y_5(D)(6)>
  _10 = PHI<c$_M_value_21(7), 1(6)>
  MEM <char[8]> [(struct Res *)&D.8662 + 8B] = {};
  D.8662.M_min = _9;
  D.8662.M_cmp._M_value = _10;
```
Which should be a better cost and then early inlining should happen.

Reply via email to