Commit Graph

184 Commits

Author SHA1 Message Date
Jacob Young cad594372e llvm: update address space definitions to LLVM 17 2023-09-19 09:37:32 -07:00
Jacob Young 05e01301b0 Builder: further constant select cleanup 2023-09-19 09:37:32 -07:00
Andrew Kelley 6a07b7024a LLVM: update backend to LLVM 17
* LLVMConstSelect is removed (see
   https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179)
 * a couple functions use uint64_t instead of int now which means we
   no longer need `@intCast`.

release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19 09:37:31 -07:00
Andrew Kelley cd8234c3ba update for LLVM 17 new target data
New OSs:
* UEFI
* LiteOS

New ABI:
* OpenHOS

Also update the LLD driver API wrappers.
2023-09-19 09:37:30 -07:00
Jacob Young 4ac20f69ac Revert "llvm: fix bootstrap"
This reverts commit ea72fea1a4.
2023-08-20 12:40:34 -07:00
Jacob Young 1c5c3f499a cmake: fix auto-detection of various host targets
Closes #16800
2023-08-13 11:26:10 -07:00
Jacob Young c4848694d2 llvm: enable even without libllvm linked 2023-08-09 05:47:13 -04:00
Jacob Young 35cd56a369 llvm: fix alias issues 2023-08-08 21:32:50 -04:00
Jacob Young 2bdd180c6f llvm: finish converting globals 2023-08-08 21:32:50 -04:00
Jacob Young 2499d8fb73 Builder: fix enough bugs to pass the behavior tests
without using any information from the LLVM API
2023-08-08 21:32:50 -04:00
Jacob Young a66cd54f94 llvm: cleanup even more unused LLVM API bindings 2023-08-08 21:32:50 -04:00
Jacob Young a0cb03ed99 llvm: finish converting instructions 2023-08-08 21:32:50 -04:00
Jacob Young 49cc1bff08 llvm: finish converting intrinsics 2023-08-08 21:32:50 -04:00
Jacob Young 6577f52614 llvm: convert vector reduction intrinsics
Scratch that thing I said about one pass. :)
2023-08-08 21:32:50 -04:00
Jacob Young e1efd4d3c2 Builder: simplify intrinsic table
This format removes back-references allowing it to be parsed in a single
pass.  It also reduces the number of kinds, simplifying the code.
2023-08-08 21:32:50 -04:00
Jacob Young 5b79f08ee8 llvm: finish converting attributes to use Builder and the C LLVM API 2023-08-08 21:32:50 -04:00
Jacob Young b63d9745b5 llvm: convert intrinsics to using Builder 2023-08-08 21:32:50 -04:00
Jacob Young 3ebf8ce970 Builder: fix builtin pseudo-instruction dumping 2023-08-08 21:32:50 -04:00
Jacob Young f938404a45 Builder: fix attribute spacing 2023-08-08 21:32:50 -04:00
Jacob Young 1c7798a3cd Merge pull request #16705 from antlilja/builder-intrinsics
Implement more intrinsics in new LLVM IR builder API and remove uses of LLVM owns API
2023-08-05 23:05:02 -04:00
Robin Voetter 68f84964b3 llvm: add const addrspace cast 2023-08-05 17:11:57 -07:00
antlilja 86f61a9d26 Implement bitop intrinsics in new LLVM IR builder
* llvm.bitreverse
* llvm.bswap
* llvm.ctpop
* llvm.ctlz
* llvm.cttz
2023-08-06 01:46:57 +02:00
antlilja 63dcffdf9f Implement fp intrinsics in new LLVM IR builder
Intrinsics implemented
* llvm.ceil
* llvm.cos
* llvm.exp
* llvm.exp2
* llvm.fabs
* llvm.floor
* llvm.log
* llvm.log10
* llvm.log2
* llvm.round
* llvm.sin
* llvm.trunc
* llvm.fma
2023-08-06 01:46:51 +02:00
Jacob Young 9e0a34f329 llvm: fix data layout calculation for experimental llvm targets
Closes #16616
2023-08-01 19:20:22 -07:00
Jacob Young 125b453c58 llvm: fix SysV C abi for structs smaller than two eightbytes
Closes #16038
Closes #16288
2023-07-28 19:27:08 -04:00
Andrew Kelley 6cee98eb30 frontend: forbid packed and extern tuples 2023-07-25 21:45:33 -07:00
Jacob G-W 3c08fe931a make @typeInfo not return private decls
fixes #10731
Thanks @nektro for previous work in #14878

