RFR: 8341102: Add element type information to vector types
Quan Anh Mai
qamai at openjdk.org
Fri Sep 27 18:12:53 UTC 2024
Hi,
This patch adds the type information of each element in a `TypeVect`. This helps constant folding vectors as well as strength reduction of several complex operations such as `Rearrange`. Some notable points:
- I only implement `ConV` rule on x86, looking at other architectures it seems that I would not only need to implement the `ConV` implementations, but several other rules that match `ReplicateNode` of a constant.
- I changed the implementation of an array constant in `constanttable`, I think working with `jbyte` is easier as it allows `memcpy` and at this point, we are close to the metal anyway.
- Constant folding for a `VectorUnboxNode`, this is special because an element of a normal stable array is only constant if it is non-zero, so implementing constant folding on a load node seems less trivial.
- Memory fences because `Vector::payload` is a final field and we should respect that.
- Several places expect a `const Type*` when in reality it expects a `BasicType`, I refactor that so that the intent is clearer and there is less room for possible errors, this is needed because `byte`, `short` and `int` share the same kind of `const Type*`.
Please take a look and leave your reviews, thanks a lot.
-------------
Commit messages:
- build error
- add element types to vector types
Changes: https://git.openjdk.org/jdk/pull/21229/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21229&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8341102
Stats: 1401 lines in 39 files changed: 863 ins; 332 del; 206 mod
Patch: https://git.openjdk.org/jdk/pull/21229.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21229/head:pull/21229
PR: https://git.openjdk.org/jdk/pull/21229
More information about the hotspot-compiler-dev
mailing list