RFR: 8334060: Implementation of Late Barrier Expansion for G1 [v25]

Vladimir Kozlov kvn at openjdk.org
Tue Sep 24 20:00:47 UTC 2024


On Mon, 23 Sep 2024 07:54:39 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> src/hotspot/share/opto/matcher.cpp line 1821:
>> 
>>> 1819:   if( rule >= _END_INST_CHAIN_RULE || rule < _BEGIN_INST_CHAIN_RULE ) {
>>> 1820:     assert(C->node_arena()->contains(s->_leaf) || !has_new_node(s->_leaf),
>>> 1821:            "duplicating node that's already been matched");
>> 
>> Why it was removed?
>
> The assertion was failing due to it being too strict in several cases where the matcher would generate valid code anyway. One of them is when `is_encode_and_store_pattern(n, m)` returns true but `m -> n` cannot be matched by a single `g1EncodePAndStoreN` instruction. Commit 9ad158b6 removes this case by ensuring that `is_encode_and_store_pattern(n, m)` holds only if `m -> n` can indeed be matched.
> There are other cases (all of them harmless as far as I can see) in which this assertion can fail. I am investigating whether they can be avoided so that the assertion can be restored, and what would be the impact on the "redundant decompression removal" (`g1EncodePAndStoreN`) optimization.

I think you can do that as follow up changes as separate RFE. I am fine with removal in this JEP code.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19746#discussion_r1773999931


More information about the hotspot-compiler-dev mailing list