This change creates a small breaking change:
It removes the `is_pub` field of a decl in `@typeInfo`
2023-07-25 16:19:08 -07:00
Jacob Young 3fc2e36de2 llvm: convert global assembly 2023-07-23 23:48:19 -04:00
Jacob Young 533111e849 llvm: convert inline assembly
Also, implement TODOs from a previous commit.
2023-07-23 23:48:19 -04:00
Jacob Young aa44f8f0fd llvm: convert attributes and non-intrinsic calls 2023-07-23 23:48:18 -04:00
Andrew Kelley a2d81c547c llvm: fix building for 32-bit targets 2023-07-21 16:37:50 -07:00
Jacob Young 4d31d4d875 llvm: cleanup LLVM IR dumping 2023-07-20 02:44:40 -04:00
Jacob Young a1062c63ca llvm: add Builder trailing extra interface 2023-07-20 01:48:50 -04:00
Jacob Young ea72fea1a4 llvm: fix bootstrap 2023-07-19 23:39:42 -04:00
Jacob Young 9dd7a9eb02 llvm: fix various crashes 2023-07-19 23:38:40 -04:00
Jacob Young 9c4d5e64b4 llvm: minor fixes 2023-07-19 23:38:40 -04:00
Jacob Young 9afb349aba llvm: convert most instructions 2023-07-19 23:38:40 -04:00
Jacob Young ef84e86992 llvm: convert cursor positioning 2023-07-19 23:38:40 -04:00
Jacob Young 3f46e747a8 llvm: convert basic block creation 2023-07-19 23:38:40 -04:00
Jacob Young 8fde3a8f04 llvm: finish converting constants 2023-07-19 23:38:40 -04:00
Jacob Young 1f8407c356 llvm: cleanup management and implement more const functions 2023-07-19 23:38:40 -04:00
Jacob Young 7ec7fe5359 llvm: cleanup init 2023-07-19 23:38:40 -04:00
Jacob Young ff8a49448c llvm: finish converting lowerValue 2023-07-19 23:38:40 -04:00
Jacob Young 2cb52235b9 llvm: convert all calls to constInt 2023-07-19 23:38:40 -04:00
Jacob Young 65fd401c06 llvm: remove more usages of llvm.Type 2023-07-19 23:38:40 -04:00
Jacob Young d167bd4b56 llvm: finish converting lowerType 2023-07-19 23:38:40 -04:00
Jacob Young 3314fd83af llvm: compute data layout without help like a grownup compiler 2023-07-19 23:38:40 -04:00
Jacob Young d195173ba2 llvm: start tracking more things without relying on the llvm api 2023-07-19 23:38:40 -04:00
mlugg f26dda2117 all: migrate code to new cast builtin syntax
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:

* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
2023-06-24 16:56:39 -07:00
kcbanner 9d66481e3d llvm: fixup elem_count argument of ZigLLVMCreateDebugArrayType to be i64
The signature is `getOrCreateSubrange(int64_t  Lo, int64_t  Count)`, so this updates the bindings to match.

This fixes a crash in `lowerDebugTypeImpl` when analyzing slices that have a length of 2^32 or
larger (up to `2^64 >> 3`, which still crashes, because above that the array size in bits overflows u64).
2023-06-23 14:53:17 -07:00