RFR: 8264104: Eliminate unnecessary vector mask conversion during VectorUnbox for floating point VectorMask [v6]

Xiaohong Gong xgong at openjdk.java.net
Fri Apr 16 03:36:02 UTC 2021


> The Vector API defines different element types for floating point VectorMask. For example, the bitwise related APIs use "`long/int`", while data related APIs use "`double/float`". This makes some optimizations that based on the type checking cannot work well.
> 
> For example, the VectorBox/Unbox elimination like `"VectorUnbox (VectorBox v) ==> v"` requires the types of output and
> input are equal. Normally this is necessary. However, due to the different element type for floating point VectorMask with the same species, the VectorBox/Unbox pattern is optimized to:
> 
>   VectorLoadMask (VectorStoreMask vmask)
> 
> Actually the types can be treated as the same one for such cases. And considering the vector mask representation is the same for
> vectors with the same element size and vector length, it's safe to do the optimization:
> 
>   VectorLoadMask (VectorStoreMask vmask) ==> vmask
> 
> The same issue exists for GVN which is based on the type of a node. Making the mask node's` hash()/cmp()` methods depends on the element size instead of the element type can fix it.

Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:

 - Merge jdk 'master' into JDK-8264104
 - Add type restrict in the match rule predicate
 - Use "Matcher::match_rule_supported_vector" for vector nodes checking
 - Revert changes to VectorLoadMask and add a VectorMaskCast for the same element size mask casting
 - 8264104: Eliminate unnecessary vector mask conversion during VectorUnbox for floating point VectorMask

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3238/files
  - new: https://git.openjdk.java.net/jdk/pull/3238/files/8232bd96..e4352b39

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3238&range=05
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3238&range=04-05

  Stats: 96154 lines in 2370 files changed: 53099 ins; 34862 del; 8193 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3238.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3238/head:pull/3238

PR: https://git.openjdk.java.net/jdk/pull/3238


More information about the hotspot-compiler-dev mailing list