RFR: 8332905: C2 SuperWord: bad AD file, with RotateRightV and first operand not a pack

Christian Hagedorn chagedorn at openjdk.org
Thu May 30 06:06:04 UTC 2024


On Wed, 29 May 2024 07:20:33 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> I just discovered this bug by manual code inspection, and found a reproducer.
> 
> It seems to be a regression of [JDK-8248830](https://bugs.openjdk.org/browse/JDK-8248830), that is when RotateRightV was added to SuperWord.
> 
> The problem is that we directly get the input node, rather than the `vector_opd`, which fails if that input is not a vector already, but for example a `PopulateIndex` pattern that is only vectorized when calling `vector_opd`.
> 
> Before this patch: it looks like this:
> 
>       } else if (VectorNode::is_scalar_rotate(n)) {
>         Node* in1 = first->in(1);
>         Node* in2 = first->in(2);
> 
> 
> But at least `in1` should be using `vector_opd`, like most other ops:
> 
> `        Node* in1 = vector_opd(p, 1);`
> 
> When the input is a `PopulateIndex` pattern, then `first->in(1) `gives us the iv-phi, which is a scalar. `vector_opd` would produce a `PopulateIndex` vector.
> 
> In the ad-file, we get an error, because we do not expect a scalar as the first operand of the RotateRightV, but a vector.

Looks good!

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

Marked as reviewed by chagedorn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19445#pullrequestreview-2087302857


More information about the hotspot-compiler-dev mailing list