Skip to content

[IN] zig-abi: Zig compiler can be built by tcc, a lot of optimizations to fit on target - #13

Merged
matgla merged 4 commits into
mobfrom
zig-abi
Oct 1, 2026
Merged

matgla merged 4 commits into
mobfrom
zig-abi

Conversation

@matgla

@matgla matgla commented Oct 1, 2026

Copy link
Copy Markdown
Owner
  • abi: structs of any size by value (AAPCS32), even-register alignment
  • sra: frame objects to scalars (narrow/wide/partial fields, pointer VARs, whole copies, struct returns, by-value args as words)
  • inline: called-once inlining, small leaves, nested bodies, struct params
  • frame: lifetime-based colouring, slot sharing, relayout, dead objects
  • regalloc: spill-slot reuse, eviction by cost, spill splitting, r8-r11 for call-crossing values, coalescing fixes
  • thumb/arm: LDM/STM copies, UXT/SXT, UMAAL, IT-block MOV, inline atomics, module-local calls keep R9, word-copy stubs, inline const-size copies
  • size: -Os/-Oz size tier, machine outliner, cross-jump tail/case merge, self_store, sret_nrvo, branch narrowing with pool dumps and pads
  • loops: IVSR sliding windows, bottom-test, branch-target alignment, unroll
  • lib: ARMv8-M mem* in assembly, fast 64-bit division
  • frontend: __has_attribute, __has_builtin, overflow builtins, dropped unused statics, fputs/printf lowering, __builtin_unreachable
  • compile time: quadratic passes made linear (zig.c -O2 3m21 -> 47s)
  • build: unity TUs, big files split, dead passes removed, ASan opt-in, device self-compile heap 37.4 -> 5.5 MB
  • YAFF v3/v4 headers; many self-host and Zig-compiler miscompile fixes

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

matgla and others added 4 commits September 30, 2026 22:57
- abi: structs of any size by value (AAPCS32), even-register alignment
- sra: frame objects to scalars (narrow/wide/partial fields, pointer VARs,
  whole copies, struct returns, by-value args as words)
- inline: called-once inlining, small leaves, nested bodies, struct params
- frame: lifetime-based colouring, slot sharing, relayout, dead objects
- regalloc: spill-slot reuse, eviction by cost, spill splitting, r8-r11
  for call-crossing values, coalescing fixes
- thumb/arm: LDM/STM copies, UXT/SXT, UMAAL, IT-block MOV, inline atomics,
  module-local calls keep R9, word-copy stubs, inline const-size copies
- size: -Os/-Oz size tier, machine outliner, cross-jump tail/case merge,
  self_store, sret_nrvo, branch narrowing with pool dumps and pads
- loops: IVSR sliding windows, bottom-test, branch-target alignment, unroll
- lib: ARMv8-M mem* in assembly, fast 64-bit division
- frontend: __has_attribute, __has_builtin, overflow builtins, dropped
  unused statics, fputs/printf lowering, __builtin_unreachable
- compile time: quadratic passes made linear (zig.c -O2 3m21 -> 47s)
- build: unity TUs, big files split, dead passes removed, ASan opt-in,
  device self-compile heap 37.4 -> 5.5 MB
- YAFF v3/v4 headers; many self-host and Zig-compiler miscompile fixes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- unity: groups follow source directories, with large ones cut by hand
  in source/unity/groups.txt, instead of packing by line count; predefine
  headers are generated before gen_unity.
- Free Sym facts that outlive their scope or belong to nested-function
  capture syms (ASan leak in CI building lib/armeabi.c).
- barrel_shift: require a single def and no jump target between the
  shift and its consumer; it runs pre-SSA and miscompiled ctags.
  Test 608_barrel_shift_join_multidef.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
const_local_table now promotes the constant-initialised struct to a
read-only table, the reads fold before entry_store and esp_cleanup never
ran.  Re-storing one field keeps it on the stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every discovery site passed timeout=30, overriding GCCTestCase's
30 * ASAN_TIMEOUT_MULTIPLIER default, so ASan CI got 30 s and
limits-caselabels (21-30 s on the runner) timed out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matgla
matgla merged commit 870f79b into mob Oct 1, 2026
3 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.

1 participant