I am working on optimization methods performed by the .NET Native compiler. I created a sample loop:
for (int i = 0; i < 100; i++) { Function(); }
And I compiled it with Native. Then I .dll result file with machine code inside the IDA. As a result, I have:

(I deleted some unnecessary lines, so don't worry that the address lines are inconsistent)
I understand that add esi, 0FFFFFFFFh really means subtract one from esi and alter Zero Flag if needed , so we can go to the beginning if zero has not yet been reached.
What I donβt understand is why the compiler reversed the loop?
I came to the conclusion that
LOOP: add esi, 0FFFFFFFFh jnz LOOP
just faster than for example
LOOP: inc esi cmp esi, 064h jl LOOP
But is this really because of this, and is the speed difference really significant?
source share