RFR: 8290892: C2: Intrinsify Reference.reachabilityFence [v11]
Emanuel Peter
epeter at openjdk.org
Thu Sep 18 12:04:20 UTC 2025
On Wed, 17 Sep 2025 19:44:52 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
>>> Why are you checking for _mode == LoopOptsDefaultFinal and not for LoopOptsEliminateRFs?
>>
>> The intention is to avoid an extra `PhaseIdealLoop` construction pass solely for `LoopOptsEliminateRFs` purposes when there's an empty pass during normal flow of loop optimizations.
>>
>> `LoopOptsEliminateRFs` is performed as the last resort when there was no previous pass to piggyback on.
>
> Maybe `LoopOptsEliminateRFs` should stress that it is intended to happen as the very last step in the flow of loop optimizations. Or, something happening after all other loop optimizations are over. I'll think more about it.
>
> From code perspective, what makes things more complicated is that `PhaseIdealLoop` instance is hidden in `PhaseIdealLoop::optimize()`, so shaping it as a step in loop opts pipeline feels like the most appropriate thing to do.
@iwanowww It is the last step in the pipeline, but the pipeline could get executed again, right? So then you may think that you have reached the last step in the pipeline, but then in the next pipeline execution, you might have already eliminated the RF, and now you would do some loop-opts that you should not. That's what I'm worried about. Can we have some assert for that?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25315#discussion_r2358850185
More information about the hotspot-compiler-dev
mailing list