RFR: 8296545: C2 Blackholes should allow load optimizations [v2]
Aleksey Shipilev
shade at openjdk.org
Wed Nov 9 11:59:20 UTC 2022
On Wed, 9 Nov 2022 00:43:15 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
>> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Do not touch memory at all
>
> src/hotspot/share/opto/library_call.cpp line 7790:
>
>> 7788: MemBarNode* mb = MemBarNode::make(C, Op_Blackhole);
>> 7789: mb->init_req(TypeFunc::Control, control());
>> 7790: mb->init_req(TypeFunc::Memory, mem);
>
> Does it need memory at all? In other words, is `Blackhole` still a `MemBar` or can it become a pure control node now?
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.
-------------
PR: https://git.openjdk.org/jdk/pull/11041
More information about the hotspot-compiler-dev
mailing list