1666 Commits

Author SHA1 Message Date
Jacob Young
69a6f31596 Builder: fix llvm ir value names
Hello world now verifies when not stripped.
2024-02-22 19:10:52 +01:00
antlilja
6cc51d3c33 LLVM: Set new debug location after inlining 2024-02-22 16:07:25 +01:00
antlilja
de536e8473 LLVM Builder: Emit metadata kinds and function metadata attachments 2024-02-22 15:29:28 +01:00
antlilja
92eec8dfec LLVM Builder: Emit type for debug subprogram 2024-02-22 15:24:22 +01:00
Jacob Young
4b215e3a11 Builder: support printing metadata in llvm ir 2024-02-22 08:54:35 +01:00
antlilja
a907353ca4 LLVM Builder: Fix on 32-bit systems 2024-02-22 00:39:56 +01:00
antlilja
53f6071486 LLVM Builder: Emit debug vector types with DIVector flag 2024-02-21 23:33:25 +01:00
antlilja
5e9d0da43b LLVM Builder: Correctly emit debug subranges
The bitcode abbrev was missing the subrange code
2024-02-21 23:32:21 +01:00
antlilja
e57f553c07 LLVM Builder: Rework MetadataString to not rely on String
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-21 21:46:04 +01:00
Jacob Young
48bd0ed7f3 llvm: fix builds that don't link with libllvm 2024-02-21 19:18:34 +01:00
antlilja
713a555aa1 LLVM: Remove unused from llvm/bindings.zig and zig_llvm.h/.cpp 2024-02-21 17:54:00 +01:00
antlilja
f6d275b14e LLVM: Remove use of LLVM in Builder 2024-02-21 17:53:15 +01:00
antlilja
626c3f7959 LLVM Builder: Emit debug info and metadata 2024-02-21 16:24:59 +01:00
antlilja
d35080b792 LLVM: Add Metadata/Debug bitcode IR 2024-02-21 16:24:59 +01:00
antlilja
c11c7a28a3 codegen/llvm: Remove use of DIBuilder and output bin by parsing bitcode 2024-02-21 16:24:59 +01:00
antlilja
c16818d623 Add LLVM bindings for parsing LLVM bitcode 2024-02-21 16:24:59 +01:00
antlilja
d3055480ec LLVM: Emit bitcode even if libllvm is not present 2024-02-21 16:24:59 +01:00
antlilja
049cad4411 LLVM Builder: Add debug locations to instructions 2024-02-21 16:24:59 +01:00
antlilja
a456631e29 LLVM Builder: Add debug/metadata system 2024-02-21 16:24:59 +01:00
antlilja
b4369dfbda LLVM: Add toBitcode to Builder 2024-02-21 16:24:59 +01:00
antlilja
5bd2a7c4d6 LLVM IR specific bitcode 2024-02-21 16:24:59 +01:00
antlilja
2396806165 Add LLVM bitcode writer 2024-02-21 16:24:59 +01:00
antlilja
4653fc4bb4 LLVM Builder: Add dbg.declare and dbg.value intrinsics 2024-02-21 16:24:59 +01:00
antlilja
15029590ee LLVM Builder: Add integer values to more enums fields 2024-02-21 16:24:59 +01:00
antlilja
ec5a433fdf Fix FastMath packed struct
* Added missing legacy field (unused_algebra)
* Made struct correct size (u32 -> u8)
2024-02-21 16:24:59 +01:00
antlilja
7cb8813743 Added value_indices and valueIndex to Function
value_indices keeps track of the value index of
each instruction in the function (i.e skips
instruction which do not have a result)
2024-02-21 16:24:59 +01:00
antlilja
423c2c3a27 Made .block = false in WipFunction.hasResultWip 2024-02-21 16:24:59 +01:00
antlilja
c57b4e70b0 Builder: Add function_attributes_set 2024-02-21 16:24:59 +01:00
antlilja
52e8434022 Added opcode functions to Instruction/Constant.Tag 2024-02-21 16:24:59 +01:00
antlilja
ff76ba64d6 Added values to AtomicRmw.Operation enum fields 2024-02-21 16:24:59 +01:00
antlilja
6df8302be6 Fixed values in AtomicOrdering enum 2024-02-21 16:24:59 +01:00
antlilja
fd3b81f93b LLVM Builder: Add toLlvm helper to Alignment 2024-02-21 16:24:59 +01:00
antlilja
2801bf6400 LLVM Builder: Add strtab helper to String 2024-02-21 16:24:59 +01:00
antlilja
9ccd7158b9 LLVM Builder: Make Type.Simple reflect LLVM codes 2024-02-21 16:24:59 +01:00
antlilja
1d94e9ef83 LLVM: Make sure child types get added first
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-21 16:24:59 +01:00
antlilja
8feae5d2d5 LLVM: Assign correct values to enum/union tags 2024-02-21 16:24:59 +01:00
Jacob Young
ec7293422d llvm: fix c abi for structs not passed in registers
Closes #18916
2024-02-20 23:36:47 +01:00
Jacob Young
97290e0bfc cbe: make more use of InternPool.Index.Slice
Attempts to fix the current CI failures introduced by #18983.
2024-02-19 19:32:06 -08:00
Robin Voetter
dd4d320eb9
Merge pull request #18948 from alichraghi/vector
spirv: use extended instructions whenever possible
2024-02-17 14:01:07 +01:00
Jacob Young
6f08e17229 InternPool: make more use of NullTerminatedString.Slice
This should avoid the random pointer invalidation crashes.

Closes #18954
2024-02-16 00:27:25 -08:00
Ali Chraghi
23b7075656 spirv: add capability to compile with x86_64 backend 2024-02-15 17:28:15 +03:30
Ali Chraghi
44c31194e3 spirv: use extended instructions whenever possible 2024-02-15 17:25:44 +03:30
Jacob Young
6fe90a913a llvm: fix lowering of recursive debug info
This change allows recursing over types that are currently being
resolved fully with a second pass of forward resolution.

Closes #16414
2024-02-15 02:46:18 -08:00
Jacob Young
a9f738e56b x86_64: implement c abi for bool vectors 2024-02-12 05:25:07 +01:00
Ali Chraghi
72bd1cd378 spirv: remove now-redundant isUnused calls from AIR handler functions 2024-02-10 09:50:02 +03:30
Ali Chraghi
5ee96688a7 spirv: emit vectorized operations 2024-02-09 16:40:34 +03:30
Veikka Tuominen
ddcea2cad4
Merge pull request #18857 from alichraghi/shader
spirv: make rusticl the primary testing implementation
2024-02-09 14:11:31 +02:00
Ali Chraghi
37b0aa600a spirv: make rusticl the primary testing implementation 2024-02-09 09:27:08 +03:30
Ali Chraghi
eb2d61d02e spirv: merge construct(Struct/Vector/Array) into constructComposite 2024-02-09 09:27:05 +03:30
Andrew Kelley
3122fd0ba0
Merge pull request #17634 from ianprime0509/type-erased-writer
Add type-erased writer and GenericWriter
2024-02-07 23:52:53 -08:00