Commit Graph

11 Commits

Author SHA1 Message Date
Modestas Valauskas b74add4813 [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 <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Auto-Submit: Modestas Valauskas <valauskasmodestas@gmail.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-04-22 00:01:52 -07:00
Robert Nystrom ff87171f6c Reformat benchmarks/ with 3.8 style.
Change-Id: Ied900f7d85addabc586823139aa78b879be035ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425182
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2025-04-29 07:46:46 -07:00
Mayank Patke 2385d2fb11 [benchmarks] Remove Dart 2 benchmarks
Change-Id: I69d03bb874b015494c7af80ceffcc4482b3ec688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421887
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2025-04-16 17:15:01 -07:00
Stephen Adams d2c9d936a7 [benchmarks] Add MultipleReturns to Omnibus
Change-Id: I891fcca4295e244982aae470cb19473ae1349483
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396160
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-11-18 22:02:17 +00:00
Robert Nystrom e4c8b49dcc Format benchmarks/.
Change-Id: I1362ada67a02b0ed352612fc29c727e94d8cd254
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394901
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-11-18 10:06:01 +00:00
Stephen Adams 5b4c1bcf81 [benchmarks] Add SwitchFSM and UiMatrix to Omnibus
Change-Id: I2b5712bda7fe48bc7d4566a4a54ebe39a92214a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381747
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-09-04 17:37:49 +00:00
Eric Seidel 4c20cedd30 Fix analysis issues in benchmarks/ directory
Now that I'm able to open the entire SDK in VSC, I'm fixing some
of the analysis issues in various files (carefully) without changing
their meaning.

In this case, I removed unnecessary imports from benchmarks.
In regexp_benchmark I ignored one warning which likely would
have changed the behavior of the code.

BUG=https://github.com/dart-lang/sdk/issues/52419

Change-Id: I9a195a4e45121313bd9f065f2579a165c3fec05b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303901
Auto-Submit: Eric Seidel <eric@shorebird.dev>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-05-17 09:14:50 +00:00
Stephen Adams c0c6ff4754 [benchmark] Add RecordCollections and Iterators to Omnibus{Deferred}
Change-Id: Ib07b1faadb19b6656813cb92ef65243cc4f0c91e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293385
Commit-Queue: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Stephen Adams <sra@google.com>
2023-04-05 01:05:32 +00:00
Stephen Adams 87c5c968cd Add MapCopy to Omnibus benchmarks
Change-Id: I911f914294b275600be894f227250927f05d74af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231535
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-06-28 19:53:23 +00:00
Stephen Adams 235ff47a07 [benchmarks] Fix lints in Omnibus benchmarks
Change-Id: I08dd527bcfd3b4ed97d0c57a877c64ff0ec49ade
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196460
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-04-23 20:11:52 +00:00
Stephen Adams 68a57c59d7 [benchmarks] Omnibus benchmark
A benchmark that is a collection of other benchmarks.

This benchmark has two purposes:

 - As a medium sized compilation benchmark
 - As a tool for running benchmarks as part of a larger program

This benchmark is not intended to be run for the purpose of generating
benchmark timing results on Golem.

It should be extended over time to include most public benchmarks that
are meaningful on all Dart platforms.

Change-Id: I17f034cfd68d01ff5b4842b89b216fcea0d5bd3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170060
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2020-11-28 20:36:06 +00:00