RFR: 8020282: Generated code quality: redundant LEAs in the chained dereferences [v2]
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Fri Jun 13 09:36:36 UTC 2025
On Thu, 12 Jun 2025 14:21:35 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:
>> src/hotspot/cpu/x86/peephole_x86_64.cpp line 325:
>>
>>> 323: // Ensure the MachProj is in the same block as the decode and the lea.
>>> 324: if (proj == nullptr || !block->contains(proj)) {
>>> 325: return false;
>>
>> The only scenario in which I think this may be possible is when we stress scheduling, otherwise `RFLAGS` projections should always be scheduled immediately after their input. Consider adding an assertion like `assert(StressGCM, "should be scheduled contiguously otherwise");` or similar here.
>
> Interesting. I thought that this case would be unlikely, but did not know this. I added the assert in 0f464e1
At least that would be my expectation. If we get disproved in the future, we can see it as an opportunity to improve quality of the generated code.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25471#discussion_r2144609747
More information about the hotspot-compiler-dev
mailing list