Skip to content

debug: consolidate native DWARF correctness and defaults - #2142

Merged
cpunion merged 13 commits into
xgo-dev:mainfrom
cpunion:codex/dwarf-default-go-compatible
Oct 1, 2026
Merged

cpunion merged 13 commits into
xgo-dev:mainfrom
cpunion:codex/dwarf-default-go-compatible

Conversation

@cpunion

@cpunion cpunion commented Jul 21, 2026 •

Copy link
Copy Markdown
Collaborator

Native builds omit DWARF by default, and explicit debug builds can lose current parameter/local values or reliable Darwin source locations. This PR preserves native DWARF by default and fixes those correctness issues while keeping optimized C ABI parameter-home reuse.

Based directly on main f06143ba2, with no unmerged prerequisites. Implements the native DWARF part of #2154 and #2164; native packaging follows the platform toolchain.

  • Preserve DWARF for native executables and archives, with cmd/link's Darwin c-shared exception. Explicit -w/-w=false takes precedence; ordinary Wasm/embedded defaults remain unchanged.
  • Keep stable O0 parameter homes and current values after assignments. Protect O0 aggregate declarations while retaining O2 parameter-home reuse. Addressable locals retain their real storage at every optimization level.
  • Allocate aggregate debug snapshots once per function, avoiding per-iteration O0 stack growth. Keep map/channel debug locations as pointer values and size map parameter homes as Go values.
  • Fix Darwin PC-line anchors and persistent cold/warm debug-map archive paths.
  • Remove replaced Cgo function-address placeholders and their debug indexes, preventing undefined COFF DWARF relocations. Revisited or absent placeholders no longer create unused C declarations.
  • Preserve current C ABI/module-flag behavior and finite reflection-method reachability when LLVM folds returned string components independently.
  • Add source-debug acceptance under test/debug/native, including exact panic/divide/nil caller locations, O2 inline frames/step-over, and current aggregate local/parameter values after pointer mutation.

Consolidates #2235, #2148, #2157 and #2202 plus the relevant native acceptance from cpunion#140.

Fixes #2206.
Fixes #2115.
Fixes #2119.

Validation for 08d0aef2e:

  • Full C ABI and SSA suites pass; focused CL debug/home and Cgo/GenExtern/Objective-C tests pass.
  • New regressions reproduce the old O2 reuse, competing local snapshot, and missing Cgo-placeholder failures.
  • Actual Apple LLDB native acceptance passes, including the new O2 aggregate assertions and existing panic/inline/step-over checks.
  • The four-contribution combined tree merges without conflicts and passes eight debugger/ABI/browser/SSA Go packages and workflow syntax checks.
  • Earlier platform CI qualified the Windows COFF/Cgo fixes and the native default/explicit-DWARF policy. Fresh PR CI is running for this revision.

