RFR: 8335628: C2 SuperWord: cleanup: remove SuperWord::longer_type_for_conversion [v2]

Emanuel Peter epeter at openjdk.org
Thu Jul 4 10:40:49 UTC 2024


> After [JDK-8325155](https://bugs.openjdk.org/browse/JDK-8325155), there is now only a single use of `SuperWord::longer_type_for_conversion`.
> The check there is rather useless,  and we should just remove it for the sake of code complexity.
> 
> **What did this check do?**
> It checks if the input-type of a node is larger than the output type, relevant in these cases:
> - `is_convert_opcode`
> - `is_scalar_op_that_returns_int_but_vector_op_returns_long`
> 
> If there is a larger type, it checks if this larger type can even create vectors of at least size 2:
> - `Matcher::max_vector_size_auto_vectorization(longer_bt) < 2)`
> 
> Of course if there cannot be vectors for this larger type, then we could avoid creating these vectors.
> 
> **Why is it rather useless?**
> On most modern platforms, all types have vectors of at least length 2. So this would never fail on those platforms.
> And even if this check fails: we would pack the nodes and later reject those packs when we do the `implemented` checks. Hence, we do not wrongly vectorize anyway. The cost of removing this check is that on most platforms we do not have to do this check, and the few that it would fail for just have a bit more compilation time (but very very minimal increase). I think this is worth the reduction in complexity. But we could always revert this change if there are problems because of it.

Emanuel Peter 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 two additional commits since the last revision:

 - Merge branch 'master' into JDK-8335628-rm-sw-longer_type_for_conversion
 - 8335628

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20009/files
  - new: https://git.openjdk.org/jdk/pull/20009/files/d17ee257..d33c20af

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20009&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20009&range=00-01

  Stats: 38238 lines in 902 files changed: 25674 ins; 8412 del; 4152 mod
  Patch: https://git.openjdk.org/jdk/pull/20009.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20009/head:pull/20009

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


More information about the hotspot-compiler-dev mailing list