RFR: 8277324: C2 compilation fails with "bad AD file" on x86-32 after JDK-8276162 due to missing match rule

Christian Hagedorn chagedorn at openjdk.java.net
Wed Nov 17 11:19:34 UTC 2021


On Wed, 17 Nov 2021 09:25:26 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

> [JDK-8276162](https://bugs.openjdk.java.net/browse/JDK-8276162) introduced an optimization that creates `CMoveI (Bool (CmpUL ...) ...)` shapes but x86-32 misses the corresponding match rules in C2's backend.
> 
> I also fixed two comments incorrectly referring to ints instead of ptrs.
> 
> Thanks,
> Tobias

Otherwise, the fix looks good!

src/hotspot/cpu/x86/x86_32.ad line 13160:

> 13158:   opcode(0x0F,0x40);
> 13159:   ins_encode( enc_cmov(cmp), RegReg( dst, src ) );
> 13160:   ins_pipe( pipe_cmov_reg );

Since this code is shared with `cmovII_reg_LTGE`, we could directly use it with `expand`:

  expand %{
    cmovII_reg_LTGE(cmp, flags, dst, src);
  %}

Could also be done for the other cases.

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

Marked as reviewed by chagedorn (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/6427


More information about the hotspot-compiler-dev mailing list