RFR: 8373495: C2: Aggressively fold loads from objects that have not escaped [v16]
Quan Anh Mai
qamai at openjdk.org
Tue Jan 13 12:28:10 UTC 2026
On Tue, 13 Jan 2026 12:17:23 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:
>> Constructing a local variable is cheap. I think it is better to modify `Unique_Node_List` to be more C++ idiomatic (i.e. not allocating on default construction). However, it should be a separate issue.
>
> Constructing local variables is cheap, but arena allocation is one of the main sources of overhead for C2. If we can avoid the allocations of `LocalEA::_aliases` and `LocalEA::_not_escaped_controls` in some cases by simply bailing out earlier, why not? Is there any drawback I am missing?
Yes, that's why I'm suggesting improving `Unique_Node_List` default constructor not to allocate instead. The drawback I see here is that it is not trivial whether the current behaviour has any effect on non-oop memory accesses. And even if it is truly so, refactoring the function like that expands the scope of this PR a little bit.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28812#discussion_r2686188483
More information about the hotspot-compiler-dev
mailing list