RFR: 8020282: Generated code quality: redundant LEAs in the chained dereferences [v8]
Manuel Hässig
mhaessig at openjdk.org
Wed Jun 18 17:17:50 UTC 2025
On Wed, 18 Jun 2025 16:56:37 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> src/hotspot/cpu/x86/peephole_x86_64.cpp line 359:
>>
>>> 357:
>>> 358: // Remove spill for the decode if the spill node does not have any other uses.
>>> 359: if (is_spill && decode_spill->outcnt() == 1 && block->contains(decode_spill)) {
>>
>> You can rearrange this to avoid forward declaration of `decode_spill`:
>>
>>
>> if (is_spill) {
>> MachNode* decode_spill = decode->in(1)->as_Mach();
>> If (decode_spill->outcnt() == 1 && block->contains(decode_spill)) {
>
> Or you concern that inputs of `decode` could be modified and you cached it?
Thank you for pointing this out. I was not trying to cache it. Reorganized in [da3f007](https://github.com/openjdk/jdk/pull/25471/commits/da3f007cb786b5a3efcdb155abcf73d8dbcee8af)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25471#discussion_r2155122423
More information about the hotspot-compiler-dev
mailing list