RFR: 8309978: [x64] Fix useless padding [v2]

Vladimir Kozlov kvn at openjdk.org
Wed Jun 14 20:27:00 UTC 2023


On Wed, 14 Jun 2023 16:40:00 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Fixed typo in `IntelJccErratum::compute_padding()`.
>> 
>> Due to the typo (`mach` instead of `next`) useless padding could be generated because size of `mach` instruction (which is `cmp` in this case and big)  counted twice. As result combined size most likely cross 32-bytes cache line boundary and padding is generated to avoid that.
>> 
>> 
>> 030    B2: # out( B4 B3 ) <- in( B1 ) Freq: 0.999999 
>>        nop # 16 bytes pad for loops and calls 
>> 040    cmpb [R12 + R10 << 3 + #144] (compressed oop addressing), #42 
>> 049    jle,s B4 P=0.667944 C=6785.000000
>> 
>> Note: only some x86 CPUs are [affected](https://github.com/openjdk/jdk/blob/ba837b4bfa2dea85653d8a8fccd0817a569b4378/src/hotspot/cpu/x86/vm_version_x86.cpp#L1957).
>> 
>> For new IR test to work I moved `PHASE_FINAL_CODE` IR print inside `PhaseOutput` scope because padding nodes (`NOP` mach nodes) are present only in this phase IR.
>> 
>> Added new IR test. Tested tier1-3, xcomp, stress.
>
> Vladimir Kozlov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address Christian comments

`StressStackOverflow.java` test failure in GHA on 32-bit x86 I saw in other new PRs too.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14461#issuecomment-1591926267


More information about the hotspot-compiler-dev mailing list