RFR: 8348411: C2: Remove the control input of LoadKlassNode and LoadNKlassNode

Quan Anh Mai qamai at openjdk.org
Thu Jan 23 17:28:27 UTC 2025


Hi,

This patch removes the control input of `LoadKlassNode` and `LoadNKlassNode`. They can only have a control input if created inside `Parse::array_store_check()`, the reason given is:

    // We are allowed to use the constant type only if cast succeeded

But this seems incorrect, the load from the constant type can be done regardless, and it will be constant-folded. This patch only makes that more formal and cleanup `LoadKlassNode::can_remove_control`.

Please take a look and leave your reviews, thanks a lot.

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

Commit messages:
 - remove control input of LoadKlassNode

Changes: https://git.openjdk.org/jdk/pull/23274/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23274&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8348411
  Stats: 46 lines in 10 files changed: 5 ins; 14 del; 27 mod
  Patch: https://git.openjdk.org/jdk/pull/23274.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23274/head:pull/23274

PR: https://git.openjdk.org/jdk/pull/23274


More information about the hotspot-compiler-dev mailing list