The dedicated panic/inline suite is currently a Linux/macOS CI gate. Windows retains runtime LLDB acceptance and TestDWARFPCLNLineSites, but those do not establish the separate panic/inline guarantees; this limit is documented in the native suite README.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@cpunion cpunion changed the title [Based on #2141] build: match cmd/link DWARF defaults [Based on #2141 #2143] build: match cmd/link DWARF defaults Jul 21, 2026
@cpunion
cpunion force-pushed the codex/dwarf-default-go-compatible branch from 4141240 to f227cd8 Compare July 22, 2026 08:00
@cpunion cpunion changed the title [Based on #2141 #2143] build: match cmd/link DWARF defaults [Based on #2141 #2143 #2144 #2145 #2146] build: match cmd/link DWARF defaults Jul 22, 2026
@cpunion cpunion changed the title [Based on #2141 #2143 #2144 #2145 #2146] build: match cmd/link DWARF defaults [Based on #2143 #2144 #2145 #2146] build: match cmd/link DWARF defaults Jul 22, 2026
@cpunion
cpunion force-pushed the codex/dwarf-default-go-compatible branch 3 times, most recently from abf8473 to 703cae6 Compare July 22, 2026 17:01
@cpunion cpunion changed the title [Based on #2143 #2144 #2145 #2146] build: match cmd/link DWARF defaults [Based on #2143 #2145 #2157] build: match cmd/link DWARF defaults Jul 22, 2026
@codecov

codecov Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.19820% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/build/cgo.go 80.00% 1 Missing ⚠️
ssa/decl.go 90.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@cpunion
cpunion force-pushed the codex/dwarf-default-go-compatible branch from adf396b to 9aef2de Compare July 23, 2026 05:08
@cpunion
cpunion force-pushed the codex/dwarf-default-go-compatible branch 2 times, most recently from 723ec11 to 8211f5a Compare July 27, 2026 01:48
@cpunion cpunion changed the title [Based on #2143 #2145 #2157] build: match cmd/link DWARF defaults [Based on #2143 #2157] build: match cmd/link DWARF defaults Jul 27, 2026
@cpunion
cpunion force-pushed the codex/dwarf-default-go-compatible branch 2 times, most recently from 8e466a2 to e00bb4f Compare July 29, 2026 22:54
@cpunion cpunion changed the title [Based on #2143 #2157] build: match cmd/link DWARF defaults [Based on #2157] build: match cmd/link DWARF defaults Jul 29, 2026
@cpunion
cpunion marked this pull request as ready for review July 30, 2026 02:50

@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: match cmd/link DWARF defaults

This is a well-structured change. Making DWARF preserved by default is cleanly factored in internal/build/link_options.go, the -s implies -w precedence is order-independent and matches cmd/link, and the ripple effect of DWARF now being on by default (SSA DebugRefs present) is handled consistently through nonDebugReferrers and explicit *ssa.DebugRef handling. Test coverage of the new policy branches is thorough. Security is fine — the acceptance tests use t.TempDir() and constant source templates, and defaulting DWARF on matches Go's own cmd/link behavior.

A few findings below; the inline comment is the only code-level item, the rest are stale docs.

Findings

1. Stale design doc — DWARF default is now inverted
doc/design/pclntab-packaging.md:28-64 still documents the removed policy: "LLGo temporarily omits DWARF by default … LLGo currently behaves as if -w=true", ModeGen framing, and "Broad CI uses the DWARF-free default". After this PR, linked builds emit DWARF unless -w/-s is passed (only Darwin c-shared defaults to omit). This section should be rewritten to the Go-standard default; otherwise the primary design doc for this feature contradicts the shipped behavior.

2. Stale design doc — Darwin builds are no longer "site-free"
doc/design/pclntab-packaging.md:138-142 still says "Darwin embedded builds that emit DWARF keep the historical site-free path". This PR splits site emission: shouldEmitRuntimePCLineSites no longer consults DWARF (Darwin DWARF builds now do emit PC-line sites), and only shouldEmitRuntimeAddressSites suppresses entry/stub address sites on embedded Darwin DWARF. The in-code comments (build.go, funcinfo_table.go) are correct; only this doc is stale. Update it to say PC-line sites are retained and only address sites are suppressed.

See the inline comment for the one code-level note.

Comment thread internal/build/ssa_order_fix.go
@cpunion

cpunion commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Review follow-up after restacking on the updated #2157:

  • doc/design/pclntab-packaging.md now describes DWARF-preserving linked defaults, -s/-w precedence, and Darwin's PC-line versus function-entry address-site policy;
  • the moveInstrsAfter precondition guard and tests are inherited from final debug: keep optimization and SSA rewrites DWARF-safe #2143;
  • defer debug locations were integrated with the existing native/Wasm selector dispatch instead of replacing it.

The focused tests and go test ./... pass.

@github-actions

github-actions Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

LLGo baseline benchmarks

08d0aef2e9e9 | 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 8488 B +1328 B / +18.5% (worse) 387 B 0 B / +0.0% 923.376 ms +378.8 ms / +69.6% (worse) 1.231 ms -99.51 us / -7.5% (better)
Linux cprintf-lto 8312 B +1400 B / +20.3% (worse) 368 B 0 B / +0.0% 976.811 ms +441.5 ms / +82.5% (worse) 1.320 ms +39.13 us / +3.1% (worse)
Linux fmtprintf 4844792 B +3181368 B / +191.3% (worse) 501297 B +2860 B / +0.6% (worse) 7.150 s +3.606 s / +101.7% (worse) 3.019 ms +68.27 us / +2.3% (worse)
Linux fmtprintf-lto 3574864 B +2073696 B / +138.1% (worse) 438141 B +2018 B / +0.5% (worse) 16.176 s +5.553 s / +52.3% (worse) 2.908 ms -74.96 us / -2.5% (better)
Linux println 673736 B +604488 B / +872.9% (worse) 16823 B +18 B / +0.1% (worse) 976.395 ms +429.5 ms / +78.5% (worse) 1.656 ms -12.66 us / -0.8% (better)
Linux println-lto 189472 B +129496 B / +215.9% (worse) 14231 B +22 B / +0.2% (worse) 1.263 s +471.3 ms / +59.6% (worse) 1.707 ms +76.9 us / +4.7% (worse)
macOS cprintf 50672 B -17392 B / -25.6% (better) 4378 B -51 B / -1.2% (better) 1.097 s +187.9 ms / +20.7% (worse) 3.429 ms +576.5 us / +20.2% (worse)
macOS cprintf-lto 50432 B -33856 B / -40.2% (better) 130 B -63 B / -32.6% (better) 960.420 ms -33.26 ms / -3.3% (better) 2.672 ms -570.4 us / -17.6% (better)
macOS fmtprintf 1773280 B +268448 B / +17.8% (worse) 876696 B +1212 B / +0.1% (worse) 6.462 s +2.584 s / +66.6% (worse) 11.440 ms +5.913 ms / +107.0% (worse)
macOS fmtprintf-lto 1360752 B +168048 B / +14.1% (worse) 761868 B -87112 B / -10.3% (better) 15.895 s +5.97 s / +60.2% (worse) 6.635 ms -1.081 ms / -14.0% (better)
macOS println 99136 B -18080 B / -15.4% (better) 24149 B -13416 B / -35.7% (better) 880.343 ms +104.2 ms / +13.4% (worse) 4.015 ms -246.5 us / -5.8% (better)
macOS println-lto 83488 B -35984 B / -30.1% (better) 21400 B -13544 B / -38.8% (better) 1.122 s +46.24 ms / +4.3% (worse) 4.824 ms +570.2 us / +13.4% (worse)
Windows MinGW cprintf 649728 B +630272 B / +3239.5% (worse) 4550 B 0 B / +0.0% 1.804 s +424.1 ms / +30.7% (worse) 4.078 ms +52.4 us / +1.3% (worse)
Windows MinGW cprintf-lto 43520 B +25600 B / +142.9% (worse) 4486 B 0 B / +0.0% 1.870 s +459.3 ms / +32.6% (worse) 4.129 ms +230.5 us / +5.9% (worse)
Windows MinGW fmtprintf 5383168 B +3449856 B / +178.4% (worse) 599990 B +960 B / +0.2% (worse) 7.873 s +3.567 s / +82.9% (worse) 9.638 ms +1.067 ms / +12.5% (worse)
Windows MinGW fmtprintf-lto 4092928 B +2135040 B / +109.0% (worse) 546230 B -1088 B / -0.2% (better) 15.662 s +4.989 s / +46.7% (worse) 9.014 ms -66 us / -0.7% (better)
Windows MinGW println 705024 B +629248 B / +830.4% (worse) 25174 B +32 B / +0.1% (worse) 1.817 s +464.4 ms / +34.3% (worse) 7.610 ms +631.4 us / +9.0% (worse)
Windows MinGW println-lto 208896 B +139776 B / +202.2% (worse) 22038 B +48 B / +0.2% (worse) 2.101 s +504.9 ms / +31.6% (worse) 8.503 ms +1.68 ms / +24.6% (worse)
Windows MinGW 386 cprintf 600576 B +557056 B / +1280.0% (worse) 5326 B 0 B / +0.0% 1.879 s +493.3 ms / +35.6% (worse) 5.807 ms +60 us / +1.0% (worse)
Windows MinGW 386 cprintf-lto 103424 B +82432 B / +392.7% (worse) 5094 B 0 B / +0.0% 1.891 s +436.9 ms / +30.0% (worse) 6.334 ms +541.9 us / +9.4% (worse)
Windows MinGW 386 fmtprintf 4694528 B +2798080 B / +147.5% (worse) 472286 B -176 B / -0.03725% (better) 7.944 s +3.439 s / +76.4% (worse) 11.769 ms -395 us / -3.2% (better)
Windows MinGW 386 fmtprintf-lto 4115456 B +1934336 B / +88.7% (worse) 450806 B -468 B / -0.1% (better) 15.604 s +5.029 s / +47.6% (worse) 12.030 ms +328.2 us / +2.8% (worse)
Windows MinGW 386 println 651776 B +555520 B / +577.1% (worse) 21474 B 0 B / +0.0% 1.884 s +477.1 ms / +33.9% (worse) 10.616 ms +905.5 us / +9.3% (worse)
Windows MinGW 386 println-lto 257536 B +183296 B / +246.9% (worse) 19298 B -36 B / -0.2% (better) 2.179 s +535.1 ms / +32.5% (worse) 10.459 ms +24.1 us / +0.2% (worse)
Windows MinGW ARM64 cprintf 659968 B +641024 B / +3383.8% (worse) 4408 B 0 B / +0.0% 1.960 s +354 ms / +22.1% (worse) 6.562 ms -509.3 us / -7.2% (better)
Windows MinGW ARM64 cprintf-lto 43520 B +25600 B / +142.9% (worse) 4340 B 0 B / +0.0% 1.973 s +333.5 ms / +20.3% (worse) 6.943 ms -267 us / -3.7% (better)
Windows MinGW ARM64 fmtprintf 5294080 B +3474432 B / +190.9% (worse) 510680 B +964 B / +0.2% (worse) 7.235 s +2.848 s / +64.9% (worse) 13.272 ms -34.1 us / -0.3% (better)
Windows MinGW ARM64 fmtprintf-lto 4267520 B +2387456 B / +127.0% (worse) 476932 B +756 B / +0.2% (worse) 13.971 s +4.112 s / +41.7% (worse) 12.756 ms -1.125 ms / -8.1% (better)
Windows MinGW ARM64 println 712192 B +640000 B / +886.5% (worse) 23876 B -8 B / -0.0335% (better) 1.962 s +338.5 ms / +20.8% (worse) 11.922 ms +48.4 us / +0.4% (worse)
Windows MinGW ARM64 println-lto 215552 B +146944 B / +214.2% (worse) 21224 B -8 B / -0.03768% (better) 2.216 s +385.4 ms / +21.1% (worse) 11.975 ms -245.9 us / -2.0% (better)
Windows MSVC cprintf 891904 B +771584 B / +641.3% (worse) 65798 B 0 B / +0.0% 1.365 s +465.2 ms / +51.7% (worse) 2.392 ms +66.8 us / +2.9% (worse)
Windows MSVC cprintf-lto 289280 B +169472 B / +141.5% (worse) 65734 B 0 B / +0.0% 1.233 s +381.8 ms / +44.9% (worse) 2.799 ms +486.1 us / +21.0% (worse)
Windows MSVC fmtprintf 5683200 B +4039680 B / +245.8% (worse) 695542 B +960 B / +0.1% (worse) 5.399 s +2.405 s / +80.3% (worse) 6.830 ms -174.4 us / -2.5% (better)
Windows MSVC fmtprintf-lto 4417024 B +2781696 B / +170.1% (worse) 645782 B -1296 B / -0.2% (better) 11.009 s +3.691 s / +50.4% (worse) 6.936 ms -52.7 us / -0.8% (better)
Windows MSVC println 1016832 B +822272 B / +422.6% (worse) 120838 B +16 B / +0.01324% (worse) 1.214 s +368.3 ms / +43.6% (worse) 5.748 ms -20 us / -0.3% (better)
Windows MSVC println-lto 528384 B +335872 B / +174.5% (worse) 118390 B +32 B / +0.02704% (worse) 1.400 s +274.6 ms / +24.4% (worse) 5.708 ms -786.5 us / -12.1% (better)
Windows MSVC 386 cprintf 512512 B +502784 B / +5168.4% (worse) 3931 B 0 B / +0.0% 1.294 s +227.6 ms / +21.4% (worse) 3.888 ms +137.4 us / +3.7% (worse)
Windows MSVC 386 cprintf-lto 44032 B +34816 B / +377.8% (worse) 3853 B 0 B / +0.0% 1.172 s +292.5 ms / +33.2% (worse) 3.643 ms +169.6 us / +4.9% (worse)
Windows MSVC 386 fmtprintf 4428800 B +3224064 B / +267.6% (worse) 455676 B -176 B / -0.03861% (better) 6.863 s +3.741 s / +119.8% (worse) 8.092 ms +594.5 us / +7.9% (worse)
Windows MSVC 386 fmtprintf-lto 3865600 B +2624000 B / +211.3% (worse) 426379 B -832 B / -0.2% (better) 10.994 s +4.658 s / +73.5% (worse) 7.644 ms -195.6 us / -2.5% (better)
Windows MSVC 386 println 565248 B +528896 B / +1454.9% (worse) 20324 B 0 B / +0.0% 1.309 s +467.1 ms / +55.5% (worse) 6.163 ms -1.36 ms / -18.1% (better)
Windows MSVC 386 println-lto 197632 B +161792 B / +451.4% (worse) 18485 B -80 B / -0.4% (better) 1.859 s +870.2 ms / +88.0% (worse) 8.142 ms +1.654 ms / +25.5% (worse)
Windows MSVC ARM64 cprintf 661504 B +649728 B / +5517.4% (worse) 4192 B 0 B / +0.0% 1.583 s +364.4 ms / +29.9% (worse) 6.906 ms -424.5 us / -5.8% (better)
Windows MSVC ARM64 cprintf-lto 47616 B +36864 B / +342.9% (worse) 4084 B 0 B / +0.0% 1.590 s +335.9 ms / +26.8% (worse) 6.691 ms -243.5 us / -3.5% (better)
Windows MSVC ARM64 fmtprintf 5290496 B +3903488 B / +281.4% (worse) 510616 B +960 B / +0.2% (worse) 6.666 s +2.761 s / +70.7% (worse) 13.376 ms -1.109 ms / -7.7% (better)
Windows MSVC ARM64 fmtprintf-lto 4274176 B +2868736 B / +204.1% (worse) 477604 B +768 B / +0.2% (worse) 12.652 s +3.621 s / +40.1% (worse) 13.427 ms -1.031 ms / -7.1% (better)
Windows MSVC ARM64 println 714240 B +669184 B / +1485.2% (worse) 23908 B 0 B / +0.0% 1.560 s +310.3 ms / +24.8% (worse) 11.949 ms -321.7 us / -2.6% (better)
Windows MSVC ARM64 println-lto 220160 B +177664 B / +418.1% (worse) 21380 B 0 B / +0.0% 1.792 s +371 ms / +26.1% (worse) 11.707 ms -1.118 ms / -8.7% (better)
Core language and compiler benchmarks
Platform Benchmark ns/op vs base
Linux BenchmarkLookupPCRandom 14.540 ns/op -0.17 ns/op / -1.2% (better)
Linux BenchmarkMergeCompilerFlags 198.400 ns/op +4.6 ns/op / +2.4% (worse)
Linux BenchmarkMergeLinkerFlags 137.700 ns/op +11.4 ns/op / +9.0% (worse)
Linux BenchmarkChannelBuffered 55.360 ns/op -0.03 ns/op / -0.1% (better)
Linux BenchmarkChannelHandoff 13503 ns/op +480 ns/op / +3.7% (worse)
Linux BenchmarkDefer 47.950 ns/op +0.97 ns/op / +2.1% (worse)
Linux BenchmarkDirectCall 1.515 ns/op -0.07 ns/op / -4.4% (better)
Linux BenchmarkGlobalRead 1.554 ns/op +0.367 ns/op / +30.9% (worse)
Linux BenchmarkGlobalWrite 7.757 ns/op -0.1 ns/op / -1.3% (better)
Linux BenchmarkGoroutine 24149 ns/op -4986 ns/op / -17.1% (better)
Linux BenchmarkInterfaceCall 6.261 ns/op +0.393 ns/op / +6.7% (worse)
Linux BenchmarkRuntimeGetG 2.976 ns/op -0.027 ns/op / -0.9% (better)
macOS BenchmarkLookupPCRandom 17.490 ns/op +1.31 ns/op / +8.1% (worse)
macOS BenchmarkMergeCompilerFlags 145.600 ns/op +22 ns/op / +17.8% (worse)
macOS BenchmarkMergeLinkerFlags 94.550 ns/op +9.55 ns/op / +11.2% (worse)
macOS BenchmarkChannelBuffered 33.910 ns/op +5.47 ns/op / +19.2% (worse)
macOS BenchmarkChannelHandoff 13346 ns/op +3422 ns/op / +34.5% (worse)
macOS BenchmarkDefer 43.700 ns/op -5.09 ns/op / -10.4% (better)
macOS BenchmarkDirectCall 1.194 ns/op -0.227 ns/op / -16.0% (better)
macOS BenchmarkGlobalRead 1.185 ns/op -0.026 ns/op / -2.1% (better)
macOS BenchmarkGlobalWrite 1.388 ns/op -0.123 ns/op / -8.1% (better)
macOS BenchmarkGoroutine 50452 ns/op +10041 ns/op / +24.8% (worse)
macOS BenchmarkInterfaceCall 4.884 ns/op -0.195 ns/op / -3.8% (better)
macOS BenchmarkRuntimeGetG 2.565 ns/op -1.243 ns/op / -32.6% (better)
Windows MinGW BenchmarkLookupPCRandom 13.160 ns/op +0.01 ns/op / +0.1% (worse)
Windows MinGW BenchmarkMergeCompilerFlags 637.700 ns/op +13.7 ns/op / +2.2% (worse)
Windows MinGW BenchmarkMergeLinkerFlags 553.400 ns/op +10.7 ns/op / +2.0% (worse)
Windows MinGW BenchmarkChannelBuffered 30.750 ns/op -1.18 ns/op / -3.7% (better)
Windows MinGW BenchmarkChannelHandoff 977.100 ns/op -19.9 ns/op / -2.0% (better)
Windows MinGW BenchmarkDefer 59.530 ns/op +0.4 ns/op / +0.7% (worse)
Windows MinGW BenchmarkDirectCall 1.550 ns/op +0.003 ns/op / +0.2% (worse)
Windows MinGW BenchmarkGlobalRead 1.548 ns/op -0.312 ns/op / -16.8% (better)
Windows MinGW BenchmarkGlobalWrite 2.471 ns/op +0.012 ns/op / +0.5% (worse)
Windows MinGW BenchmarkGoroutine 94889 ns/op -8436 ns/op / -8.2% (better)
Windows MinGW BenchmarkInterfaceCall 8.403 ns/op +0.327 ns/op / +4.0% (worse)
Windows MinGW BenchmarkRuntimeGetG 2.484 ns/op +0.309 ns/op / +14.2% (worse)
Windows MinGW 386 BenchmarkLookupPCRandom 26.660 ns/op +0.04 ns/op / +0.2% (worse)
Windows MinGW 386 BenchmarkMergeCompilerFlags 766.500 ns/op -14.1 ns/op / -1.8% (better)
Windows MinGW 386 BenchmarkMergeLinkerFlags 691.200 ns/op -12.9 ns/op / -1.8% (better)
Windows MinGW 386 BenchmarkChannelBuffered 41.360 ns/op +2.62 ns/op / +6.8% (worse)
Windows MinGW 386 BenchmarkChannelHandoff 870.900 ns/op -26.9 ns/op / -3.0% (better)
Windows MinGW 386 BenchmarkDefer 44.410 ns/op -1.73 ns/op / -3.7% (better)
Windows MinGW 386 BenchmarkDirectCall 1.548 ns/op -0.003 ns/op / -0.2% (better)
Windows MinGW 386 BenchmarkGlobalRead 1.555 ns/op +0.002 ns/op / +0.1% (worse)
Windows MinGW 386 BenchmarkGlobalWrite 7.768 ns/op -0.014 ns/op / -0.2% (better)
Windows MinGW 386 BenchmarkGoroutine 110064 ns/op -105 ns/op / -0.1% (better)
Windows MinGW 386 BenchmarkInterfaceCall 8.379 ns/op 0 ns/op / +0.0%
Windows MinGW 386 BenchmarkRuntimeGetG 1.931 ns/op +0.002 ns/op / +0.1% (worse)
Windows MinGW ARM64 BenchmarkLookupPCRandom 12.130 ns/op +0.03 ns/op / +0.2% (worse)
Windows MinGW ARM64 BenchmarkMergeCompilerFlags 580.400 ns/op -1.5 ns/op / -0.3% (better)
Windows MinGW ARM64 BenchmarkMergeLinkerFlags 546.800 ns/op +10.2 ns/op / +1.9% (worse)
Windows MinGW ARM64 BenchmarkChannelBuffered 38.650 ns/op +1.16 ns/op / +3.1% (worse)
Windows MinGW ARM64 BenchmarkChannelHandoff 2300 ns/op -1035 ns/op / -31.0% (better)
Windows MinGW ARM64 BenchmarkDefer 57.280 ns/op +0.64 ns/op / +1.1% (worse)
Windows MinGW ARM64 BenchmarkDirectCall 0.663 ns/op +0.0735 ns/op / +12.5% (worse)
Windows MinGW ARM64 BenchmarkGlobalRead 0.663 ns/op +0.0001 ns/op / +0.01508% (worse)
Windows MinGW ARM64 BenchmarkGlobalWrite 0.737 ns/op +0.074 ns/op / +11.2% (worse)
Windows MinGW ARM64 BenchmarkGoroutine 62591 ns/op -985 ns/op / -1.5% (better)
Windows MinGW ARM64 BenchmarkInterfaceCall 4.148 ns/op +0.009 ns/op / +0.2% (worse)
Windows MinGW ARM64 BenchmarkRuntimeGetG 1.806 ns/op +0.037 ns/op / +2.1% (worse)
Windows MSVC BenchmarkLookupPCRandom 9.686 ns/op +0.046 ns/op / +0.5% (worse)
Windows MSVC BenchmarkMergeCompilerFlags 372 ns/op +1.5 ns/op / +0.4% (worse)
Windows MSVC BenchmarkMergeLinkerFlags 335.500 ns/op +2.8 ns/op / +0.8% (worse)
Windows MSVC BenchmarkChannelBuffered 24.500 ns/op +2.07 ns/op / +9.2% (worse)
Windows MSVC BenchmarkChannelHandoff 1108 ns/op +113.3 ns/op / +11.4% (worse)
Windows MSVC BenchmarkDefer 44.870 ns/op -0.33 ns/op / -0.7% (better)
Windows MSVC BenchmarkDirectCall 1.358 ns/op +0.224 ns/op / +19.8% (worse)
Windows MSVC BenchmarkGlobalRead 1.357 ns/op +0.001 ns/op / +0.1% (worse)
Windows MSVC BenchmarkGlobalWrite 2.166 ns/op 0 ns/op / +0.0%
Windows MSVC BenchmarkGoroutine 56330 ns/op -138 ns/op / -0.2% (better)
Windows MSVC BenchmarkInterfaceCall 7.365 ns/op +0.597 ns/op / +8.8% (worse)
Windows MSVC BenchmarkRuntimeGetG 1.901 ns/op +0.27 ns/op / +16.6% (worse)
Windows MSVC 386 BenchmarkLookupPCRandom 16.220 ns/op +0.14 ns/op / +0.9% (worse)
Windows MSVC 386 BenchmarkMergeCompilerFlags 902.400 ns/op -262.6 ns/op / -22.5% (better)
Windows MSVC 386 BenchmarkMergeLinkerFlags 925.600 ns/op -167.4 ns/op / -15.3% (better)
Windows MSVC 386 BenchmarkChannelBuffered 37.130 ns/op -0.65 ns/op / -1.7% (better)
Windows MSVC 386 BenchmarkChannelHandoff 580.600 ns/op -21.4 ns/op / -3.6% (better)
Windows MSVC 386 BenchmarkDefer 27.440 ns/op +0.11 ns/op / +0.4% (worse)
Windows MSVC 386 BenchmarkDirectCall 0.956 ns/op -0.0112 ns/op / -1.2% (better)
Windows MSVC 386 BenchmarkGlobalRead 0.943 ns/op -0.0219 ns/op / -2.3% (better)
Windows MSVC 386 BenchmarkGlobalWrite 8.784 ns/op +0.215 ns/op / +2.5% (worse)
Windows MSVC 386 BenchmarkGoroutine 55360 ns/op +325 ns/op / +0.6% (worse)
Windows MSVC 386 BenchmarkInterfaceCall 4.959 ns/op +0.146 ns/op / +3.0% (worse)
Windows MSVC 386 BenchmarkRuntimeGetG 1.004 ns/op -0.015 ns/op / -1.5% (better)
Windows MSVC ARM64 BenchmarkLookupPCRandom 12.210 ns/op +0.16 ns/op / +1.3% (worse)
Windows MSVC ARM64 BenchmarkMergeCompilerFlags 554.200 ns/op -7 ns/op / -1.2% (better)
Windows MSVC ARM64 BenchmarkMergeLinkerFlags 527.500 ns/op -6 ns/op / -1.1% (better)
Windows MSVC ARM64 BenchmarkChannelBuffered 37.550 ns/op -0.16 ns/op / -0.4% (better)
Windows MSVC ARM64 BenchmarkChannelHandoff 2549 ns/op -362 ns/op / -12.4% (better)
Windows MSVC ARM64 BenchmarkDefer 59.450 ns/op -1.59 ns/op / -2.6% (better)
Windows MSVC ARM64 BenchmarkDirectCall 0.664 ns/op +0.0743 ns/op / +12.6% (worse)
Windows MSVC ARM64 BenchmarkGlobalRead 0.664 ns/op +0.0007 ns/op / +0.1% (worse)
Windows MSVC ARM64 BenchmarkGlobalWrite 3.797 ns/op +0.055 ns/op / +1.5% (worse)
Windows MSVC ARM64 BenchmarkGoroutine 56911 ns/op -183 ns/op / -0.3% (better)
Windows MSVC ARM64 BenchmarkInterfaceCall 4.138 ns/op -0.015 ns/op / -0.4% (better)
Windows MSVC ARM64 BenchmarkRuntimeGetG 1.811 ns/op +0.04 ns/op / +2.3% (worse)
Timer runtime benchmarks
Platform Operation and runtime ns/op vs base
Linux AfterFuncZeroDelivery/Go 900.100 ns/op -6.6 ns/op / -0.7% (better)
Linux AfterFuncZeroDelivery/LLGo 45349 ns/op +7320 ns/op / +19.2% (worse)
Linux CreateStop/Go 294.100 ns/op +6.3 ns/op / +2.2% (worse)
Linux CreateStop/LLGo 2215 ns/op +359 ns/op / +19.3% (worse)
Linux RearmStopped/Go 115.800 ns/op +1.1 ns/op / +1.0% (worse)
Linux RearmStopped/LLGo 1398 ns/op -121 ns/op / -8.0% (better)
Linux ResetActive/Go 68.660 ns/op +1.25 ns/op / +1.9% (worse)
Linux ResetActive/LLGo 724.900 ns/op +16.1 ns/op / +2.3% (worse)
Linux ResetHeap1024/Go 67.160 ns/op -0.07 ns/op / -0.1% (better)
Linux ResetHeap1024/LLGo 182.300 ns/op +8.3 ns/op / +4.8% (worse)
macOS AfterFuncZeroDelivery/Go 606.100 ns/op +96 ns/op / +18.8% (worse)
macOS AfterFuncZeroDelivery/LLGo 103620 ns/op +17413 ns/op / +20.2% (worse)
macOS CreateStop/Go 182 ns/op +12.4 ns/op / +7.3% (worse)
macOS CreateStop/LLGo 833.700 ns/op +417.3 ns/op / +100.2% (worse)
macOS RearmStopped/Go 78.260 ns/op +5.49 ns/op / +7.5% (worse)
macOS RearmStopped/LLGo 576.600 ns/op +227.1 ns/op / +65.0% (worse)
macOS ResetActive/Go 53.960 ns/op +6.67 ns/op / +14.1% (worse)
macOS ResetActive/LLGo 246.200 ns/op +86.2 ns/op / +53.9% (worse)
macOS ResetHeap1024/Go 50.750 ns/op -9.28 ns/op / -15.5% (better)
macOS ResetHeap1024/LLGo 94.710 ns/op +2.86 ns/op / +3.1% (worse)
Windows MinGW AfterFuncZeroDelivery/Go 571.100 ns/op +11 ns/op / +2.0% (worse)
Windows MinGW AfterFuncZeroDelivery/LLGo 184505 ns/op +1074 ns/op / +0.6% (worse)
Windows MinGW CreateStop/Go 116.900 ns/op -0.3 ns/op / -0.3% (better)
Windows MinGW CreateStop/LLGo 433.100 ns/op -113.9 ns/op / -20.8% (better)
Windows MinGW RearmStopped/Go 31.480 ns/op 0 ns/op / +0.0%
Windows MinGW RearmStopped/LLGo 266 ns/op -12.4 ns/op / -4.5% (better)
Windows MinGW ResetActive/Go 20.180 ns/op +0.02 ns/op / +0.1% (worse)
Windows MinGW ResetActive/LLGo 150.900 ns/op -3.2 ns/op / -2.1% (better)
Windows MinGW ResetHeap1024/Go 20.430 ns/op -0.15 ns/op / -0.7% (better)
Windows MinGW ResetHeap1024/LLGo 124.500 ns/op -1 ns/op / -0.8% (better)
Windows MinGW 386 AfterFuncZeroDelivery/Go 947.100 ns/op -12.6 ns/op / -1.3% (better)
Windows MinGW 386 AfterFuncZeroDelivery/LLGo 206680 ns/op +2494 ns/op / +1.2% (worse)
Windows MinGW 386 CreateStop/Go 196 ns/op -1.6 ns/op / -0.8% (better)
Windows MinGW 386 CreateStop/LLGo 531.600 ns/op +25.7 ns/op / +5.1% (worse)
Windows MinGW 386 RearmStopped/Go 63.920 ns/op +0.53 ns/op / +0.8% (worse)
Windows MinGW 386 RearmStopped/LLGo 372 ns/op +33.1 ns/op / +9.8% (worse)
Windows MinGW 386 ResetActive/Go 39.130 ns/op -0.07 ns/op / -0.2% (better)
Windows MinGW 386 ResetActive/LLGo 1034 ns/op +85.7 ns/op / +9.0% (worse)
Windows MinGW 386 ResetHeap1024/Go 39.570 ns/op +0.17 ns/op / +0.4% (worse)
Windows MinGW 386 ResetHeap1024/LLGo 187.400 ns/op +0.4 ns/op / +0.2% (worse)
Windows MinGW ARM64 AfterFuncZeroDelivery/Go 669.500 ns/op +4.5 ns/op / +0.7% (worse)
Windows MinGW ARM64 AfterFuncZeroDelivery/LLGo 151940 ns/op +1629 ns/op / +1.1% (worse)
Windows MinGW ARM64 CreateStop/Go 212.600 ns/op +12.8 ns/op / +6.4% (worse)
Windows MinGW ARM64 CreateStop/LLGo 364.800 ns/op -1.6 ns/op / -0.4% (better)
Windows MinGW ARM64 RearmStopped/Go 70.560 ns/op -0.03 ns/op / -0.0425% (better)
Windows MinGW ARM64 RearmStopped/LLGo 251.700 ns/op -1.1 ns/op / -0.4% (better)
Windows MinGW ARM64 ResetActive/Go 31.030 ns/op -0.11 ns/op / -0.4% (better)
Windows MinGW ARM64 ResetActive/LLGo 131.500 ns/op +14.6 ns/op / +12.5% (worse)
Windows MinGW ARM64 ResetHeap1024/Go 31.100 ns/op +0.09 ns/op / +0.3% (worse)
Windows MinGW ARM64 ResetHeap1024/LLGo 125.500 ns/op -0.6 ns/op / -0.5% (better)
Windows MSVC AfterFuncZeroDelivery/Go 381.300 ns/op -4.1 ns/op / -1.1% (better)
Windows MSVC AfterFuncZeroDelivery/LLGo 108304 ns/op +1155 ns/op / +1.1% (worse)
Windows MSVC CreateStop/Go 88.920 ns/op -0.89 ns/op / -1.0% (better)
Windows MSVC CreateStop/LLGo 334.200 ns/op -6.1 ns/op / -1.8% (better)
Windows MSVC RearmStopped/Go 24.450 ns/op -0.03 ns/op / -0.1% (better)
Windows MSVC RearmStopped/LLGo 223.700 ns/op +5.9 ns/op / +2.7% (worse)
Windows MSVC ResetActive/Go 14.780 ns/op -0.02 ns/op / -0.1% (better)
Windows MSVC ResetActive/LLGo 109.500 ns/op -4.3 ns/op / -3.8% (better)
Windows MSVC ResetHeap1024/Go 14.770 ns/op -0.09 ns/op / -0.6% (better)
Windows MSVC ResetHeap1024/LLGo 104.800 ns/op +0.9 ns/op / +0.9% (worse)
Windows MSVC 386 AfterFuncZeroDelivery/Go 622.900 ns/op -10.1 ns/op / -1.6% (better)
Windows MSVC 386 AfterFuncZeroDelivery/LLGo 109175 ns/op +2301 ns/op / +2.2% (worse)
Windows MSVC 386 CreateStop/Go 160.300 ns/op -2.4 ns/op / -1.5% (better)
Windows MSVC 386 CreateStop/LLGo 397.800 ns/op +46.6 ns/op / +13.3% (worse)
Windows MSVC 386 RearmStopped/Go 62.470 ns/op +0.14 ns/op / +0.2% (worse)
Windows MSVC 386 RearmStopped/LLGo 239.500 ns/op -2.3 ns/op / -1.0% (better)
Windows MSVC 386 ResetActive/Go 29.760 ns/op -0.08 ns/op / -0.3% (better)
Windows MSVC 386 ResetActive/LLGo 720.700 ns/op -5.7 ns/op / -0.8% (better)
Windows MSVC 386 ResetHeap1024/Go 29.960 ns/op +0.23 ns/op / +0.8% (worse)
Windows MSVC 386 ResetHeap1024/LLGo 116 ns/op -4 ns/op / -3.3% (better)
Windows MSVC ARM64 AfterFuncZeroDelivery/Go 665.100 ns/op -2.2 ns/op / -0.3% (better)
Windows MSVC ARM64 AfterFuncZeroDelivery/LLGo 164063 ns/op +21082 ns/op / +14.7% (worse)
Windows MSVC ARM64 CreateStop/Go 197 ns/op -0.3 ns/op / -0.2% (better)
Windows MSVC ARM64 CreateStop/LLGo 387.100 ns/op +14.1 ns/op / +3.8% (worse)
Windows MSVC ARM64 RearmStopped/Go 70.590 ns/op 0 ns/op / +0.0%
Windows MSVC ARM64 RearmStopped/LLGo 270.800 ns/op 0 ns/op / +0.0%
Windows MSVC ARM64 ResetActive/Go 31.060 ns/op -0.04 ns/op / -0.1% (better)
Windows MSVC ARM64 ResetActive/LLGo 132.800 ns/op 0 ns/op / +0.0%
Windows MSVC ARM64 ResetHeap1024/Go 31.050 ns/op -0.04 ns/op / -0.1% (better)
Windows MSVC ARM64 ResetHeap1024/LLGo 137.200 ns/op -0.9 ns/op / -0.7% (better)

Compared with f06143ba2aac measured in the same runner job.

@cpunion
cpunion force-pushed the codex/dwarf-default-go-compatible branch from 06891a2 to 3cafd6b Compare August 4, 2026 15:02
@cpunion

cpunion commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Restacked on the #2157 CI fix. All nine #2142-only commits remain patch-identical in git range-diff; the updated head inherits findRepoRoot and the focused DWARF/PCLN acceptance test passes.

@cpunion cpunion changed the title [Based on #2157] build: match cmd/link DWARF defaults debug: consolidate native DWARF correctness and defaults Sep 30, 2026
@cpunion
cpunion force-pushed the codex/dwarf-default-go-compatible branch from 5cb4ceb to a7bcb45 Compare September 30, 2026 21:38
@cpunion
cpunion marked this pull request as ready for review September 30, 2026 21:39

@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: DWARF default Go-compatible

Solid PR. The DWARF-by-default / stable-parameter-home / PC-line-site policy changes are well-factored and come with strong test coverage (native LLDB acceptance suite, TestNativeDWARFDefaults, TestDebugParameterHomes, TestParamHomeReusePreservesDebugStorage, and the pcln/link-option tables). The refactors are net improvements — the constructDebugAddr change drops a dead per-variable Load, and collectDebugAllocObjects replaces an O(n) linear scan (hasDebugAlloc) with an O(1) set lookup on the compile hot path.

No correctness or security blockers found. Inline notes below are minor. A few non-inline maintainability suggestions:

  • ssa/di.go — DIParam vs DIParamWithHome: the two exported methods now delegate to the same diParam and differ only in whether the home Expr is returned/discarded. Consider collapsing to one method (callers can ignore the result) to prevent drift.
  • cl/compile.go debugRef: the value-extraction block (v.X.(instrOrValue) → p.bvals[iv] / p.compileValue) is now duplicated across the stable-param and existing branches. Extracting a small helper would keep the two from diverging.
  • cl/debug_alloc.go hasDebugAlloc: after this PR its only remaining caller is the test file (debugParams now uses debugAllocObjects). Consider removing it or marking it test-only so it doesn't read as leftover code.
  • internal/build/link_options.go omitDWARFRequested: the four-level nested boolean (fixed target / wasm / darwin c-shared) is hard to audit; a named defaultsToOmitDWARF(conf) helper or a per-clause comment mapping to the design-doc rationale would help.
  • cmd/llgo/debugtest/native/runtest.sh: paths ($script_dir, artifacts) are string-interpolated into LLDB script/command script import args, which is an eval boundary. Safe for CI-controlled paths, but passing them via env vars read in acceptance.py would be more robust. Not blocking.

Comment thread ssa/package.go Outdated
Comment thread internal/build/pcln_mode.go Outdated
Comment thread doc/design/pclntab-packaging.md Outdated
@cpunion

cpunion commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the five suggestions in the review body in 5955a9c86:

  1. DIParam / DIParamWithHome: retained the existing public DIParam signature for API compatibility, and documented why. Adding a return value would change its method/function type even though direct callers can discard a result. Both wrappers already delegate to the same private diParam implementation, so parameter emission and home creation have one implementation.
  2. Repeated debugRef value lookup: extracted debugRefValue, used by both the stable-home and ordinary debug-reference paths. Missing instruction values still return without rematerializing executable SSA; the same-value/same-block fast path is unchanged.
  3. Test-only hasDebugAlloc: removed it and the redundant assertion. The test still verifies that the parameter is in the actual collectDebugAllocObjects set used by compilation, along with its parameter index.
  4. Nested default-DWARF condition: expanded it into explicit-precedence, typed-default, fixed-target/Wasm, and Darwin c-shared checks, with short rationale comments. Existing ModeGen, -w, and -s behavior is unchanged.
  5. Paths interpolated into LLDB Python: replaced interpolation with environment variables read by the Python acceptance entry point. LLDB executes a fixed runpy command; neither source nor artifact paths become Python source text.

Validation: the existing CL debug-metadata/alloca, SSA parameter/map-location, and build DWARF/default/linker-policy tests pass. Rebuilt the compiler and reran the real native panic/divide/nil plus O2 inline-frame/step-over acceptance with both the source path and temporary artifact directory containing spaces, single quotes, and double quotes; it reports NATIVE_DEBUG_ACCEPTANCE_OK. Shell/Python syntax checks and git diff --check also pass. This cleanup does not change the generated-DWARF or target-default policy.

@cpunion

cpunion commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed the Windows ARM64 MSVC cgofull link failure in b75bcdc28.

The generated __cgo_c_callback / __cgo_go_callback globals are function-address placeholders. Lowering replaced their uses with real functions but retained the old global declarations and debug attachments. With default DWARF, COFF consequently emitted .debug_info relocations to those undefined placeholders.

Lowering now removes the replaced global and its package/debug indexes. The operation is idempotent for alternate cgo source passes and protects shared zero-sized aliases. Real function addresses and DWARF remain enabled.

Validation:

  • The new real-object regression fails on the previous implementation for ARM64 MSVC/GNU, amd64, and 386; all four pass with the fix, retaining .debug_info and the callback-address initializer.
  • Full SSA tests and existing Cgo/GenExtern tests pass.
  • A forced cgofull rebuild and actual execution on macOS arm64 with default DWARF passes Python, struct and errno checks; all four C/Go callback cases return 124.

The new Windows CI run is still required to confirm the original platform end to end. No test or DWARF generation was disabled.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

LLGo WebAssembly build benchmarks

08d0aef2e9e9 | 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 154193 B 0 B / +0.0% 88742 B 0 B / +0.0%
cprintf/j32-goos-js/LLGo 152295 B 0 B / +0.0% 73165 B 0 B / +0.0%
cprintf/j64-emscripten-memory64/LLGo 141248 B 0 B / +0.0% 92630 B 0 B / +0.0%
cprintf/w32-goos-wasip1/LLGo 152848 B 0 B / +0.0% 0 B 0 B / 0.0%
cprintf/w32-wasi/LLGo 153560 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/j32-emscripten/LLGo 3213428 B 0 B / +0.0% 132442 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 3192523 B 0 B / +0.0% 101635 B 0 B / +0.0%
fmtprintf/j64-emscripten-memory64/LLGo 2950033 B 0 B / +0.0% 139285 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 2347351 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/w32-wasi/LLGo 2344013 B 0 B / +0.0% 0 B 0 B / 0.0%
j32-emscripten/LLGo 153428 B 0 B / +0.0% 88742 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 151768 B 0 B / +0.0% 73165 B 0 B / +0.0%
j64-emscripten-memory64/LLGo 140582 B 0 B / +0.0% 92630 B 0 B / +0.0%
reflectcall/j32-emscripten/LLGo 1543771 B 0 B / +0.0% 105908 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 1546222 B 0 B / +0.0% 90331 B 0 B / +0.0%
reflectcall/j64-emscripten-memory64/LLGo 1428426 B 0 B / +0.0% 111641 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 1276693 B 0 B / +0.0% 0 B 0 B / 0.0%
reflectcall/w32-wasi/LLGo 1274301 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 152495 B 0 B / +0.0% 0 B 0 B / 0.0%
w32-wasi/LLGo 153207 B 0 B / +0.0% 0 B 0 B / 0.0%
LLGo WebAssembly build measurements
Example and profile Build vs base
j32-emscripten 6.110 s -202.9 ms / -3.2% (better)
j32-goos-js 5.964 s -216.2 ms / -3.5% (better)
j64-emscripten-memory64 5.324 s -441.3 ms / -7.7% (better)
reflectcall/w32-wasi 25.241 s +1.391 s / +5.8% (worse)
w32-goos-wasip1 4.218 s -53.05 ms / -1.2% (better)
w32-wasi 4.003 s -376.7 ms / -8.6% (better)

Compared with f06143ba2aac measured in the same runner job.

@visualfc visualfc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review

The native DWARF default, O0 parameter homes, Darwin PC-line sites, cgo COFF cleanup, and test isolation look solid. A few issues around default-path cost and cgo revisit handling:

  • P2 reuseParamHome is skipped for every function with a subprogram. Native DWARF is now default, so optimized builds lose param-home reuse too.
  • P2 cgo's __cgo_* fallback still NewFuncs when the placeholder is already gone.
  • P3 alloc-object DebugRefs are suppressed only at O0.
  • P3 native panic/inline acceptance is not run on Windows CI.

Inline notes below.

Comment thread internal/cabi/cabi.go Outdated
Comment thread internal/build/cgo.go
Comment thread cl/compile.go Outdated
Comment thread .github/workflows/llgo.yml
@cpunion
cpunion merged commit 5b1c2c3 into xgo-dev:main Oct 1, 2026
93 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

2 participants