On Thu, 6 Nov 2025 07:36:34 GMT, Manuel Hässig <[email protected]> wrote:

>> ## Problem Analysis
>> 
>> The stress test `compiler/valhalla/inlinetypes/TestAcmpWithUnstableIf.java`, 
>> which uses the `StressUnstableIfTrap` flag, failed intermittently with the 
>> assert "no node with a side effect" during C2 compilation. I tracked down 
>> the origin of the failure to the raw store of the unstable if trap stress 
>> counter that was missing a memory edge to the backedge phi and thus had no 
>> side effect in the loop, which lead to the aforementioned assert. During 
>> parsing, the missing memory edge gets discarded with as vestigial parsing 
>> state when `do_if()` ends up `stopped()`. However, the effect of the stress 
>> counter should still be wired back into the backedge since it will be 
>> incremented in the next iteration.
>> 
>> ## Patch Description
>> 
>> To prevent the stress counters memory state being lost to 
>> `PreserveJVMState`, I pass it to the caller over an out-parameter and 
>> `set_memory` with that node, similar to what is already done for control. 
>> This is only necessary for the two last invocation of `do_if()` in 
>> `do_acmp()` where they are actually allowed to trap. Further, this PR 
>> reenables `StressUnstableIfTrap` in 
>> `compiler/valhalla/inlinetypes/TestAcmpWithUnstableIf.java`.
>> 
>> ## Testing
>> 
>> - [x] tier1,tier2,tier3 plus internal stress testing
>
> Manuel Hässig has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Review Christian

@mhaessig 
Your change (at version 9e09aa23584438396e8a50b049693018620efd69) is now ready 
to be sponsored by a Committer.

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

PR Comment: https://git.openjdk.org/valhalla/pull/1716#issuecomment-3496033789

Reply via email to