[M] Change in dart/sdk[main]: [vm/compiler] Specialize Int32x4 operators in AOT.

0 views
Skip to first unread message

Modestas Valauskas (Gerrit)

unread,
Apr 21, 2026, 8:21:46 AM (yesterday) Apr 21
to dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org

Message from Modestas Valauskas

Set Ready For Review

Ready for review.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9b76ab4fff228ff1a5e3d3c86f4bfc059e66a49a
Gerrit-Change-Number: 497000
Gerrit-PatchSet: 1
Gerrit-Owner: Modestas Valauskas <valauska...@gmail.com>
Gerrit-Comment-Date: Tue, 21 Apr 2026 12:21:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Slava Egorov (Gerrit)

unread,
Apr 21, 2026, 8:37:02 AM (yesterday) Apr 21
to Modestas Valauskas, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Modestas Valauskas

Slava Egorov added 2 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Slava Egorov . resolved

Thanks!

Commit Message
Line 39, Patchset 1 (Latest):Existing tests/lib/typed_data/simd_*_test.dart still pass in JIT and
Slava Egorov . unresolved

Please add `TEST=` here at the start of the line.

Open in Gerrit

Related details

Attention is currently required from:
  • Modestas Valauskas
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9b76ab4fff228ff1a5e3d3c86f4bfc059e66a49a
Gerrit-Change-Number: 497000
Gerrit-PatchSet: 1
Gerrit-Owner: Modestas Valauskas <valauska...@gmail.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
Gerrit-Attention: Modestas Valauskas <valauska...@gmail.com>
Gerrit-Comment-Date: Tue, 21 Apr 2026 12:36:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Modestas Valauskas (Gerrit)

unread,
Apr 21, 2026, 8:47:39 AM (yesterday) Apr 21
to dart-...@luci-project-accounts.iam.gserviceaccount.com, Slava Egorov, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Slava Egorov

Modestas Valauskas added 1 comment

Commit Message
Line 39, Patchset 2 (Latest):Existing tests/lib/typed_data/simd_*_test.dart still pass in JIT and
Modestas Valauskas . resolved

Done in patchset 2.

Open in Gerrit

Related details

Attention is currently required from:
  • Slava Egorov
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9b76ab4fff228ff1a5e3d3c86f4bfc059e66a49a
Gerrit-Change-Number: 497000
Gerrit-PatchSet: 2
Gerrit-Attention: Slava Egorov <veg...@google.com>
Gerrit-Comment-Date: Tue, 21 Apr 2026 12:47:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Slava Egorov (Gerrit)

unread,
Apr 21, 2026, 9:25:04 AM (yesterday) Apr 21
to Modestas Valauskas, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Modestas Valauskas

Slava Egorov voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Modestas Valauskas
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9b76ab4fff228ff1a5e3d3c86f4bfc059e66a49a
Gerrit-Change-Number: 497000
Gerrit-PatchSet: 4
Gerrit-Attention: Modestas Valauskas <valauska...@gmail.com>
Gerrit-Comment-Date: Tue, 21 Apr 2026 13:24:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Slava Egorov (Gerrit)

unread,
Apr 21, 2026, 9:25:43 AM (yesterday) Apr 21
to Modestas Valauskas, Alexander Aprelev, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Alexander Aprelev and Modestas Valauskas

Slava Egorov added 1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Slava Egorov . resolved

PTAL @a...@google.com

(needs one more +1 for external contributor)

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Aprelev
  • Modestas Valauskas
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9b76ab4fff228ff1a5e3d3c86f4bfc059e66a49a
Gerrit-Change-Number: 497000
Gerrit-PatchSet: 4
Gerrit-Owner: Modestas Valauskas <valauska...@gmail.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Attention: Alexander Aprelev <a...@google.com>
Gerrit-Attention: Modestas Valauskas <valauska...@gmail.com>
Gerrit-Comment-Date: Tue, 21 Apr 2026 13:25:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Aprelev (Gerrit)

unread,
Apr 21, 2026, 10:32:02 AM (yesterday) Apr 21
to Modestas Valauskas, Alexander Aprelev, Slava Egorov, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Modestas Valauskas

