RFR: 8296545: C2 Blackholes should allow load optimizations [v2]

Aleksey Shipilev shade at openjdk.org
Thu Nov 10 15:25:28 UTC 2022


On Wed, 9 Nov 2022 20:27:00 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> I whipped up this patch that pulls `Blackhole` from `MemBarNode` to be the more generic `MultiNode` (can probably even be `Node`, if I understand how should control-output-only nodes be defined): https://cr.openjdk.java.net/~shade/8296545/blackhole-cfg-1.patch -- it seems to "work fine" on adhoc tests. But, I am still a bit uneasy to unhook blackhole from membar, on the off-chance it matters in some non-obvious way.
>
>> can probably even be Node, if I understand how should control-output-only nodes be defined
> 
> Yes, `MultiNode` is specifically for cases when a node produces multiple results. 
> 
> FTR I looked through the code base for `is_MemBar` usages and didn't spot any problematic cases, if you clear away memory input. But I'm fine with keeping it a membar.

Well, I don't see how I can make `Blackhole` produce only control. It seems the rest of C2 code frowns upon CFG nodes that are not control projections (or safepoints), see e.g. `is_control_proj_or_safepoint` asserts. Any hints how to proceed here? Maybe an example for such CFG node somewhere?

Otherwise, I'd think keeping Blackhole a `MultiNode` and then take the control projection off it -- like in my `blackhole-cfg-1.patch` above -- is the way to do it.

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

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


More information about the hotspot-compiler-dev mailing list