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

Emanuel Peter epeter at openjdk.org
Tue Jun 4 06:23:24 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.

This pull request has now been integrated.

Changeset: 67d6f3ca
Author:    Emanuel Peter <epeter at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/67d6f3ca9e8d1312c9e3a85dbe19903619f59064
Stats:     21 lines in 2 files changed: 18 ins; 0 del; 3 mod

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

Reviewed-by: chagedorn, thartmann

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

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


More information about the hotspot-compiler-dev mailing list