RFR: 8373495: C2: Aggressively fold loads from objects that have not escaped [v16]

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Tue Jan 13 12:20:44 UTC 2026


On Tue, 13 Jan 2026 10:04:19 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Thanks! Could the early return case be hoisted to `MemNode::find_previous_store` so that we avoid constructing `local_ea`? Or is there any case where `base` is not an OOP and `find_previous_store` would still find something useful?
>
> 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?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28812#discussion_r2686166465


More information about the hotspot-compiler-dev mailing list