Skip to content

simd: support aggregate signatures in AVX2 multiversioning - #2799

Merged
xushiwei merged 3 commits into
xgo-dev:mainfrom
zhouguangyuan0718:codex/simd-fmv-aggregates-20261012
Oct 14, 2026
Merged

xushiwei merged 3 commits into
xgo-dev:mainfrom
zhouguangyuan0718:codex/simd-fmv-aggregates-20261012

Conversation

@zhouguangyuan0718

@zhouguangyuan0718 zhouguangyuan0718 commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

CPU-guarded SIMD functions with slices, strings, structs, arrays or multiple results were excluded from AVX2 function multiversioning. Enable these signatures, including nested SIMD128 values and cross-package direct calls, while retaining the existing cached dispatch and effective CPU-feature policy.

Finish large-aggregate and target ABI lowering before FMV creates dispatchers. This lets musttail calls forward the caller's argument/result storage with the same physical signature and byval/sret attributes. Recognize the ABI-lowered Win64 CPU-query receiver, and identify SIMD128 values nested by value in structs and arrays when promising cross-package variants.

Validation:

  • Preserved a failing baseline: aggregate variant generation failed for all six Linux/macOS/Windows amd64 O0/O2 cases before the change.
  • LLVM verification and target assembly generation at O0/O2 on all three amd64 targets, including single-vector wrappers, multiple results and arrays larger than 64 KiB. Checks require matching tail-call signatures, unchanged forwarded operands, preserved ABI attributes and no dispatcher-owned temporaries.
  • Compiler, C ABI, FMV, SSA and aggregate-lowering unit suites; macOS arm64 SIMD O0/O2 regression suite.
  • Linux amd64 (Docker) and Windows amd64 (MinGW/Wine): complete SIMD suite at O0, O2, ThinLTO and FullLTO, followed by FMV tests under cpu.avx2=off, cpu.avx=off, cpu.fma=off and cpu.all=off for every binary. Runtime coverage includes initialization, value-copy isolation, overlapping input/result assignments, cross-package calls, indirect entries, closures and stack traces.

The initial Go CI failures came from lib/c importing its 128-bit integer implementation through c/types, which pulled math/big/fmt and LLGo runtime dependencies into the runtime-free fixtures. Rebased onto main 02f07cee7 with goplus/lib v0.6.3, which removes that dependency from the base C bindings. Both previously failing tests (TestPCLNExternalPureCLibraryIdentityRetentionIntegration and TestRuntimeFreeNativeMetadata, off/full) now pass, together with all SIMD LLVM/assembly cases. The SIMD patch is unchanged by the rebase; no assertions or tests were disabled.

The full short compiler/build suites and complete macOS arm64, Linux amd64 and Windows/Wine SIMD matrices above pass on 0a7d9ae96. Commit 7472773d4 adds boundary tests for malformed CPU-query signatures and aggregates whose layout is not yet defined; the FMV unit suite passes, and compiler implementation files are unchanged. Codecov reports 100% patch coverage against a 95.46% target.

Hosted validation completed for the preceding head 7472773d411fd7f7d0417312a5f3e0c3e59117d6: all 12 workflows succeeded, with 102 successful checks and the release step skipped as expected for a pull request. This includes the complete Linux, macOS, Windows MSVC and Windows MinGW Go CI suites, Windows embedded GDB, native Windows amd64/arm64/386 installation tests, and release artifact validation.

Review refinements in ecfa13fd1 defer visited-type map creation until an aggregate is traversed, restrict intrinsic lookup to bodyless functions with vector signatures, clarify the query-root test diagnostic, and identify dispatcher allocations by LLVM instruction kind. CPU-query marking remains independent of vector signatures. The targeted compiler SIMD, build SIMD/FMV, and query/aggregate boundary tests all pass; that head subsequently had five Go workflow failures from the stale native-debug SSA test APIs in the PR merge baseline.

This continues #2748 and remains limited to amd64 AVX2 specialization of SIMD128 code; it does not add SIMD256/512 or arbitrary feature combinations. Windows native execution remains covered by hosted CI rather than the local Wine matrix.

Rebased onto current main 1bbfc1f75db405854cfc3c49ed8104c0741c2231 (successful main Go workflow) at head 8fbd3c2e1fa6fe621cf0f610c9337fbe1e2bb853. All three commits are patch-equivalent according to git range-diff. Full internal/llvmfmv, internal/cabi, and ssa tests passed after rebase, together with compiler/build SIMD tests, the three-target aggregate LLVM/assembly matrix, and runtime-elision regressions. Hosted CI completed successfully for this exact head: 102 successful checks and one release step skipped as expected for a pull request.

This is an earlier roadmap step, but #2802's portable bridge primitives are an independent change based directly on main; #2802 does not require this PR to compile or pass its own tests.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: aggregate signatures in AVX2 multiversioning

Solid, carefully-reasoned change. Four review passes (code quality, performance, security, documentation accuracy) found no correctness, memory-safety, or ABI defects, and no stale documentation.

What I verified holds up:

  • Pipeline reorder (internal/build/build.go compilePackageModule): moving llvmfmv.Run to after lowerLargeAggregates + TransformModule correctly makes musttail dispatchers forward the caller's already-lowered byval/sret storage instead of materializing an aggregate in a forwarding frame the tail jump releases. No post-FMV amd64 pass re-materializes aggregates (lowerWasmAggregateCopies is a no-op off wasm). assertAggregateTailForwarding is a strong regression guard (rejects alloca, non-musttail, lost byval/sret).
  • Recursive type walks in cl/simd_fmv.go (check) and internal/llvmfmv/fmv.go (supportedType) are correctly bounded: the seen map + hasVector short-circuit + by-value-only descent prevent infinite recursion, and opaque structs / wider-than-128-bit vector leaves are rejected.
  • isQuery Win64 i32-receiver acceptance stays gated behind the mandatory llgo.cpu.query="x86.avx2" attribute, so a non-query function cannot be misclassified.
  • Docs/comments (fmv.go Run comment, windows_vector.go, test/simd/README.md) all match the new ordering and capability; no leftover "aggregates not yet specialized" wording.

