RFR: 8315843: C1: Use MDO offsets as int consts instead of intptr consts

Aleksey Shipilev shade at openjdk.org
Thu Sep 7 09:25:38 UTC 2023


On Thu, 7 Sep 2023 09:12:48 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

> How about hiding `Assembler::mov64` in `MacroAssembler` with a method that conditionally uses equivalent instructions (`movl`, `movq`) if feasible. I remember there are some places in C2 where we use `mov64(r, -1)` which may be benefit from this, too.

Could be done.

But this thing looks better, because it does improvement on LIR level, which allows all arches to benefit from shorter constants. In other words, it is better to feed LIR assemblers with smaller constants to begin with, instead of relying on LIR assemblers to optimize for us. (Having said that, I have a separate improvement for AArch64 to use "non-patchable" shorter `movk` sequences for these loads.)

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

PR Comment: https://git.openjdk.org/jdk/pull/15612#issuecomment-1709799828


More information about the hotspot-compiler-dev mailing list