jdk
jdk copied to clipboard
8335628: C2 SuperWord: cleanup: remove SuperWord::longer_type_for_conversion
After 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.
Progress
- [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
Issue
- JDK-8335628: C2 SuperWord: cleanup: remove SuperWord::longer_type_for_conversion (Enhancement - P4)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20009/head:pull/20009
$ git checkout pull/20009
Update a local copy of the PR:
$ git checkout pull/20009
$ git pull https://git.openjdk.org/jdk.git pull/20009/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20009
View PR using the GUI difftool:
$ git pr show -t 20009
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20009.diff