RFR: 8296545: C2 Blackholes should allow load optimizations [v2]
Vladimir Ivanov
vlivanov at openjdk.org
Fri Nov 11 00:47:31 UTC 2022
On Thu, 10 Nov 2022 10:42:30 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> src/hotspot/share/opto/library_call.cpp line 7784:
>>
>>> 7782: // side effects like breaking the optimizations across the blackhole.
>>> 7783:
>>> 7784: MemBarNode* mb = MemBarNode::make(C, Op_Blackhole);
>>
>> One thing to clear if you decide to keep modeling it as `MemBar`: pass `AliasIdxTop` as `alias_idx` .
>
> OK, I need to understand why, though. Does passing `AliasIdxTop` sentinel value here protects us from accidentally doing memory merges over the Blackhole node that does not touch memory? Is that the idea, or there is some other reason for it?
I'm not sure whether it causes any problems or not (since the node is completely disconnected from the memory graph), but it is just weird to have a memory node consuming `TOP` and reporting `TypePtr::BOTTOM` as `adr_type` (which alias with everything). I won't be surprised if it eventually breaks somewhere in `MemBar`-specific code.
-------------
PR: https://git.openjdk.org/jdk/pull/11041
More information about the hotspot-compiler-dev
mailing list