RFR: 8374622: StressIncrementalInlining should also randomize the processing order

Marc Chevalier mchevalier at openjdk.org
Wed Jan 14 17:18:04 UTC 2026


On Thu, 8 Jan 2026 09:25:35 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

> As it says: randomize the order the late inlines are processed, and slightly factor it with macro nodes.
> 
> I didn't add shuffle to the `GrowableArray` class since it seems a bit method specialized method (and it seems it'd be a controversial change to a widely use class), it would make `GrowableArray` depends on `Compile` for random number generation (or require a callback, for instance, giving a non-trivial signature and usage), I couldn't find other shuffling of such an object.
> There is also shuffling of `UniqueNodeList` (for `StressIGVN`), but it seems hard to unify: access and length are not written quite the same, it would probably be not simpler than duplicating the implem (which is simple, so it's fine in my opinion).
> 
> Thanks,
> Marc

I could find only very little difference between `Always` and `Stress`.
This (hence their names):
https://github.com/openjdk/jdk/blob/56545328f849c3ebf062e3ff601224084fa3b46e/src/hotspot/share/opto/compile.hpp#L1108-L1109
and the fact that the `Always` is a develop flag while `Stress` is diagnostic

And there is only one location where the `Stress` version appears alone: to initialize the random generator.

It seems that the `Stress` version should do the shuffling (that's the randomized one). And indeed, I suppose we can do it for the `Always` version, but its current behavior is deterministic and that would change that. That would also make more questionable to have both the `Stress` and `Always` version. Wdyt?

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

PR Comment: https://git.openjdk.org/jdk/pull/29110#issuecomment-3750643909


More information about the hotspot-compiler-dev mailing list