-
Enhancement
-
Resolution: Duplicate
-
P4
-
22
Early unrolling analysis (SuperWord::unrolling_analysis()) informs the loop unrolling factor computed by the unrolling policy (IdealLoopTree::policy_unroll()) via IdealLoopTree::policy_unroll_slp_analysis(). This analysis currently ignores reduction nodes [1]. For pure reduction loops (loops whose body consists only of reduction nodes), that leads the analysis to always request maximum unrolling (unroll factor of Matcher::superword_max_vector_size(T_BYTE) [2]) independently of the type of the reduction nodes.
The attached program reproduces this behavior (on JDK 22 b20), leading to a non-vectorized main loop with 512 floating point additions. Run with:
$ java -Xcomp -XX:CompileOnly=Test::test Test.java
[1] https://github.com/openjdk/jdk/blob/fd332da1c8a689e91b7124fc342f02b6e0d3dff5/src/hotspot/share/opto/superword.cpp#L192
[2] https://github.com/openjdk/jdk/blob/fd332da1c8a689e91b7124fc342f02b6e0d3dff5/src/hotspot/share/opto/superword.cpp#L185
The attached program reproduces this behavior (on JDK 22 b20), leading to a non-vectorized main loop with 512 floating point additions. Run with:
$ java -Xcomp -XX:CompileOnly=Test::test Test.java
[1] https://github.com/openjdk/jdk/blob/fd332da1c8a689e91b7124fc342f02b6e0d3dff5/src/hotspot/share/opto/superword.cpp#L192
[2] https://github.com/openjdk/jdk/blob/fd332da1c8a689e91b7124fc342f02b6e0d3dff5/src/hotspot/share/opto/superword.cpp#L185
- duplicates
-
JDK-8324794 C2 SuperWord: do not ignore reductions in SuperWord::unrolling_analysis
-
- Resolved
-
- relates to
-
JDK-8307516 C2 SuperWord: reconsider Reduction heuristic for UnorderedReduction
-
- Open
-
-
JDK-8317507 C2 compilation fails with "Exceeded _node_regs array"
-
- Closed
-