aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm.zig
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-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-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-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-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-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: Improve debug location systemantlilja
Debug locations are no longer emitted twice every time
2024-02-23llvm: revert debug file path resolution changesJacob Young
Fixes test-stack-traces on windows.
2024-02-23llvm: optimize i32 constantsJacob Young
2024-02-23llvm: revert bad cleanupJacob Young
2024-02-22Builder: fix llvm ir value namesJacob Young
Hello world now verifies when not stripped.
2024-02-22LLVM: Set new debug location after inliningantlilja
2024-02-22Builder: support printing metadata in llvm irJacob Young
2024-02-21LLVM Builder: Emit debug vector types with DIVector flagantlilja
2024-02-21LLVM Builder: Rework MetadataString to not rely on Stringantlilja
This fixes a problem where empty strings where not emitted as null. This should also emit a smaller stringtab as all metadata strings were emitted in both the strtab and in the strings block inside the metadata block.
2024-02-21llvm: fix builds that don't link with libllvmJacob Young
2024-02-21LLVM: Remove use of LLVM in Builderantlilja
2024-02-21codegen/llvm: Remove use of DIBuilder and output bin by parsing bitcodeantlilja
2024-02-21LLVM: Emit bitcode even if libllvm is not presentantlilja
2024-02-21LLVM: Make sure child types get added firstantlilja
The LLVM bitcode requires all type references in structs to be to earlier defined types. We make sure types are ordered in the builder itself in order to avoid having to iterate the types multiple times and changing the values of type indicies.
2024-02-20llvm: fix c abi for structs not passed in registersJacob Young
Closes #18916
2024-02-16InternPool: make more use of `NullTerminatedString.Slice`Jacob Young
This should avoid the random pointer invalidation crashes. Closes #18954
2024-02-15llvm: fix lowering of recursive debug infoJacob Young
This change allows recursing over types that are currently being resolved fully with a second pass of forward resolution. Closes #16414
2024-02-12x86_64: implement c abi for bool vectorsJacob Young
2024-02-05compiler: rename value.zig to Value.zigAndrew Kelley
This commit only does the file rename to be friendlier to version control conflicts.
2024-02-05spirv: basic shader supportAli Chraghi
2024-02-02InternPool: use separate key for slicesmlugg
This change eliminates some problematic recursive logic in InternPool, and provides a safer API.
2024-01-29llvm: ensure returned undef is 0xaa bytes when runtime safety is enabledVeikka Tuominen
Closes #13178
2024-01-29Merge pull request #18729 from Vexu/fixesAndrew Kelley
Fix some generic{Reader,Writer} related issues
2024-01-29llvm: revert bad array access optimizationVeikka Tuominen
Closes #18723
2024-01-29llvm: fix alignment of array ptr when bitcasting vectorVeikka Tuominen
Closes #17996
2024-01-16Skip all dbg instructionsocrap7
2024-01-15Sema: fix `@extern` declsJacob Young
Closes #18550