Replacing uses of IV outside of the loop is likely generally useful,
but rewriteLoopExitValues() is cautious, and if it isn't told to always
perform the replacement, and there are hard uses of IV in loop,
it doesn't replace.
In PR44668,
that prevents -indvars from replacing uses of induction variable
after the loop, which might be one of the optimization failures
preventing that code from being vectorized.
Instead, now that the cost model is fixed, i believe we should be
a little bit more optimistic, and also perform replacement
if we believe it is within our budget.
Fixes PR44668.
Can I ask you to split this piece into it's own separate patch? The rest of NFC-ish, this really isn't.
Also, you can remove the not-constant and not-unknown cases as that's now handled by the high cost clause.