The inline notes below are optional low-severity nits only — nothing blocking.

Additional non-blocking observation (pre-existing code, not changed here): in internal/llvmfmv/fmv.go specialize, query folding only collects CallInst queries, so a query reached via InvokeInst would be left unfolded. The AVX2 query is a pure non-unwinding read never emitted as an invoke today, so this is purely theoretical — mentioning only in case invoke-form queries ever become possible.

Comment thread cl/simd_fmv.go Outdated
hasVector := false
sig := source.Signature
check := func(t types.Type) {
seen := make(map[types.Type]bool)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (compile-time, low): markSIMDFMV runs once per amd64 function (every function in every package). On this path it unconditionally does lookupSIMD(source, "amd64") (line 35) and allocates make(map[types.Type]bool) (line 39), even though the vast majority of signatures contain no struct/array types and the walk visits few or zero types. Consider a cheap pre-filter (skip when the signature has no aggregate/named types) or allocating seen lazily on the first aggregate. Pure overhead on the common path; not blocking.

for _, name := range []string{"main.guarded", "main.array", "main.pair", "main.one", "main.large"} {
fast := mod.NamedFunction(name + ".__llgo_fmv_avx2")
if fast.IsNil() {
t.Fatalf("aggregate function %s has no AVX2 implementation", name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this message (and the loop at ~line 75) calls every entry an "aggregate function", but main.pair is register-only and main.large is a non-SIMD aggregate. They acquire an AVX2 variant because they call the trusted AVX2() query and become FMV roots, not because they carry a vector in their signature. A neutral phrase (e.g. "function %s has no AVX2 implementation") plus a one-line comment distinguishing "root because it calls the query" from "has a vector in its signature" would keep a regression report accurate.


func assertAggregateTailForwarding(t *testing.T, fn llvm.Value) {
t.Helper()
if strings.Contains(fn.String(), "alloca") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: strings.Contains(fn.String(), "alloca") is a string-level heuristic over the IR dump — a future unrelated alloca or a value/metadata name containing that substring would produce a confusing failure. The structural checks below (musttail, matching function type, forwarded params, preserved sret/byval) are the strong assertions. Consider scanning instructions with IsAAllocaInst() to match their rigor. Low priority.

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

LLGo WebAssembly build benchmarks

ecfa13fd1c11 | workflow run | long-term charts

WebAssembly output sizes
Example, profile and compiler Wasm module vs base Generated JS glue vs base
cprintf/j32-emscripten/LLGo 145520 B 0 B / +0.0% 88157 B 0 B / +0.0%
cprintf/j32-goos-js/LLGo 144748 B 0 B / +0.0% 72985 B 0 B / +0.0%
cprintf/j64-emscripten-memory64/LLGo 133220 B 0 B / +0.0% 91328 B 0 B / +0.0%
cprintf/w32-goos-wasip1/LLGo 155244 B 0 B / +0.0% 0 B 0 B / 0.0%
cprintf/w32-wasi/LLGo 155922 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/j32-emscripten/LLGo 2996710 B 0 B / +0.0% 130661 B 0 B / +0.0%
fmtprintf/j32-goos-js/Go 2526852 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/j32-goos-js/LLGo 3091487 B 0 B / +0.0% 102110 B 0 B / +0.0%
fmtprintf/j64-emscripten-memory64/LLGo 2759281 B 0 B / +0.0% 136141 B 0 B / +0.0%
fmtprintf/w32-goos-wasip1/Go 2500019 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/w32-goos-wasip1/LLGo 2341166 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/w32-wasi/LLGo 2337842 B 0 B / +0.0% 0 B 0 B / 0.0%
j32-emscripten/LLGo 145033 B 0 B / +0.0% 88157 B 0 B / +0.0%
j32-goos-js/Go 1895533 B 0 B / +0.0% 0 B 0 B / 0.0%
j32-goos-js/LLGo 144496 B 0 B / +0.0% 72985 B 0 B / +0.0%
j64-emscripten-memory64/LLGo 132773 B 0 B / +0.0% 91328 B 0 B / +0.0%
reflectcall/j32-emscripten/LLGo 1443528 B 0 B / +0.0% 104917 B 0 B / +0.0%
reflectcall/j32-goos-js/Go 2191221 B 0 B / +0.0% 0 B 0 B / 0.0%
reflectcall/j32-goos-js/LLGo 1493265 B 0 B / +0.0% 89743 B 0 B / +0.0%
reflectcall/j64-emscripten-memory64/LLGo 1336084 B 0 B / +0.0% 109492 B 0 B / +0.0%
reflectcall/w32-goos-wasip1/Go 2205707 B 0 B / +0.0% 0 B 0 B / 0.0%
reflectcall/w32-goos-wasip1/LLGo 1271544 B 0 B / +0.0% 0 B 0 B / 0.0%
reflectcall/w32-wasi/LLGo 1269165 B 0 B / +0.0% 0 B 0 B / 0.0%
w32-goos-wasip1/Go 1909947 B 0 B / +0.0% 0 B 0 B / 0.0%
w32-goos-wasip1/LLGo 154918 B 0 B / +0.0% 0 B 0 B / 0.0%
w32-wasi/LLGo 155596 B 0 B / +0.0% 0 B 0 B / 0.0%
LLGo WebAssembly build measurements
Example and profile Build vs base
j32-emscripten 7.360 s -17.44 ms / -0.2% (better)
j32-goos-js 7.212 s +82.23 ms / +1.2% (worse)
j64-emscripten-memory64 6.265 s -35.86 ms / -0.6% (better)
reflectcall/w32-wasi 23.811 s -272.7 ms / -1.1% (better)
w32-goos-wasip1 4.696 s +168.2 ms / +3.7% (worse)
w32-wasi 4.179 s -132.8 ms / -3.1% (better)

Compared with 02f07cee7353 measured in the same runner job.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

LLGo baseline benchmarks

8fbd3c2e1fa6 | workflow run | long-term charts

Program measurements

Platform Workload File size vs base Text size vs base Build vs base Run vs base
Linux cprintf 8568 B 0 B / +0.0% 387 B 0 B / +0.0% 974.714 ms -230.7 ms / -19.1% (better) 1.448 ms -37.83 us / -2.5% (better)
Linux cprintf-lto 8408 B 0 B / +0.0% 368 B 0 B / +0.0% 928.983 ms -294.5 ms / -24.1% (better) 1.363 ms -210.1 us / -13.4% (better)
Linux fmtprintf 4899440 B 0 B / +0.0% 506206 B 0 B / +0.0% 6.605 s -552.6 ms / -7.7% (better) 4.784 ms -1.063 ms / -18.2% (better)
Linux fmtprintf-lto 3620608 B 0 B / +0.0% 444290 B 0 B / +0.0% 16.822 s -1.008 s / -5.7% (better) 4.159 ms +196 us / +4.9% (worse)
Linux println 689472 B 0 B / +0.0% 17095 B 0 B / +0.0% 991.536 ms -222.6 ms / -18.3% (better) 1.740 ms -105 us / -5.7% (better)
Linux println-lto 192696 B 0 B / +0.0% 14484 B 0 B / +0.0% 1.387 s -299.9 ms / -17.8% (better) 1.850 ms -255.6 us / -12.1% (better)
macOS cprintf 50736 B 0 B / +0.0% 4409 B 0 B / +0.0% 721.897 ms +112.3 ms / +18.4% (worse) 2.455 ms +89.92 us / +3.8% (worse)
macOS cprintf-lto 50496 B 0 B / +0.0% 161 B 0 B / +0.0% 716.738 ms +105.5 ms / +17.3% (worse) 2.859 ms +911.2 us / +46.8% (worse)
macOS fmtprintf 1793088 B 0 B / +0.0% 882736 B 0 B / +0.0% 2.965 s +261.3 ms / +9.7% (worse) 26.424 ms -655.3 us / -2.4% (better)
macOS fmtprintf-lto 1362176 B 0 B / +0.0% 766864 B 0 B / +0.0% 7.114 s +968.7 ms / +15.8% (worse) 41.059 ms +3.626 ms / +9.7% (worse)
macOS println 100080 B 0 B / +0.0% 24519 B 0 B / +0.0% 722.395 ms +77.32 ms / +12.0% (worse) 2.982 ms -164.2 us / -5.2% (better)
macOS println-lto 84016 B 0 B / +0.0% 21760 B 0 B / +0.0% 831.253 ms +35.91 ms / +4.5% (worse) 3.028 ms +40.67 us / +1.4% (worse)
Windows MinGW cprintf 660992 B 0 B / +0.0% 4550 B 0 B / +0.0% 1.729 s +59.26 ms / +3.5% (worse) 3.643 ms +10.3 us / +0.3% (worse)
Windows MinGW cprintf-lto 44544 B 0 B / +0.0% 4502 B 0 B / +0.0% 1.747 s +33.44 ms / +2.0% (worse) 3.432 ms -146.9 us / -4.1% (better)
Windows MinGW fmtprintf 5457408 B 0 B / +0.0% 606134 B 0 B / +0.0% 5.591 s +48.73 ms / +0.9% (worse) 10.900 ms -658.5 us / -5.7% (better)
Windows MinGW fmtprintf-lto 4160000 B 0 B / +0.0% 553254 B 0 B / +0.0% 13.177 s -274.7 ms / -2.0% (better) 11.782 ms -47.7 us / -0.4% (better)
Windows MinGW println 716800 B 0 B / +0.0% 25446 B 0 B / +0.0% 1.690 s -1.123 ms / -0.1% (better) 6.516 ms -398.2 us / -5.8% (better)
Windows MinGW println-lto 210944 B 0 B / +0.0% 22326 B 0 B / +0.0% 1.937 s -34.19 ms / -1.7% (better) 6.746 ms -130.8 us / -1.9% (better)
Windows MinGW 386 cprintf 609792 B 0 B / +0.0% 5352 B 0 B / +0.0% 1.080 s -9.314 ms / -0.9% (better) 3.913 ms +548.6 us / +16.3% (worse)
Windows MinGW 386 cprintf-lto 104448 B 0 B / +0.0% 5112 B 0 B / +0.0% 1.064 s -1.179 ms / -0.1% (better) 3.366 ms -52 us / -1.5% (better)
Windows MinGW 386 fmtprintf 4758528 B 0 B / +0.0% 473902 B 0 B / +0.0% 3.437 s -5.798 ms / -0.2% (better) 7.279 ms -1.847 ms / -20.2% (better)
Windows MinGW 386 fmtprintf-lto 4162048 B 0 B / +0.0% 452294 B 0 B / +0.0% 7.998 s -429.2 ms / -5.1% (better) 8.253 ms -315.6 us / -3.7% (better)
Windows MinGW 386 println 663040 B 0 B / +0.0% 21694 B 0 B / +0.0% 1.044 s -42.11 ms / -3.9% (better) 5.627 ms -113.4 us / -2.0% (better)
Windows MinGW 386 println-lto 260608 B 0 B / +0.0% 19514 B 0 B / +0.0% 1.186 s -7.344 ms / -0.6% (better) 5.601 ms -520.2 us / -8.5% (better)
Windows MinGW ARM64 cprintf 671744 B 0 B / +0.0% 4436 B 0 B / +0.0% 1.861 s -61.65 ms / -3.2% (better) 6.199 ms -947 us / -13.3% (better)
Windows MinGW ARM64 cprintf-lto 44032 B 0 B / +0.0% 4388 B 0 B / +0.0% 1.903 s -57.62 ms / -2.9% (better) 6.006 ms -555.2 us / -8.5% (better)
Windows MinGW ARM64 fmtprintf 5367296 B 0 B / +0.0% 514292 B 0 B / +0.0% 5.601 s +189.7 ms / +3.5% (worse) 17.236 ms +2.401 ms / +16.2% (worse)
Windows MinGW ARM64 fmtprintf-lto 4326400 B 0 B / +0.0% 480372 B 0 B / +0.0% 12.306 s +321.9 ms / +2.7% (worse) 15.576 ms +1.522 ms / +10.8% (worse)
Windows MinGW ARM64 println 724480 B 0 B / +0.0% 24160 B 0 B / +0.0% 1.866 s -53.35 ms / -2.8% (better) 10.969 ms -256.6 us / -2.3% (better)
Windows MinGW ARM64 println-lto 218624 B 0 B / +0.0% 21516 B 0 B / +0.0% 2.109 s -69.53 ms / -3.2% (better) 10.500 ms -427.2 us / -3.9% (better)
Windows MSVC cprintf 905216 B 0 B / +0.0% 66003 B 0 B / +0.0% 1.519 s +34.32 ms / +2.3% (worse) 3.679 ms +279.1 us / +8.2% (worse)
Windows MSVC cprintf-lto 292352 B 0 B / +0.0% 65971 B 0 B / +0.0% 1.560 s -36.8 ms / -2.3% (better) 3.643 ms +208.1 us / +6.1% (worse)
Windows MSVC fmtprintf 5757440 B 0 B / +0.0% 701894 B 0 B / +0.0% 5.233 s +40.81 ms / +0.8% (worse) 11.508 ms -231.7 us / -2.0% (better)
Windows MSVC fmtprintf-lto 4483072 B 0 B / +0.0% 652806 B 0 B / +0.0% 11.990 s +8.65 ms / +0.1% (worse) 12.536 ms +399.1 us / +3.3% (worse)
Windows MSVC println 1029120 B 0 B / +0.0% 121334 B 0 B / +0.0% 1.545 s +44.3 ms / +3.0% (worse) 8.065 ms +361.9 us / +4.7% (worse)
Windows MSVC println-lto 531456 B 0 B / +0.0% 118870 B 0 B / +0.0% 1.764 s +16.43 ms / +0.9% (worse) 8.339 ms +1.359 ms / +19.5% (worse)
Windows MSVC 386 cprintf 520704 B 0 B / +0.0% 3947 B 0 B / +0.0% 1.371 s -117.5 ms / -7.9% (better) 7.095 ms +1.781 ms / +33.5% (worse)
Windows MSVC 386 cprintf-lto 44544 B 0 B / +0.0% 3901 B 0 B / +0.0% 1.413 s -3.555 ms / -0.3% (better) 5.332 ms -405.7 us / -7.1% (better)
Windows MSVC 386 fmtprintf 4491776 B 0 B / +0.0% 457314 B 0 B / +0.0% 4.766 s -228.3 ms / -4.6% (better) 13.501 ms -572.4 us / -4.1% (better)
Windows MSVC 386 fmtprintf-lto 3909632 B 0 B / +0.0% 427681 B 0 B / +0.0% 11.581 s -19.06 ms / -0.2% (better) 14.064 ms +164.7 us / +1.2% (worse)
Windows MSVC 386 println 576000 B 0 B / +0.0% 20566 B 0 B / +0.0% 1.410 s +25.08 ms / +1.8% (worse) 10.103 ms +816 us / +8.8% (worse)
Windows MSVC 386 println-lto 200192 B 0 B / +0.0% 18711 B 0 B / +0.0% 1.623 s -16.21 ms / -1.0% (better) 9.861 ms +319.7 us / +3.4% (worse)
Windows MSVC ARM64 cprintf 672768 B 0 B / +0.0% 4240 B 0 B / +0.0% 1.560 s -36.22 ms / -2.3% (better) 6.588 ms +120.4 us / +1.9% (worse)
Windows MSVC ARM64 cprintf-lto 49152 B 0 B / +0.0% 4140 B 0 B / +0.0% 1.574 s -31.53 ms / -2.0% (better) 6.218 ms -400.1 us / -6.0% (better)
Windows MSVC ARM64 fmtprintf 5363712 B 0 B / +0.0% 514164 B 0 B / +0.0% 4.911 s -130.7 ms / -2.6% (better) 15.230 ms -598.2 us / -3.8% (better)
Windows MSVC ARM64 fmtprintf-lto 4333056 B 0 B / +0.0% 480976 B 0 B / +0.0% 11.240 s -189.4 ms / -1.7% (better) 16.312 ms -385.7 us / -2.3% (better)
Windows MSVC ARM64 println 727040 B 0 B / +0.0% 24200 B 0 B / +0.0% 1.547 s -43.41 ms / -2.7% (better) 11.467 ms -752.4 us / -6.2% (better)
Windows MSVC ARM64 println-lto 223232 B 0 B / +0.0% 21688 B 0 B / +0.0% 1.791 s -47.26 ms / -2.6% (better) 11.966 ms -207.1 us / -1.7% (better)
Core language and compiler benchmarks
Platform Benchmark ns/op vs base
Linux BenchmarkLookupPCRandom 15.320 ns/op +0.47 ns/op / +3.2% (worse)
Linux BenchmarkMergeCompilerFlags 210.300 ns/op -6.4 ns/op / -3.0% (better)
Linux BenchmarkMergeLinkerFlags 166.600 ns/op +14.5 ns/op / +9.5% (worse)
Linux BenchmarkChannelBuffered 55.260 ns/op +0.06 ns/op / +0.1% (worse)
Linux BenchmarkChannelHandoff 12858 ns/op -272 ns/op / -2.1% (better)
Linux BenchmarkDefer 49.040 ns/op -1.57 ns/op / -3.1% (better)
Linux BenchmarkDirectCall 1.169 ns/op +0.002 ns/op / +0.2% (worse)
Linux BenchmarkGlobalRead 1.177 ns/op -0.024 ns/op / -2.0% (better)
Linux BenchmarkGlobalWrite 7.765 ns/op -0.011 ns/op / -0.1% (better)
Linux BenchmarkGoroutine 30157 ns/op +3515 ns/op / +13.2% (worse)
Linux BenchmarkInterfaceCall 5.855 ns/op +0.026 ns/op / +0.4% (worse)
Linux BenchmarkRuntimeGetG 2.347 ns/op -0.01 ns/op / -0.4% (better)
macOS BenchmarkLookupPCRandom 12.020 ns/op +1.76 ns/op / +17.2% (worse)
macOS BenchmarkMergeCompilerFlags 96.800 ns/op +15.31 ns/op / +18.8% (worse)
macOS BenchmarkMergeLinkerFlags 65.850 ns/op +10.89 ns/op / +19.8% (worse)
macOS BenchmarkChannelBuffered 22.800 ns/op -0.47 ns/op / -2.0% (better)
macOS BenchmarkChannelHandoff 12504 ns/op -806 ns/op / -6.1% (better)
macOS BenchmarkDefer 33.330 ns/op -0.97 ns/op / -2.8% (better)
macOS BenchmarkDirectCall 1.049 ns/op +0.0993 ns/op / +10.5% (worse)
macOS BenchmarkGlobalRead 1.079 ns/op +0.1174 ns/op / +12.2% (worse)
macOS BenchmarkGlobalWrite 1.081 ns/op +0.0985 ns/op / +10.0% (worse)
macOS BenchmarkGoroutine 38853 ns/op -1388 ns/op / -3.4% (better)
macOS BenchmarkInterfaceCall 3.903 ns/op +0.102 ns/op / +2.7% (worse)
macOS BenchmarkRuntimeGetG 2 ns/op +0.102 ns/op / +5.4% (worse)
Windows MinGW BenchmarkLookupPCRandom 13.130 ns/op +0.17 ns/op / +1.3% (worse)
Windows MinGW BenchmarkMergeCompilerFlags 622 ns/op +13.3 ns/op / +2.2% (worse)
Windows MinGW BenchmarkMergeLinkerFlags 544.600 ns/op +12.9 ns/op / +2.4% (worse)
Windows MinGW BenchmarkChannelBuffered 29.570 ns/op +0.1 ns/op / +0.3% (worse)
Windows MinGW BenchmarkChannelHandoff 1104 ns/op -21 ns/op / -1.9% (better)
Windows MinGW BenchmarkDefer 54.270 ns/op +1.14 ns/op / +2.1% (worse)
Windows MinGW BenchmarkDirectCall 1.547 ns/op -0.003 ns/op / -0.2% (better)
Windows MinGW BenchmarkGlobalRead 1.547 ns/op -0.005 ns/op / -0.3% (better)
Windows MinGW BenchmarkGlobalWrite 2.469 ns/op -0.003 ns/op / -0.1% (better)
Windows MinGW BenchmarkGoroutine 95625 ns/op +990 ns/op / +1.0% (worse)
Windows MinGW BenchmarkInterfaceCall 8.373 ns/op -0.003 ns/op / -0.03582% (better)
Windows MinGW BenchmarkRuntimeGetG 2.480 ns/op +0.003 ns/op / +0.1% (worse)
Windows MinGW 386 BenchmarkLookupPCRandom 15.880 ns/op +0.45 ns/op / +2.9% (worse)
Windows MinGW 386 BenchmarkMergeCompilerFlags 366.600 ns/op -17.1 ns/op / -4.5% (better)
Windows MinGW 386 BenchmarkMergeLinkerFlags 365.400 ns/op -6.2 ns/op / -1.7% (better)
Windows MinGW 386 BenchmarkChannelBuffered 36.460 ns/op +1.26 ns/op / +3.6% (worse)
Windows MinGW 386 BenchmarkChannelHandoff 598.200 ns/op -26.3 ns/op / -4.2% (better)
Windows MinGW 386 BenchmarkDefer 25.930 ns/op +1.11 ns/op / +4.5% (worse)
Windows MinGW 386 BenchmarkDirectCall 0.935 ns/op +0.0473 ns/op / +5.3% (worse)
Windows MinGW 386 BenchmarkGlobalRead 0.928 ns/op +0.0308 ns/op / +3.4% (worse)
Windows MinGW 386 BenchmarkGlobalWrite 8.309 ns/op +0.261 ns/op / +3.2% (worse)
Windows MinGW 386 BenchmarkGoroutine 55247 ns/op +437 ns/op / +0.8% (worse)
Windows MinGW 386 BenchmarkInterfaceCall 4.669 ns/op +0.109 ns/op / +2.4% (worse)
Windows MinGW 386 BenchmarkRuntimeGetG 0.977 ns/op +0.0345 ns/op / +3.7% (worse)
Windows MinGW ARM64 BenchmarkLookupPCRandom 12.080 ns/op 0 ns/op / +0.0%
Windows MinGW ARM64 BenchmarkMergeCompilerFlags 564.800 ns/op -6 ns/op / -1.1% (better)
Windows MinGW ARM64 BenchmarkMergeLinkerFlags 531.200 ns/op +1.9 ns/op / +0.4% (worse)
Windows MinGW ARM64 BenchmarkChannelBuffered 37.690 ns/op +0.35 ns/op / +0.9% (worse)
Windows MinGW ARM64 BenchmarkChannelHandoff 2884 ns/op +61 ns/op / +2.2% (worse)
Windows MinGW ARM64 BenchmarkDefer 53.670 ns/op +1.01 ns/op / +1.9% (worse)
Windows MinGW ARM64 BenchmarkDirectCall 0.590 ns/op -0.0001 ns/op / -0.01696% (better)
Windows MinGW ARM64 BenchmarkGlobalRead 0.590 ns/op +0.0006 ns/op / +0.1% (worse)
Windows MinGW ARM64 BenchmarkGlobalWrite 0.738 ns/op -0.0003 ns/op / -0.04066% (better)
Windows MinGW ARM64 BenchmarkGoroutine 60519 ns/op +2884 ns/op / +5.0% (worse)
Windows MinGW ARM64 BenchmarkInterfaceCall 4.145 ns/op -0.007 ns/op / -0.2% (better)
Windows MinGW ARM64 BenchmarkRuntimeGetG 1.800 ns/op +0.001 ns/op / +0.1% (worse)
Windows MSVC BenchmarkLookupPCRandom 13.150 ns/op -0.02 ns/op / -0.2% (better)
Windows MSVC BenchmarkMergeCompilerFlags 610.200 ns/op -6.5 ns/op / -1.1% (better)
Windows MSVC BenchmarkMergeLinkerFlags 536.500 ns/op -10.6 ns/op / -1.9% (better)
Windows MSVC BenchmarkChannelBuffered 29.790 ns/op +0.02 ns/op / +0.1% (worse)
Windows MSVC BenchmarkChannelHandoff 1195 ns/op +2 ns/op / +0.2% (worse)
Windows MSVC BenchmarkDefer 56.200 ns/op -0.08 ns/op / -0.1% (better)
Windows MSVC BenchmarkDirectCall 1.546 ns/op -0.002 ns/op / -0.1% (better)
Windows MSVC BenchmarkGlobalRead 1.548 ns/op +0.001 ns/op / +0.1% (worse)
Windows MSVC BenchmarkGlobalWrite 2.455 ns/op -0.004 ns/op / -0.2% (better)
Windows MSVC BenchmarkGoroutine 92876 ns/op +3177 ns/op / +3.5% (worse)
Windows MSVC BenchmarkInterfaceCall 8.696 ns/op +0.007 ns/op / +0.1% (worse)
Windows MSVC BenchmarkRuntimeGetG 1.859 ns/op -0.001 ns/op / -0.1% (better)
Windows MSVC 386 BenchmarkLookupPCRandom 27.800 ns/op -0.14 ns/op / -0.5% (better)
Windows MSVC 386 BenchmarkMergeCompilerFlags 797.400 ns/op +79.7 ns/op / +11.1% (worse)
Windows MSVC 386 BenchmarkMergeLinkerFlags 725.200 ns/op +11.1 ns/op / +1.6% (worse)
Windows MSVC 386 BenchmarkChannelBuffered 43.750 ns/op +0.1 ns/op / +0.2% (worse)
Windows MSVC 386 BenchmarkChannelHandoff 1010 ns/op +26.1 ns/op / +2.7% (worse)
Windows MSVC 386 BenchmarkDefer 47.340 ns/op -1.38 ns/op / -2.8% (better)
Windows MSVC 386 BenchmarkDirectCall 1.748 ns/op +0.001 ns/op / +0.1% (worse)
Windows MSVC 386 BenchmarkGlobalRead 1.748 ns/op 0 ns/op / +0.0%
Windows MSVC 386 BenchmarkGlobalWrite 8.987 ns/op +0.002 ns/op / +0.02226% (worse)
Windows MSVC 386 BenchmarkGoroutine 93276 ns/op -729 ns/op / -0.8% (better)
Windows MSVC 386 BenchmarkInterfaceCall 9.450 ns/op -0.04 ns/op / -0.4% (better)
Windows MSVC 386 BenchmarkRuntimeGetG 2.129 ns/op +0.024 ns/op / +1.1% (worse)
Windows MSVC ARM64 BenchmarkLookupPCRandom 12.020 ns/op +0.03 ns/op / +0.3% (worse)
Windows MSVC ARM64 BenchmarkMergeCompilerFlags 566.500 ns/op -7 ns/op / -1.2% (better)
Windows MSVC ARM64 BenchmarkMergeLinkerFlags 523 ns/op -10.7 ns/op / -2.0% (better)
Windows MSVC ARM64 BenchmarkChannelBuffered 38.790 ns/op +1.13 ns/op / +3.0% (worse)
Windows MSVC ARM64 BenchmarkChannelHandoff 3085 ns/op +182 ns/op / +6.3% (worse)
Windows MSVC ARM64 BenchmarkDefer 64.070 ns/op +1.69 ns/op / +2.7% (worse)
Windows MSVC ARM64 BenchmarkDirectCall 0.589 ns/op 0 ns/op / +0.0%
Windows MSVC ARM64 BenchmarkGlobalRead 0.590 ns/op -0.0004 ns/op / -0.1% (better)
Windows MSVC ARM64 BenchmarkGlobalWrite 3.750 ns/op +0.001 ns/op / +0.02667% (worse)
Windows MSVC ARM64 BenchmarkGoroutine 56833 ns/op -1519 ns/op / -2.6% (better)
Windows MSVC ARM64 BenchmarkInterfaceCall 4.231 ns/op -0.002 ns/op / -0.04725% (better)
Windows MSVC ARM64 BenchmarkRuntimeGetG 1.770 ns/op +0.001 ns/op / +0.1% (worse)
Timer runtime benchmarks
Platform Operation and runtime ns/op vs base
Linux AfterFuncZeroDelivery/Go 1042 ns/op +40 ns/op / +4.0% (worse)
Linux AfterFuncZeroDelivery/LLGo 47315 ns/op +6214 ns/op / +15.1% (worse)
Linux CreateStop/Go 305.800 ns/op -14.3 ns/op / -4.5% (better)
Linux CreateStop/LLGo 1727 ns/op -325 ns/op / -15.8% (better)
Linux RearmStopped/Go 117.600 ns/op -0.4 ns/op / -0.3% (better)
Linux RearmStopped/LLGo 1337 ns/op -191 ns/op / -12.5% (better)
Linux ResetActive/Go 68.830 ns/op -0.7 ns/op / -1.0% (better)
Linux ResetActive/LLGo 625.800 ns/op -48.5 ns/op / -7.2% (better)
Linux ResetHeap1024/Go 67.390 ns/op +0.22 ns/op / +0.3% (worse)
Linux ResetHeap1024/LLGo 165.600 ns/op -1.6 ns/op / -1.0% (better)
macOS AfterFuncZeroDelivery/Go 393.300 ns/op +16.5 ns/op / +4.4% (worse)
macOS AfterFuncZeroDelivery/LLGo 78015 ns/op +6770 ns/op / +9.5% (worse)
macOS CreateStop/Go 126.300 ns/op +3.3 ns/op / +2.7% (worse)
macOS CreateStop/LLGo 394.200 ns/op -29.7 ns/op / -7.0% (better)
macOS RearmStopped/Go 58.610 ns/op +4.42 ns/op / +8.2% (worse)
macOS RearmStopped/LLGo 303.100 ns/op -30.7 ns/op / -9.2% (better)
macOS ResetActive/Go 40.840 ns/op +1.11 ns/op / +2.8% (worse)
macOS ResetActive/LLGo 149 ns/op -12.8 ns/op / -7.9% (better)
macOS ResetHeap1024/Go 38.700 ns/op +0.97 ns/op / +2.6% (worse)
macOS ResetHeap1024/LLGo 68.020 ns/op +3.76 ns/op / +5.9% (worse)
Windows MinGW AfterFuncZeroDelivery/Go 558.100 ns/op +7.8 ns/op / +1.4% (worse)
Windows MinGW AfterFuncZeroDelivery/LLGo 194273 ns/op +1406 ns/op / +0.7% (worse)
Windows MinGW CreateStop/Go 116.100 ns/op +0.9 ns/op / +0.8% (worse)
Windows MinGW CreateStop/LLGo 493 ns/op +4.9 ns/op / +1.0% (worse)
Windows MinGW RearmStopped/Go 31.240 ns/op -0.34 ns/op / -1.1% (better)
Windows MinGW RearmStopped/LLGo 240.700 ns/op 0 ns/op / +0.0%
Windows MinGW ResetActive/Go 20.090 ns/op +0.06 ns/op / +0.3% (worse)
Windows MinGW ResetActive/LLGo 153.100 ns/op -7.2 ns/op / -4.5% (better)
Windows MinGW ResetHeap1024/Go 20.490 ns/op -0.05 ns/op / -0.2% (better)
Windows MinGW ResetHeap1024/LLGo 119.600 ns/op +2.6 ns/op / +2.2% (worse)
Windows MinGW 386 AfterFuncZeroDelivery/Go 581.100 ns/op -35 ns/op / -5.7% (better)
Windows MinGW 386 AfterFuncZeroDelivery/LLGo 99123 ns/op -2590 ns/op / -2.5% (better)
Windows MinGW 386 CreateStop/Go 160.100 ns/op -1.1 ns/op / -0.7% (better)
Windows MinGW 386 CreateStop/LLGo 349.100 ns/op -35.1 ns/op / -9.1% (better)
Windows MinGW 386 RearmStopped/Go 59.600 ns/op -2.04 ns/op / -3.3% (better)
Windows MinGW 386 RearmStopped/LLGo 249 ns/op +12.8 ns/op / +5.4% (worse)
Windows MinGW 386 ResetActive/Go 29.550 ns/op -0.2 ns/op / -0.7% (better)
Windows MinGW 386 ResetActive/LLGo 690.400 ns/op +348 ns/op / +101.6% (worse)
Windows MinGW 386 ResetHeap1024/Go 28.060 ns/op -1.57 ns/op / -5.3% (better)
Windows MinGW 386 ResetHeap1024/LLGo 105.400 ns/op -1.5 ns/op / -1.4% (better)
Windows MinGW ARM64 AfterFuncZeroDelivery/Go 658.400 ns/op -22.7 ns/op / -3.3% (better)
Windows MinGW ARM64 AfterFuncZeroDelivery/LLGo 142484 ns/op -4479 ns/op / -3.0% (better)
Windows MinGW ARM64 CreateStop/Go 198 ns/op -9.6 ns/op / -4.6% (better)
Windows MinGW ARM64 CreateStop/LLGo 401.100 ns/op -18.4 ns/op / -4.4% (better)
Windows MinGW ARM64 RearmStopped/Go 70.590 ns/op -0.01 ns/op / -0.01416% (better)
Windows MinGW ARM64 RearmStopped/LLGo 221.900 ns/op +3.8 ns/op / +1.7% (worse)
Windows MinGW ARM64 ResetActive/Go 31.040 ns/op +0.08 ns/op / +0.3% (worse)
Windows MinGW ARM64 ResetActive/LLGo 117.600 ns/op -0.2 ns/op / -0.2% (better)
Windows MinGW ARM64 ResetHeap1024/Go 31.060 ns/op -0.03 ns/op / -0.1% (better)
Windows MinGW ARM64 ResetHeap1024/LLGo 111.300 ns/op -0.6 ns/op / -0.5% (better)
Windows MSVC AfterFuncZeroDelivery/Go 556.200 ns/op -1.2 ns/op / -0.2% (better)
Windows MSVC AfterFuncZeroDelivery/LLGo 175922 ns/op -223 ns/op / -0.1% (better)
Windows MSVC CreateStop/Go 115.700 ns/op +1 ns/op / +0.9% (worse)
Windows MSVC CreateStop/LLGo 395.900 ns/op +12.2 ns/op / +3.2% (worse)
Windows MSVC RearmStopped/Go 31.340 ns/op -0.2 ns/op / -0.6% (better)
Windows MSVC RearmStopped/LLGo 223.300 ns/op -9.7 ns/op / -4.2% (better)
Windows MSVC ResetActive/Go 20.030 ns/op -0.14 ns/op / -0.7% (better)
Windows MSVC ResetActive/LLGo 148.100 ns/op -0.4 ns/op / -0.3% (better)
Windows MSVC ResetHeap1024/Go 20.490 ns/op +0.07 ns/op / +0.3% (worse)
Windows MSVC ResetHeap1024/LLGo 119.800 ns/op +2 ns/op / +1.7% (worse)
Windows MSVC 386 AfterFuncZeroDelivery/Go 1021 ns/op +27.3 ns/op / +2.7% (worse)
Windows MSVC 386 AfterFuncZeroDelivery/LLGo 167499 ns/op +1758 ns/op / +1.1% (worse)
Windows MSVC 386 CreateStop/Go 219.300 ns/op +4.9 ns/op / +2.3% (worse)
Windows MSVC 386 CreateStop/LLGo 472.800 ns/op -13.2 ns/op / -2.7% (better)
Windows MSVC 386 RearmStopped/Go 73.490 ns/op +0.41 ns/op / +0.6% (worse)
Windows MSVC 386 RearmStopped/LLGo 322.600 ns/op +10.9 ns/op / +3.5% (worse)
Windows MSVC 386 ResetActive/Go 42.020 ns/op +0.05 ns/op / +0.1% (worse)
Windows MSVC 386 ResetActive/LLGo 1020 ns/op +6 ns/op / +0.6% (worse)
Windows MSVC 386 ResetHeap1024/Go 42.330 ns/op -0.01 ns/op / -0.02362% (better)
Windows MSVC 386 ResetHeap1024/LLGo 171.600 ns/op -3.2 ns/op / -1.8% (better)
Windows MSVC ARM64 AfterFuncZeroDelivery/Go 658 ns/op -12.8 ns/op / -1.9% (better)
Windows MSVC ARM64 AfterFuncZeroDelivery/LLGo 141558 ns/op +1433 ns/op / +1.0% (worse)
Windows MSVC ARM64 CreateStop/Go 194.400 ns/op -13.8 ns/op / -6.6% (better)
Windows MSVC ARM64 CreateStop/LLGo 330.700 ns/op -6 ns/op / -1.8% (better)
Windows MSVC ARM64 RearmStopped/Go 70.530 ns/op -0.05 ns/op / -0.1% (better)
Windows MSVC ARM64 RearmStopped/LLGo 221.800 ns/op -2.1 ns/op / -0.9% (better)
Windows MSVC ARM64 ResetActive/Go 31.070 ns/op -0.02 ns/op / -0.1% (better)
Windows MSVC ARM64 ResetActive/LLGo 109.300 ns/op -0.7 ns/op / -0.6% (better)
Windows MSVC ARM64 ResetHeap1024/Go 31.130 ns/op +0.07 ns/op / +0.2% (worse)
Windows MSVC ARM64 ResetHeap1024/LLGo 116.700 ns/op +0.3 ns/op / +0.3% (worse)

Compared with 1bbfc1f75db4 measured in the same runner job.

@zhouguangyuan0718
zhouguangyuan0718 force-pushed the codex/simd-fmv-aggregates-20261012 branch from ecfa13f to 8fbd3c2 Compare October 13, 2026 14:09
@xushiwei
xushiwei merged commit 4766976 into xgo-dev:main Oct 14, 2026
103 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants