RFR: 8302518: Add missing Op_RoundDoubleMode in VectorNode::vector_operands()

Jatin Bhateja jbhateja at openjdk.org
Sun Feb 19 23:54:27 UTC 2023


On Thu, 16 Feb 2023 08:22:20 GMT, Pengfei Li <pli at openjdk.org> wrote:

> This is a one-line fix.
> 
> `VectorNode::vector_operands()` is a C2 function used to get a half-open range of `[start, end)` defining which operands are vectors to process. `Op_RoundDoubleMode` has two operands but only the 1st one is a vector. Its 2nd operand is the rounding mode. Missing this op results in its 2nd operand treated as a vector. It is fortunate that it hasn't caused any issue yet as the code follows just treated the 2nd input as an immediate to replicate later. If we add some check like `n->is_Vector()` for the vectorized node then, there will be issues. We should fix this potential problem.
> 
> Tested tier1.

src/hotspot/share/opto/vectornode.cpp line 554:

> 552:   case Op_RShiftI:  case Op_RShiftL:
> 553:   case Op_URShiftI: case Op_URShiftL:
> 554:   case Op_RoundDoubleMode:

Please also add a check for Op_RotateRight and Op_RotateLeft here, its count argument (second operand) is treated as a vector/scalar based on following condition
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/superword.cpp#L2609.

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

PR: https://git.openjdk.org/jdk/pull/12584


More information about the hotspot-compiler-dev mailing list