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

Aleksey Shipilev shade at openjdk.org
Wed Nov 9 14:36:22 UTC 2022


On Wed, 9 Nov 2022 13:50:37 GMT, Andrew Dinn <adinn at openjdk.org> wrote:

>> That's a good question. I don't think it needs memory. I disconnected the input memory in new commit as well, and all tests seem fine. This also allows to simplify anti-dependence logic, as `Blackhole` does not have the asymmetry of "takes memory, but does not produce it" anymore.
>> 
>> AFAICS, `Blackhole` being a subclass of `MemBar` helps to avoid additional checks in other places in compiler, where we can test for `is_MemBar`. I can see if we can move `Blackhole` out of `MemBar` class without messing things up.
>
> Yeah, I also cannot see why it would need the memory input so long as it has the data dependency.
> 
> The key question is whether it's status as a membar is stopping things being re-ordered around it. Changing it's type might immediately show a problem ... or it might not (the problem with a 'suck it and see' approach is that you need to be sure you have sucked every type of sweetie in the sweet tin).

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.

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

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


More information about the hotspot-compiler-dev mailing list