https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119577
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2025-04-02 Status|UNCONFIRMED |NEW CC| |rguenth at gcc dot gnu.org, | |tnfchris at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Well, risc-v is the only arch with that .SELECT_VL, that is, a vector length that might change between iterations. For other archs the IV increments by a (poly-)constant. But sure, it might be possible to code-generate those unused-but-live IVs as scalars: t.c:8:23: note: init: phi relevant? i_10 = PHI <i_7(8), 1(7)> t.c:8:23: note: vec_stmt_relevant_p: used out of loop. t.c:8:23: note: vec_stmt_relevant_p: induction forced for early break. t.c:8:23: note: vec_stmt_relevant_p: stmt live but not relevant. IIRC it depends on the "kind" of early break whether we need the first IV (scalar IV possible) or the last, but I don't rememeber exactly.