RFR: 8369448: C2 SuperWord: refactor VTransform to do move_unordered_reduction_out_of_loop during VTransform::optimize [v2]

Emanuel Peter epeter at openjdk.org
Mon Oct 13 10:58:43 UTC 2025


On Mon, 13 Oct 2025 08:49:08 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> src/hotspot/share/opto/vtransform.cpp line 46:
>> 
>>> 44:   TRACE_OPTIMIZE( tty->print_cr("\nVTransformGraph::optimize"); )
>>> 45: 
>>> 46:   while (true) {
>> 
>> Could we also just do `while (progress)`? You always seem to check `!progress` at the very end of the loop.
>
> If there is a bug and we keep setting `progress` to true, we might loop endlessly. Is there another always true upper-bound condition? We could additionally add an assert for catching issues when we bail out.

Nice idea, I'll limit it to 10 or so. That should work at least for now.
Not sure what you mean by `bail out` here. I think I'll just limit it to a debug assert.

The issue is that if we do not fully optimize, it may be that we do not get a consistent graph. Well for now optimization is optional, but in the future we may have to perform some optimizations to canonicalize the graph, just like in IGVN.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27704#discussion_r2425738909


More information about the hotspot-compiler-dev mailing list