RFR: 8332905: C2 SuperWord: bad AD file, with RotateRightV and first operand not a pack
Emanuel Peter
epeter at openjdk.org
Wed May 29 15:47:27 UTC 2024
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.
-------------
Commit messages:
- fix populate_index, only on sve
- 8332905
Changes: https://git.openjdk.org/jdk/pull/19445/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19445&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8332905
Stats: 21 lines in 2 files changed: 18 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/19445.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/19445/head:pull/19445
PR: https://git.openjdk.org/jdk/pull/19445
More information about the hotspot-compiler-dev
mailing list