As PR45360 reports,
with new cost-model we can sometimes end up being able to expand udiv/urem instructions.
And that exposes at least one instance of when we do that
regardless of whether or not it is safe to do.
In this particular case, it's SimplifyIndvar::replaceIVUserWithLoopInvariant().
It seems to me, we simply need to check with isSafeToExpandAt() first.
The test isn't great. I'm not sure how to make it only run -indvars.
Fixes PR45360.
This comment doesn't reflect what this method does, can you pls also fix it along, like, "Replace the UseInst with a loop invariant expression if it is safe"?