Jump to Jump Replacement: The return statement inside the if block contributes to a jump to jump replacement.
_L2 has a jump to main_Exit immediately. Can be replaced with just main_Exit thus eliminating _L2.
Some examples of loops for which the compiler can be sure that the loop will execute at least once:
do { < statements > while (<condition>)
x = 0; while (x < 10) { ... }
As illustrated immediately below this question, a Java compiler doesn't have to give up on this optimization. A for-loop that uses literals as the low and high bounds, use i++ (where i is the loop-index variable) as the increment, and doesn't assign to i inside the loop is a perfect candidate.
Strength reduction can still be done if the loop-index variable is incremented by any constant amount. The only change is to change