RFR: 8370077: C2: make Compile::_major_progress a boolean [v2]

Marc Chevalier mchevalier at openjdk.org
Wed Oct 22 08:50:35 UTC 2025


On Wed, 22 Oct 2025 08:29:38 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Probably, but that is out of the scope of this issue. Moreover, I don't know enough of loop optimization to write a helpful and correct comment. It feels like it should just be another RFE done by someone who can do it. The change I'm doing here doesn't actually need to understand how the whole thing works.
>> 
>> Also
>>> If we ever set the flag, we don't continue with more loop-opts, but spin back to IGVN, clean the graph, and maybe come back to a new loop-opts round.
>> 
>> I don't think it's true. I have the same kind of intuition, but in details, I don't think it holds. We can unroll after peeling (which sets major progress) in the same loop optimization round.
>
>> My understanding is that the flag is set if the loop-opts data-structures are invalid (or at least there is no guarantee that they are valid). So we need to re-build the loop tree.
> 
> Additionally, there are also cases where we think that we could apply more loop-opts even though the structures are still valid:
> https://github.com/openjdk/jdk/blob/f475eb8ee7c9a3e360b2f1210ed71b629243cd2a/src/hotspot/share/opto/loopnode.cpp#L5113-L5119
> 
> One more reason that we should add some documentation about how we use `major_progress`.

I don't think anyone is saying we should not have such comments. I just think it's out of scope here and mainly I just don't know enough to write anything useful and correct. But if somebody more knowledgeable in this gives me a patch that adds such documentation, I can sneak it in this PR. Otherwise, it will be another time.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27912#discussion_r2450978799


More information about the hotspot-compiler-dev mailing list