Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR started as a rework of AddrSpacePtr, adding support for it to
pointerset
andpointerref
, but while doing so I realized that (1) it isn't a good fit for Base (e.g. what to do at run-time with non-generic address spaces), and (2) AddrSpacePtr doesn't accurately reflect what this type does: These pointers are lowered to IR in a way that more closely resembles the underlying LLVM pointers:i.e. more than just adding address space information, so it seems better to call it
LLVMPtr
.I also considered lowering them to non-opaque types, i.e.
i64*
in the above example, but LLVM itself seems to be moving away from that it seems better not do. (Linked changes don't fully work)PR also adds an ugly error when using invalid address space typevars -- no way to cleanly emit an error from there.
Open question: add support for
pointerset
/pointerref
withLLVMPtr
s, or keep these intrinsics in e.g. LLVM.jl? They currently live in CUDA.jl: https://github.com/JuliaGPU/CUDA.jl/blob/3af3e3104cc7baae2408598220395eff078e3f28/src/device/pointer.jl#L114-L180Marked for backport so that we don't have the old name in any release.
cc @thomasfaingnaert