Closed tkoenig1 closed 1 year ago
Truth be told, this looks like a missed optimization of clang generally. Godbolt gives the code for ARM64 as
foo(int, int): # @foo(int, int)
add a0, a0, a1
addiw a0, a0, -1
ret
gcc does not catch this either.
Argh, too late in the evening. The code I posted is wrong, of course :-)
I am having to reach a bit to find missed optimizations in embench-iot, but here's an interesting one, reduced from libpicojpg. Other architectures do not do this.
This could be just