RFR: 8287087: C2: perform SLP reduction analysis on-demand

Emanuel Peter epeter at openjdk.org
Thu Mar 23 10:15:45 UTC 2023


On Thu, 23 Mar 2023 10:06:31 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> src/hotspot/share/opto/superword.cpp line 485:
>> 
>>> 483: 
>>> 484:   // Iterate through all phi nodes associated to the loop and search for
>>> 485:   // reduction cycles of at most LoopMaxUnroll nodes.
>> 
>> `LoopMaxUnroll` is probably ok for most cases. With hand-unrolled `byte` loops, this may not work, since the loop will have more operations in the chain. You could consider using the number of nodes in the loop.
>
> Thanks for the suggestion! I prefer to keep `LoopMaxUnroll` as a bound, to guard against pathologically large basic blocks, even if it implies missing some hand-unrolled loops.

Up to you. The loop body size is limited by `LoopUnrollLimit`, which is currently set to 50 or 60, depending on the platform. So we do not unroll too much to prevent pathologically large loop bodies. That is actually why most SuperWord tests have to increase `LoopUnrollLimit` - otherwise we would not even vectorize those cases.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13120#discussion_r1145960866


More information about the hotspot-compiler-dev mailing list