aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
AgeCommit message (Collapse)Author
2024-03-11std.builtin: make atomic order fields lowercaseTristan Ross
2024-03-11std.builtin: make global linkage fields lowercaseTristan Ross
2024-03-11std.builtin: make container layout fields lowercaseTristan Ross
2024-03-06Fix incorrectly resolved merge conflictsmlugg
To be honest, I can't be bothered to figure out which commits these changes should be in.
2024-03-06compiler: namespace type equivalence based on AST node + capturesmlugg
This implements the accepted proposal #18816. Namespace-owning types (struct, enum, union, opaque) are no longer unique whenever analysed; instead, their identity is determined based on their AST node and the set of values they capture. Reified types (`@Type`) are deduplicated based on the structure of the type created. For instance, if two structs are created by the same reification with identical fields, layout, etc, they will be the same type. This commit does not produce a working compiler; the next commit, adding captures for decl references, is necessary. It felt appropriate to split this up. Resolves: #18816
2024-03-06InternPool: create specialized functions for loading namespace typesmlugg
Namespace types (`struct`, `enum`, `union`, `opaque`) do not use structural equality - equivalence is based on their Decl index (and soon will change to AST node + captures). However, we previously stored all other information in the corresponding `InternPool.Key` anyway. For logical consistency, it makes sense to have the key only be the true key (that is, the Decl index) and to load all other data through another function. This introduces those functions, by the name of `loadStructType` etc. It's a big diff, but most of it is no-brainer changes. In future, it might be nice to eliminate a bunch of the loaded state in favour of accessor functions on the `LoadedXyzType` types (like how we have `LoadedUnionType.size()`), but that can be explored at a later date.
2024-03-02Merge pull request #19152 from antlilja/llvm-broken-debugAndrew Kelley
LLVM: Fail to emit if LLVM encounters broken debug info
2024-03-02Air: replace `.dbg_inline_*` with `.dbg_inline_block`Jacob Young
This prevents the possibility of not emitting a `.dbg_inline_end` instruction and reduces the allocation requirements of the backends. Closes #19093
2024-03-02LLVM: Fail to emit if LLVM encounters broken debug infoantlilja
2024-03-02LLVM: Add enableBrokenDebugInfoCheck and getBrokenDebugInfoantlilja
These functions allows the caller to find out wether the context encounters broken debug info or not.
2024-02-29codegen: handle dbg_var scoping correctly after eliding more ZIR blocksmlugg
Since we now elide more ZIR blocks in AstGen, care must be taken in codegen to introduce lexical scopes for every body, not just `block`s. Also, elide a few unnecessary AIR blocks in Sema.
2024-02-29LLVM Builder: Fix emission of enum debug enumerator info bitcodeantlilja
2024-02-28LLVM: Don't create a debug lexical block when inliningantlilja
2024-02-28Builder: Implement StrtabString and use it for Global namesantlilja
2024-02-28LLVM: Implement more efficient blob writingantlilja
2024-02-26move Zir to std.zig.ZirAndrew Kelley
Part of an effort to ship more of the compiler in source form.
2024-02-26move Zcu.LazySrcLoc to std.zig.LazySrcLocAndrew Kelley
Part of an effort to ship more of the compiler in source form.
2024-02-26compiler: decide dbg_var scoping based on AIR blocksmlugg
This commit eliminates the `dbg_block_{begin,end}` instructions from both ZIR and AIR. Instead, lexical scoping of `dbg_var_{ptr,val}` instructions is decided based on the AIR block they exist within. This is a much more robust system, and also results in a huge drop in ZIR bytes - around 7% for Sema.zig. This required some enhancements to Sema to prevent elision of blocks when they are required for debug variable scoping. This can be observed by looking at the AIR for the following simple test program with and without `-fstrip`: ```zig export fn f() void { { var a: u32 = 0; _ = &a; } { var a: u32 = 0; _ = &a; } } ``` When `-fstrip` is passed, no AIR blocks are generated. When `-fno-strip` is passed, the ZIR blocks are lowered to true AIR blocks to give correct lexical scoping to the debug vars. The changes here incidentally reolve #19060. A corresponding behavior test has been added. Resolves: #19060
2024-02-26Merge pull request #19083 from antlilja/llvm-blockinfoAndrew Kelley
LLVM reduce size of emitted bitcode
2024-02-25Merge pull request #19080 from jacobly0/llvm-per-mod-stripAndrew Kelley
llvm: implement per-module stripping
2024-02-25Merge pull request #18906 from jacobly0/x86_64-testsAndrew Kelley
x86_64: pass more tests
2024-02-25test: rework how filtering worksJacob Young
* make test names contain the fully qualified name * make test filters match the fully qualified name * allow multiple test filters, where a test is skipped if it does not match any of the specified filters
2024-02-26Builder: Reduce size of DebugLoc abbrevantlilja
2024-02-26Builder: Use BlockInfo block to reduce size of bitcodeantlilja
2024-02-25llvm: free llvm data before running llvm optimizationsJacob Young
This reduces the max memory usage.
2024-02-25llvm: implement per-module strippingJacob Young
This avoids llvm module verification errors when the strip option is different across modules.
2024-02-25Merge pull request #19074 from antlilja/llvm-debug-locJacob Young
Rework LLVM debug locations to not emit them twice
2024-02-25llvm: remork memory management in emitJacob Young
2024-02-25x86_64: implement optional comparisonsJacob Young
Closes #18959
2024-02-25Sema: implement vector coercionsJacob Young
These used to be lowered elementwise in air, and now are a single air instruction that can be lowered elementwise in the backend if necessary.
2024-02-25Builder: Fix llvm ir debug location outputantlilja
2024-02-25Builder: Improve debug location systemantlilja
Debug locations are no longer emitted twice every time
2024-02-24BitcodeWriter: cleanup type widthsJacob Young
2024-02-24Builder: fix bitcode widthsJacob Young
2024-02-24Builder: Emit metadata attachment for globalsantlilja
2024-02-23llvm: revert debug file path resolution changesJacob Young
Fixes test-stack-traces on windows.
2024-02-23Builder: fix inconsequential llvm ir flag syntaxJacob Young
2024-02-23llvm: optimize i32 constantsJacob Young
2024-02-23Builder: fix llvm ir/bc difference with allocasJacob Young
2024-02-23Builder: fix aliases in bitcodeJacob Young
2024-02-23Builder: fix x86_fp80 constants in bitcodeJacob Young
2024-02-23Builder: fix minor llvm ir syntax errorsJacob Young
2024-02-23Builder: implement opaque structs in bitcodeJacob Young
2024-02-23Builder: change tuple metadata to not be inlined in llvm irJacob Young
2024-02-23llvm: revert bad cleanupJacob Young
2024-02-23Builder: fix inconsequential llvm ir metadata syntaxJacob Young
2024-02-23Builder: sync distinct bits with previous implementationJacob Young
2024-02-23LLVM Builder: Make some Metadata no longer be distinctantlilja
2024-02-23LLVM Builder: Formattingantlilja
2024-02-23Builder: fix debug location of the first instruction in a blockJacob Young