Alexander Aprelev voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Modestas Valauskas
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b76ab4fff228ff1a5e3d3c86f4bfc059e66a49a
    Gerrit-Change-Number: 497000
    Gerrit-PatchSet: 4
    Gerrit-Owner: Modestas Valauskas <valauska...@gmail.com>
    Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
    Gerrit-Reviewer: Slava Egorov <veg...@google.com>
    Gerrit-Attention: Modestas Valauskas <valauska...@gmail.com>
    Gerrit-Comment-Date: Tue, 21 Apr 2026 14:32:00 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Modestas Valauskas (Gerrit)

    unread,
    Apr 21, 2026, 11:44:44 AM (24 hours ago) Apr 21
    to Alexander Aprelev, Slava Egorov, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org

    Modestas Valauskas voted and added 1 comment

    Votes added by Modestas Valauskas

    Auto-Submit+1

    1 comment

    Patchset-level comments
    Modestas Valauskas . resolved

    Thanks for the reviews!

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b76ab4fff228ff1a5e3d3c86f4bfc059e66a49a
    Gerrit-Change-Number: 497000
    Gerrit-PatchSet: 4
    Gerrit-Owner: Modestas Valauskas <valauska...@gmail.com>
    Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
    Gerrit-Reviewer: Modestas Valauskas <valauska...@gmail.com>
    Gerrit-Comment-Date: Tue, 21 Apr 2026 15:44:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Slava Egorov (Gerrit)

    unread,
    3:01 AM (8 hours ago) 3:01 AM
    to Modestas Valauskas, Alexander Aprelev, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
    Attention needed from Modestas Valauskas

    Slava Egorov voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Modestas Valauskas
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b76ab4fff228ff1a5e3d3c86f4bfc059e66a49a
    Gerrit-Change-Number: 497000
    Gerrit-PatchSet: 4
    Gerrit-Owner: Modestas Valauskas <valauska...@gmail.com>
    Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
    Gerrit-Reviewer: Modestas Valauskas <valauska...@gmail.com>
    Gerrit-Reviewer: Slava Egorov <veg...@google.com>
    Gerrit-Attention: Modestas Valauskas <valauska...@gmail.com>
    Gerrit-Comment-Date: Wed, 22 Apr 2026 07:01:34 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    dart-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

    unread,
    3:01 AM (8 hours ago) 3:01 AM
    to Modestas Valauskas, Slava Egorov, Alexander Aprelev, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org

    dart-...@luci-project-accounts.iam.gserviceaccount.com submitted the change

    Change information

    Commit message:
    [vm/compiler] Specialize Int32x4 operators in AOT.

    The five binary operators on Int32x4 (+, -, |, &, ^) were never added
    to the recognized-method list as graph intrinsics, so calls to them
    were left as runtime calls through external-name bodies. In JIT the
    call specializer picked kInt32x4Cid from IC feedback and emitted a
    native SimdOpInstr, but AOT has no IC feedback and therefore fell back
    to boxed calls, making Int32x4List inner loops 10-70x slower than both
    the JIT version and a hand-written scalar equivalent.

    This CL wires the same specialization paths that already exist for
    Float32x4.+,-,*,/:
    - recognize the five operators as graph intrinsics and mark them
    with `@pragma("vm:recognized", "graph-intrinsic")` plus an
    exact-result-type pragma;
    - add Build_Int32x4{Add,Sub,BitAnd,BitOr,BitXor} helpers that
    delegate to the existing BuildSimdOp;
    - extend SimdOpInstr::KindForOperator and CreateFromCall;
    - extend CallSpecializer::InlineSimdOp and TryInlineRecognizedMethod
    so the non-speculative null-check path used for Float32x4 operators
    in AOT also applies here.

    Measured on macOS arm64 (M-series), `dart compile exe`:

    Issue 63217 orSimd : 12.58 -> 0.32 us/iter (39x)
    Issue 63217 andNotSimd : 23.51 -> 0.34 us/iter (69x)
    Issue 53662 mandelbrot : 4038.5 -> 55.5 ms (72x)

    A new benchmark benchmarks/SimdInt32x4 exercises all five operators
    with a scalar and a SIMD variant so the specialization stays covered
    by the benchmark bots; it is registered in Omnibus and OmnibusDeferred.


    Existing tests/lib/typed_data/simd_*_test.dart still pass in JIT and
    AOT.

    TEST=tests/lib/typed_data/int32x4_arithmetic_test; benchmarks/SimdInt32x4
    Bug: https://github.com/dart-lang/sdk/issues/53662
    Bug: https://github.com/dart-lang/sdk/issues/63217
    Change-Id: I9b76ab4fff228ff1a5e3d3c86f4bfc059e66a49a
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497000
    Reviewed-by: Slava Egorov <veg...@google.com>
    Commit-Queue: Slava Egorov <veg...@google.com>
    Auto-Submit: Modestas Valauskas <valauska...@gmail.com>
    Reviewed-by: Alexander Aprelev <a...@google.com>
    Files:
    • M benchmarks/Omnibus/dart/Omnibus.dart
    • M benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart
    • A benchmarks/SimdInt32x4/dart/SimdInt32x4.dart
    • M runtime/vm/compiler/backend/il.cc
    • M runtime/vm/compiler/call_specializer.cc
    • M runtime/vm/compiler/graph_intrinsifier.cc
    • M runtime/vm/compiler/recognized_methods_list.h
    • M sdk/lib/_internal/vm/lib/typed_data_patch.dart
    Change size: M
    Delta: 8 files changed, 242 insertions(+), 1 deletion(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Alexander Aprelev, +1 by Slava Egorov
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I9b76ab4fff228ff1a5e3d3c86f4bfc059e66a49a
    Gerrit-Change-Number: 497000
    Gerrit-PatchSet: 5
    Gerrit-Owner: Modestas Valauskas <valauska...@gmail.com>
    Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
    Gerrit-Reviewer: Modestas Valauskas <valauska...@gmail.com>
    Gerrit-Reviewer: Slava Egorov <veg...@google.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages