RFR: 8287087: C2: perform SLP reduction analysis on-demand [v2]
Jatin Bhateja
jbhateja at openjdk.org
Sun Apr 2 05:56:35 UTC 2023
On Sun, 2 Apr 2023 04:57:34 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
>> Roberto Castañeda Lozano has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 28 additional commits since the last revision:
>>
>> - Merge master
>> - Relax the reduction cycle search bound
>> - Remove redundant IR check precondition
>> - Use SuperWord members in reduction marking
>> - Remove redundant opcode checks
>> - Do not run test in x86-32
>> - Update existing test instead of removing it
>> - Add negative vectorization test
>> - Update copyright headers
>> - Add two more reduction vectorization microbenchmarks
>> - ... and 18 more: https://git.openjdk.org/jdk/compare/a8c9a58e...95f6cc33
>
> src/hotspot/share/opto/superword.cpp line 504:
>
>> 502: // to the phi node following edge index 'input'.
>> 503: PathEnd path =
>> 504: find_in_path(
>
> Hi @robcasloz,
> find_in_path expects reduction nodes to be present at same edge indices in the reduction chain, it also honors has_swapped_edge flag during backward traversal.
> However, there are still some ideal transforms like following which may break the reduction chain and this will prevent Min/Max reductions for test case mentioned in JDK-8302673.
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/addnode.cpp#L1147
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/addnode.cpp#L1230
One way to add fault-tolerance to find_in_path could be to follow strict DFS semantics where an alternate path is taken if node's predicates are not satisfied, currently we are starting all over again from the first node of chain with a different reduction_input which prevents inferring reduction chain even though all the nodes in the chain are commutative isomorphic operations.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13120#discussion_r1155244291
More information about the hotspot-compiler-dev
mailing list