Repository navigation
Check whether the address of a basic block is taken - #724
Merged
Merged
Conversation
`bb.address_taken` wraps BasicBlock::hasAddressTaken: whether a `blockaddress` constant refers to the block. Since LLVM 23, a `blockaddress` keeps its block in a field rather than as an operand, so this can no longer be derived from the uses of the block. JuliaIR.jl's port of RemoveJuliaAddrspaces needs it to decide, like Julia's pass, whether a function's body has to be cloned instead of moved; it now walks every constant in the module instead.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #724 +/- ##
==========================================
+ Coverage 94.48% 94.50% +0.01%
==========================================
Files 59 59
Lines 8058 8059 +1
==========================================
+ Hits 7614 7616 +2
+ Misses 444 443 -1
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
LLVMGPU_jll contains an LLVMExtra built from an LLVM.jl release, so a change that adds a function to LLVMExtra fails these tests until the JLL is rebuilt. The JLL's README names the LLVM.jl revision it was built from; skip the tests, with a notice, when deps/LLVMExtra differs from that revision.
This was referenced Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds
bb.address_taken, which wrapsBasicBlock::hasAddressTaken: whether ablockaddressconstant refers to the block.JuliaIR.jl's port of Julia's RemoveJuliaAddrspaces needs it. Julia's pass clones a function's body when one of its blocks has its address taken and moves the body otherwise (
src/llvm-remove-addrspaces.cpp). Since LLVM 23, ablockaddresskeeps its block in a field instead of as an operand, so the block's uses no longer show this. Without a wrapper, the port walks every constant in the module looking forblockaddresses. That walk crashed on an LLVM with assertions when it reached inline assembly, which LLVM.jl types as aConstantbut LLVM doesn't treat as aUser(JuliaLLVM/JuliaIR.jl#64, found in JuliaGPU/GPUCompiler.jl#1026). With this property, the port can ask each block, as Julia does.Tests:
test/core.jlchecks the property on theblockaddresstest module. The full suite passes locally on Julia 1.12 (LLVM 18), and withLLVM_TEST_LIBRARYset to a standalone LLVM 23.The second commit skips the CI jobs that test with libLLVMGPU when
deps/LLVMExtradiffers from the LLVM.jl revision that LLVMGPU_jll was built from (its README names that revision), and posts a notice instead. LLVMGPU_jll's LLVMExtra lacks any function added since then, so those jobs failed here and would fail on every PR that adds to LLVMExtra, until the JLL is rebuilt.The last commit bumps LLVMExtra_jll to 0.0.58, built from the first commit, and the version to 10.6.0. LLVMGPU_jll 1.1.0 was built from the same revision, so the libLLVMGPU tests run again.