[15] RFR (L): 8235824: C2: Merge AD instructions for AddReductionV and MulReductionV nodes

John Rose john.r.rose at oracle.com
Fri Dec 13 01:46:03 UTC 2019


On Dec 12, 2019, at 3:37 PM, Vladimir Kozlov <vladimir.kozlov at oracle.com> wrote:
> 
> Looks good. I wish we can do more folding of code but instructions are too different. What is done is enough for this project.


+1 Reviewed.

As I mentioned in the 8235756 thread, a good way to factor the
implementation of (associative) reductions would be to reformulate
them as the repeated composition of 2N-to-N-lane reductions.

For non-associative reductions (floating point), the 2N-to-N
pattern is acceptable, *if* the reduction is specified to happen in
that order.  To get that permission into the contract will require
a distinction between reduceSequential and reduceParallel
operations in the Vector API.

That sequence of 16 vaddss operations is certainly an eyesore,
but it’s not clear how to improve on it, algorithmically.  Perhaps
it could be factored into a sequential accumulation operation,
to be repeated N times instead of lg N times.

— John


More information about the hotspot-compiler-dev mailing list