JDK-8308606 : C2 SuperWord: remove alignment checks when not required
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-05-23
  • Updated: 2023-07-12
  • Resolved: 2023-06-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 b03Fixed
Description
This is a subtask of JDK-8303113.

In SuperWord::can_create_pairs, we check if memrefs are aligned with all other memrefs if "vectors_should_be_aligned()". This is good and indeed required.

But if we have "vectors_should_be_aligned() == false", we should not have to impose any alignment requirements on the memrefs, this only prevents vectorization.

Thus, we should always take the path that "_do_vector_loop" does: just allow the packing optimistically. And later in SuperWord::combine_packs, perform the independence check on all packs to guarantee the independence on pack level. We could also drop this completely and just detect the cycles during scheduling. But then we may miss partial vectorization opportunities: the independence checks can just filter out those packs that are problematic, and leave those that are safe.

This should strictly allow more vectorization. Some tests may have to be adapted that now check that we have no vectorization. Other tests can now drop the CompileCommand Option Vectorize.
Comments
Changeset: 886ac1c2 Author: Emanuel Peter <epeter@openjdk.org> Date: 2023-06-21 06:40:50 +0000 URL: https://git.openjdk.org/jdk/commit/886ac1c261a1b7e91e3981e32810c405a0d90329
21-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14096 Date: 2023-05-23 07:16:48 +0000
30-05-2023