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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-01-17
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
We cannot analyze the evolution of 'n', so it's computation prevails inside the
loop.

  <bb 3> [local count: 1063004408]:
  # i_18 = PHI <i_15(5), 0(2)>
  # n_lsm.10_20 = PHI <_7(5), n_lsm.10_17(2)>
  # a_lsm.12_9 = PHI <_4(5), a_lsm.12_22(2)>
  # b_lsm.13_8 = PHI <_6(5), b_lsm.13_23(2)>
  _4 = w.2_3 + a_lsm.12_9;
  _6 = b_lsm.13_8 - w.2_3;
  _7 = b_lsm.13_8 + a_lsm.12_9;
  i_15 = i_18 + 1;
  if (i_15 != 100)
    goto <bb 5>; [98.99%]
  else
    goto <bb 4>; [1.01%]

  <bb 5> [local count: 1052266995]:
  goto <bb 3>; [100.00%]

  <bb 4> [local count: 10737416]:
  # n_lsm.10_21 = PHI <n_lsm.10_20(3)>


(analyze_scalar_evolution
  (loop_nb = 1)
  (scalar = _7)
(get_scalar_evolution
  (scalar = _7)
  (scalar_evolution = a_lsm.12_22 + b_lsm.13_23))
) 
(instantiate_scev
  (instantiate_below = 2 -> 3)
  (evolution_loop = 1)
  (chrec = a_lsm.12_22 + b_lsm.13_23)
  (res = a_lsm.12_22 + b_lsm.13_23))
  (evolution_function = scev_not_known))

that's a bit odd (a_lsm.12_22 + b_lsm.13_23 is invariant).

Reply via email to