RFR: 8312213: Remove unnecessary TEST instructions on x86 when flags reg will already be set [v6]
Jorn Vernee
jvernee at openjdk.org
Mon Sep 4 10:46:48 UTC 2023
On Fri, 1 Sep 2023 10:21:21 GMT, Tobias Hotz <duke at openjdk.org> wrote:
> Sorry for the long delay. I am not quite sure why there is so much deviation in the benchmark results and why release seems to be much slower than fastdebug. But I've double-checked, and C++ compilers like clang also do not emit test instructions after instructions that already set the appropiate registers (See https://godbolt.org/z/n1K1v5YT9). That being said, it is mostly a size-releated optimization on newer machines, but as the benchmarks show a slight increase in performance in the average case. So IMO this is still a good optimization to implement.
Okay, let's take the size win then.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14172#issuecomment-1705036181
More information about the hotspot-compiler-dev
mailing list