RFR: 8320649: C2: Optimize scoped values [v4]

Emanuel Peter epeter at openjdk.org
Thu Feb 8 14:10:15 UTC 2024


On Mon, 29 Jan 2024 14:29:36 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> src/hotspot/share/opto/callGenerator.cpp line 1155:
>> 
>>> 1153:       CallProjections slow_projs;
>>> 1154:       slow_call->extract_projections(&slow_projs, false);
>>> 1155:       Node* fallthrough = slow_projs.fallthrough_catchproj->clone();
>> 
>> Why does that have to be cloned?
>
> Control out of the slow call is redirected to new the `region_fast_slow`. It's one way to do that. The other would be to iterate over all uses of the projection, replace the edge leading to the projection with top and then add the projection as input to `region_fast_slow`. That doesn't seem simpler.

Ah, now I understand. You are actually killing off `slow_projs.fallthrough_catchproj` below!
`C->gvn_replace_by(slow_projs.fallthrough_catchproj, C->top());`
Can you move that line up to here? And maybe add some helpful comment?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16966#discussion_r1483020328


More information about the hotspot-compiler-dev mailing list