On Thu, 10 Oct 2024 22:42:19 GMT, Bernd <d...@openjdk.org> wrote: > > I have slightly adapted the copy loop to allow CPUs to use solely > > single-operand INC within the loop instead of dual-operand ADD. > > If that makes a difference we might need to consider fixing the Compiler :)
Hm... really? In fact I am not sure if the compiler is actually able to optimize replacement from ADD to INC *in this particular* scenario: The operand of the ADD is *neither* a constant and in particular *not* `1`, the upper limit of the loop is *not* a constant, and is typically far beyond any reasonable unrolling limit (readers rather often are asked for multiple KB here to optimize I/O transmissions). This is not just `for (int i = 0; i < 5; i++;)` (always same limit, reasonably low limit, using INC only). Anyways, if you can proof me wrong I am willing to learn (and to undo this commit)! :-) ------------- PR Comment: https://git.openjdk.org/jdk/pull/21371#issuecomment-2406625958