RFR: 8285394: Compiler blackholes can be eliminated due to stale ciMethod::intrinsic_id() [v2]
Aleksey Shipilev
shade at openjdk.java.net
Fri Apr 22 08:02:39 UTC 2022
On Fri, 22 Apr 2022 02:20:54 GMT, Dean Long <dlong at openjdk.org> wrote:
> Wouldn't it be better to call tag_blackhole_if_possible() in Method::init_intrinsic_id()? Or is it considered an expensive operation and only the compilers (and never, say, the interpreter) would ever care about this?
Looking up `CompilerOracle` commands can be surprisingly expensive, especially with large compiler command lists. Nils optimized the lookups quite well (after all, we do a similar lookup for inline/dontinline at compilation time), but it is still not completely free. But the reason we settled to do the tagging here is that only compilers care about this intrinsic, and putting the calls to `CompilerOracle` in otherwise compiler-agnostic runtime code (`Method`) introduced the unfortunate level of cohesion.
> If it is an expensive operation, and we call it for every ciMethod, then maybe tag_blackhole_if_possible() should check for "already set" first thing.
Maybe. That looks like a minor performance optimization, which I would like to keep out of this bugfixing PR, OK? Out of curiosity, I instrumented `tag_blackhole_if_possible`, and on Spring startup we do about 70K lookups and "already set" filter can filter about 9K of them.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8344
More information about the hotspot-compiler-dev
mailing list