Commit 7d3c0c9
committed
shard sema and codegen across N llvm modules
- ZIG_PARALLEL_SEMA: Sema runs concurrently across worker threads with
per-unit claim/wait, retry-on-dependency-cycle, and per-map mutexes
replacing the global sema_lock for the non-incremental fast path.
- InternPool: thread-safe writers (locked single-field setters, seqlock
on getNav, sorted-shard prelocking for getFunc*Ies, 256 hash shards).
- llvm backend: PartitionSet emits N independent llvm modules in parallel;
cross-shard refs are linkonce_odr; --llvm-codegen-threads=N partitions
by file path; --llvm-no-merge-shards leaves shard .o files unmerged.
- link.MachO -r: handle N shard inputs; emit hidden defs as private-extern;
convert tentatives so Apple ld_new accepts the merged object.
- link.Elf: handle N shard inputs; batch preads in writeRelocatable to
avoid per-atom syscall storm under heavy COMDAT section counts.
- link.Lld: pass all shard paths to lld for elf/coff/wasm.
- std.Build.Step.Compile: llvm_codegen_threads, llvm_no_merge_shards.1 parent 365343a commit 7d3c0c9
File tree
23 files changed
+2735
-573
lines changed- lib/std/Build/Step
- src
- Air
- Zcu
- codegen
- link
- Elf
- MachO
23 files changed
+2735
-573
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
| |||
332 | 337 | | |
333 | 338 | | |
334 | 339 | | |
| 340 | + | |
335 | 341 | | |
336 | 342 | | |
337 | 343 | | |
| |||
739 | 745 | | |
740 | 746 | | |
741 | 747 | | |
742 | | - | |
| 748 | + | |
743 | 749 | | |
744 | 750 | | |
745 | 751 | | |
| |||
858 | 864 | | |
859 | 865 | | |
860 | 866 | | |
| 867 | + | |
861 | 868 | | |
862 | 869 | | |
863 | 870 | | |
| |||
898 | 905 | | |
899 | 906 | | |
900 | 907 | | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
901 | 912 | | |
902 | 913 | | |
903 | 914 | | |
| |||
1419 | 1430 | | |
1420 | 1431 | | |
1421 | 1432 | | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
1422 | 1437 | | |
1423 | 1438 | | |
1424 | 1439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
165 | 170 | | |
166 | 171 | | |
167 | 172 | | |
| |||
1532 | 1537 | | |
1533 | 1538 | | |
1534 | 1539 | | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
1535 | 1543 | | |
1536 | 1544 | | |
1537 | 1545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2154 | 2154 | | |
2155 | 2155 | | |
2156 | 2156 | | |
| 2157 | + | |
2157 | 2158 | | |
2158 | 2159 | | |
2159 | 2160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
13 | 28 | | |
14 | 29 | | |
15 | 30 | | |
| |||
513 | 528 | | |
514 | 529 | | |
515 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
516 | 535 | | |
517 | 536 | | |
518 | 537 | | |
| |||
530 | 549 | | |
531 | 550 | | |
532 | 551 | | |
533 | | - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
534 | 559 | | |
535 | 560 | | |
0 commit comments