[Bug tree-optimization/100391] 128 bit arithmetic --- many unnecessary instructions when extracting smaller parts

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 3 18:49:36 GMT 2021


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
          Component|target                      |tree-optimization
   Last reconfirmed|                            |2021-05-03
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.  There is a missed optimization at the tree level in the first
place.
The cast to uint32_t is not prograded back through the PHI node.
  _1 = kt_4 >> 60;
  if (_1 != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  kt_5 = kt_4 & 1152921504606846975;

  <bb 4> [local count: 1073741824]:
  # kt_2 = PHI <kt_4(2), kt_5(3)>
  _6 = (uint32_t) kt_2;


If it was then the above would have became just:
_6 = (uint32_t) kt_4;


More information about the Gcc-bugs mailing list