https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126035
Drea Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot
gnu.org
Status|NEW |ASSIGNED
--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
I am going to implement this.
A simple match pattern is not going to work because we have more than 1 stmt in
the each side of the branch.
Until we expand phiopt to work on that, we need a manual matching in phiopt.
For stuff like this:
```
lo_5 = (uint32_t) val_3(D);
if (lo_5 != 0)
goto <bb 3>; [50.00%]
else
goto <bb 4>; [50.00%]
<bb 3> [local count: 536870912]:
_7 = __builtin_ctz (lo_5);
_9 = (unsigned int) _7;
goto <bb 5>; [100.00%]
<bb 4> [local count: 536870912]:
_1 = val_3(D) >> 32;
hi_4 = (uint32_t) _1;
_10 = __builtin_ctz (hi_4);
_11 = (unsigned int) _10;
_8 = _11 + 32;
<bb 5> [local count: 1073741824]:
# _2 = PHI <_8(4), _9(3)>
```
For both CLZ and CTZ.