LoopVectorize: guard marking iv as scalar; fix bug (#88730)

When collecting loop scalars, LoopVectorize over-eagerly marks the
induction variable and its update as scalars after vectorization, even
if the induction variable update is a first-order recurrence. Guard the
process with this check, fixing a crash.

Fixes #72969.

GitOrigin-RevId: 73e7f2ff70e64defcc59f707a8d2463dd4c79be0
2 files changed