RFR: 8285394: Compiler blackholes can be eliminated due to stale ciMethod::intrinsic_id() [v2]

Aleksey Shipilev shade at openjdk.java.net
Thu Apr 21 17:14:03 UTC 2022


> This is seen in some tests: if blackhole method is deemed hot for inlining, then at least C2 would inline it without looking back at its intrinsic status. Which silently breaks blackholes.
> 
> The cause is that there are *two* places where intrinsic ID is recorded. Current blackhole code only writes down blackhole intrinsic ID in `Method::intrinsic_id()`, but we should also set it in `ciMethod::intrinsic_id()`, which is used from C2 inlining code. `ciMethod` is normally populated from `Method::intrinsic_id()`, but it happens too early, before setting up blackhole intrinsic. 
> 
> Additional testing:
>  - [x] Linux x86_64 {fastdebug,release}, wew test fails before the patch, passes with it
>  - [x] Linux x86_64 {fastdebug,release} `compiler/blackhole`
>  - [ ] Linux x86_64 fastdebug, sanity microbenchmark corpus run with the patch

Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:

  Negative test

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8344/files
  - new: https://git.openjdk.java.net/jdk/pull/8344/files/5a78b445..34598316

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8344&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8344&range=00-01

  Stats: 20 lines in 1 file changed: 17 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8344.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8344/head:pull/8344

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


More information about the hotspot-compiler-dev mailing list