[lworld] RFR: 8275824: [lworld] C2 generates unused code (klass ptr check) when oop value of scalarized return is not used

Tobias Hartmann thartmann at openjdk.java.net
Mon Oct 25 12:35:29 UTC 2021


When an inline type is returned as fields in registers, one register (`rax` on x86) either contains an oop if the inline type is buffered or a pointer to the corresponding `InlineKlass` with the lowest bit set to 1 (used by the interpreter and C1 to buffer). To use the oop, C2 emits code to zero that register if the lowest bit is set after a call. However, that code should not be emitted if the oop is never used.

Thanks to @kuksenko for reporting!

Best regards,
Tobias

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

Commit messages:
 - 8275824: [lworld] C2 generates unused code (klass ptr check) when oop value of scalarized return is not used

Changes: https://git.openjdk.java.net/valhalla/pull/570/files
 Webrev: https://webrevs.openjdk.java.net/?repo=valhalla&pr=570&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8275824
  Stats: 7 lines in 4 files changed: 0 ins; 4 del; 3 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/570.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/570/head:pull/570

PR: https://git.openjdk.java.net/valhalla/pull/570



More information about the valhalla-dev mailing list