RFR: 8344251: C2: remove blackholes with dead control input [v2]

Marc Chevalier mchevalier at openjdk.org
Wed Apr 16 06:29:25 UTC 2025


> When a BlackholeNode's control input becomes dead, the node is not removed causing the crash
> 
>  assert(!in->is_CFG()) failed: CFG Node with no controlling input?
> 
> In the case reported in the issue, after a round of peeling, a condition becomes constant, and the branch containing the blackhole becomes dead:
> 
> <img src="https://github.com/user-attachments/assets/f8e5ec85-ddf5-4018-a01e-30ea90d9d74f" width="400">
> <img src="https://github.com/user-attachments/assets/626e40a1-be2f-4b1c-bc56-9760a26660f2" width="400">
> 
> I simply use `Node::remove_dead_region(PhaseGVN*, bool)` to remove the blackhole, as many other node types do.

Marc Chevalier has updated the pull request incrementally with two additional commits since the last revision:

 - Using PerMethod(Spec)?TrapLimit
 - Address review comments

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24663/files
  - new: https://git.openjdk.org/jdk/pull/24663/files/a71abe7d..487b1a64

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24663&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24663&range=00-01

  Stats: 6 lines in 2 files changed: 5 ins; 1 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/24663.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24663/head:pull/24663

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


More information about the hotspot-compiler-dev mailing list