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

Vladimir Kozlov kvn at openjdk.org
Thu Oct 23 16:58:48 UTC 2025


On Thu, 23 Oct 2025 06:51:09 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

>> Marc Chevalier has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Adapt the comment
>
> There are 2 things:
> 1. `restore_major_progress` from addition (or OR) semantics to assignment (@dean-long's concern): I've added
> 
> void          set_major_progress(bool progress) { precond(!(!progress && _major_progress)); _major_progress = progress; }
> 
> To see if we are ever in the case that the `old_progress` is false and `_major_progress` is true. That is the only case where the former OR-semantics is not the same as the new set semantics. It passes tier1-6 + other internal tests. I can replace the assignment with a `||` (the boolean `+`) if we still have doubts, but then, it seems tests are not exercising this path.
> 2. Is the type change correct overall. I've did something as @vnkozlov describes: have side by side the bool and the int version of the major progress, have the methods acts on both at the same time: on the int as it used to, on the bool as I propose here. Add the proposed assert in the getter. I've also made sure to assign both the int and the bool version for the 2 places in `compile.cpp` that assign `_major_progress` directly. It passes tier1-3 + other internal tests. This also makes sure there is no observable difference between the `+=` for the `int` version, and the assignment for the `bool` version.
> 
> Here is what I've tested with:
> [testing.patch](https://github.com/user-attachments/files/23091637/testing.patch)

Thank you, @marc-chevalier, for confirming that new logic works as old one by running different experiments.

@eme64, I agree with you suggested comment. 

@chhagedorn, yes, in most cases setting major_progress indicates that calculated loop information (get_ctrl, idom, get_loop, etc) is invalid anymore and needs to be recalculated. I agree that in some cases we indeed too conservative by setting major_progress. But the only downside is compilation time.

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

PR Comment: https://git.openjdk.org/jdk/pull/27912#issuecomment-3438098985


More information about the hotspot-compiler-dev mailing list