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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu.org

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So one missing phiopt issue is we have:
```
  _45 = MEM[(const struct _Optional_base *)&__for_begin +
8B]._M_payload.D.74297._M_engaged;
  if (_45 != 0)
    goto <bb 5>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 4> [local count: 66504994]:
  MEM[(struct _Optional_payload_base *)&__for_begin + 8B]._M_engaged = 1;

  <bb 5> [local count: 133009989]:
```

That should just be:
MEM[(struct _Optional_payload_base *)&__for_begin + 8B]._M_engaged = 1;


phiopt does a simplified version of cselim where the store is to both middle
bb.
Maybe it can do a slightly modified version of cselim for the partial defined
case where the decl does not have its address taken. 

Note the _M_engaged parts seems to be what is causing most of the issues with
the overhead I think.

Reply via email to