RFR: 8320649: C2: Optimize scoped values [v4]
Roland Westrelin
roland at openjdk.org
Tue Jan 30 16:17:00 UTC 2024
On Thu, 18 Jan 2024 10:40:46 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:
>>
>> merge fix
>
> src/hotspot/share/opto/loopnode.cpp line 4767:
>
>> 4765: Node* second_index = get_from_cache->index2();
>> 4766:
>> 4767: if (first_index == C->top() && second_index == C->top()) {
>
> could this not be done during igvn?
What happens here is that the cache was always seen to be null so no code to to probe the cache was added to the IR. When that happens, the optimizations still apply (i.e. there could be dominated `ScopedValue.get()` that can be replaced by this one or a dominating one that can replace this one). This should also be very uncommon. So the nodes that are put in place to enable optimizations should be left in until expansion to not miss optimization opportunities.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16966#discussion_r1471360274
More information about the hotspot-compiler-dev
mailing list