RFR: 8374622: StressIncrementalInlining should also randomize the processing order
Damon Fenacci
dfenacci at openjdk.org
Mon Jan 12 08:50:58 UTC 2026
On Mon, 12 Jan 2026 08:03:07 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:
>> src/hotspot/share/opto/compile.cpp line 2177:
>>
>>> 2175: if (array.length() < 2) {
>>> 2176: return;
>>> 2177: }
>>
>> Do we need this check?
>
> Arguable. As you can see, it was there, and I didn't question it. But given the implementation under:
>
> for (uint i = array.length() - 1; i >= 1; i--)
>
> if the array is empty, something bad will happen, so we need at least this check. And then, why not also take `< 2`, at this point?
>
> The other option is to use an increasing loop index, or a signed one. I think the decreasing loop index is natural here. A signed `i` would probably work. I think some people have opinion against that in iterations... I don't mind either way.
>
> Overall, as it is now, we need this check. We could do without if we do other changes. I'm ok with how it's written now, especially because it keeps it similar to `PhaseIterGVN::shuffle_worklist()`, but I don't mind doing another way if someone has a strong opinion.
Fair enough (I was just wondering about the signed option since `array.length()` seems to be returning it anyway). Thanks @marc-chevalier.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29110#discussion_r2681318197
More information about the hotspot-compiler-dev
mailing list