Currently, -indvars runs first, and then immediately after -loop-idiom does.
I'm not really sure if -loop-idiom requires -indvars to run beforehand,
but i'm *very* sure that -indvars requires -loop-idiom to run afterwards,
as it can be seen in the phase-ordering test.
LoopIdiom runs on two types of loops: countable ones, and uncountable ones.
For uncountable ones, IndVars obviously didn't make any change to them,
since they are uncountable, so for them the order should be irrelevant.
For countable ones, well, they should have been countable before IndVars
for IndVars to make any change to them, and since SCEV is used on them,
it shouldn't matter if IndVars have already canonicalized them.
So i don't really see why we'd want the current ordering.
While this is quite likely beneficial in-the-wild already,
it's a required part for the full motivational pattern
behind left-shift-until-bittest loop idiom (D91038).