https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119577
Tamar Christina <tnfchris at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |53947, 115130 --- Comment #5 from Tamar Christina <tnfchris at gcc dot gnu.org> --- > There is precedent of re-using a scalar IV with the > in-order (fold-left) reduction vectorization which keeps the scalar > reduction IV. I'm doing work in this area now, and was gonna take a look. My current thinking is that when we encounter an induction that needs to be forced live that I mark is as having been forced live by early break. This can then later based on costing be determined to stay a vector or a new scalar IV. This in particular helps in the case of the example loop because we don't need `i` at all. demoting it back to a scalar IV will also deal with the IV-cannon issue we are having due to the vector IVs. If we have to force the IV live due to early break it means the IV wasn't used inside the loop, so we're free to make a choice. So, mine unless you already did work here Robin? Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947 [Bug 53947] [meta-bug] vectorizer missed-optimizations https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115130 [Bug 115130] [meta-bug] early break vectorization