CanBeMin is currently used which will report true for any unknown values, but often a check is performed outside the loop which covers this situation:
for (int i = 0; i < N; ++i) ... if (N > 0) for (int i = 0; i < N; ++i) ...
So I've add 'LoopGuardedAgainstMin' which reports whether the loop is guarded by a greater than the minimum check, which then allows loop with a variable count to be optimised. And also enable SGT to be converted to UGT, which has lead me to change one of the tests. Another one of the existing tests has been changed because I believe that the range metadata was preventing the test from performing as desired.
I think I got what this function does, but do you mind adding an explanatory comment since it is not completely trivial?