8398424: x86: Align vector constant stubs to 64 bytes to avoid cache-line split loads #34085
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.48) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 538 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.376
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #34085"
general
weight: 0.35
vnkozlov
Hi All,
With default settings on x86_64, several 64-byte vector constant stubs are not aligned to a 64-byte (cache line) boundary.
Taking each start address reported by
-XX:+PrintStubCodemodulo 64 gives an offset of 32:These stubs are emitted by
StubGenerator::generate_vector_mask()andStubGenerator::generate_vector_byte_perm_mask().Both currently align to
CodeEntryAlignment, which is 32 on x86.C2 reads these constants as 64-byte (ZMM) memory operands. With the stub at offset 32, every such access is split across two cache lines. This patch emits
align64()before each generated stub, so every mask starts at a cache-line boundary.The gains come from the sign mask and sign flip stubs, which are used by vector neg, abs and FP-to-integral casts.
vector_byte_perm_maskandvector_short_to_byte_maskare aligned for consistency.Performance (existing JMH benchmarks,
TypeVectorOperations.TypeVectorOperationsSuperWord,COUNT=2048, lower ns/op is better):-prof perfnorm:events=ls_misal_loads.ma64<img width="1421" height="379" alt="image" src="https://github.com/user-attachments/assets/d895408a-b04b-4dd1-9f04-5f3a3af78b37" />
Kindly review and share your feedback.
Best Regards,
Jatin
---------
<!-- Anything below this marker will be automatically updated, please do not edit manually! -->
---------
Progress
Issue
JDK-8398424: x86: Align vector constant stubs to 64 bytes to avoid cache-line split loads (Enhancement - P4)
Reviewers
Quan Anh Mai (@merykitty - Reviewer) 🔄 Re-review required (review applies to 913e971f)
* Vladimir Kozlov (@vnkozlov - Reviewer) 🔄 Re-review required (review applies to 913e971f)
Reviewing
<details><summary>Using <code>git</code></summary>
Checkout this PR locally: \
$ git fetch https://git.openjdk.org/jdk.git pull/34085/head:pull/34085\$ git checkout pull/34085Update a local copy of the PR: \
$ git checkout pull/34085\$ git pull https://git.openjdk.org/jdk.git pull/34085/head</details>
<details><summary>Using Skara CLI tools</summary>
Checkout this PR locally: \
$ git pr checkout 34085View PR using the GUI difftool: \
$ git pr show -t 34085</details>
<details><summary>Using diff file</summary>
Download this PR as a diff file: \
<a href="https://git.openjdk.org/jdk/pull/34085.diff">https://git.openjdk.org/jdk/pull/34085.diff</a>
</details>
<details><summary>Using Webrev</summary>
Link to Webrev Comment
</details>