[Bug lto/65950] Loop is not vectorized with lto.

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 24 00:26:00 GMT 2015


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-12-24
     Ever confirmed|0                           |1

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

Right before the vectorizer:

Without LTO:
  <bb 6>:
  # k_36 = PHI <K_9(5), k_28(7)>
  # ivtmp_88 = PHI <16(5), ivtmp_40(7)>
  _11 = (long unsigned int) k_36;
  _12 = _11 * 4;
  _14 = v_13(D) + _12;
  _15 = *_14;
  _16 = k_36 + -1;
  _17 = (float) _16;
  _23 = pretmp_83 + _12;
  _24 = *_23;
  _25 = _17 * _24;
  _26 = _15 + _25;
  *_14 = _26;
  k_28 = k_36 + 1;
  ivtmp_40 = ivtmp_88 - 1;
  if (ivtmp_40 != 0)
    goto <bb 7>;
  else
    goto <bb 8>;

  <bb 7>:
  goto <bb 6>;


With LTO:

  <bb 4>:
  _11 = (long unsigned int) k_2;
  _12 = _11 * 4;
  _14 = v_13(D) + _12;
  _15 = *_14;
  _16 = k_2 + -1;
  _17 = (float) _16;
  _22 = *_21;
  _23 = _22 + _12;
  _24 = *_23;
  _25 = _17 * _24;
  _26 = _15 + _25;
  *_14 = _26;
  k_28 = k_2 + 1;

  <bb 5>:
  # k_2 = PHI <K_9(3), k_28(4)>
  # ivtmp_36 = PHI <17(3), ivtmp_35(4)>
  _10 = K_9 + 16;
  ivtmp_35 = ivtmp_36 - 1;
  if (ivtmp_35 != 0)
    goto <bb 4>;
  else
    goto <bb 6>;

Notice the difference in the CFG.


More information about the Gcc-bugs mailing list