Conversation
LLVM 17+ introduced `range` (ConstantRange) and LLVM 20+ introduced `initializes` (ConstantRangeList) attribute kinds that the C API's LLVMIsEnumAttribute/LLVMIsStringAttribute/LLVMIsTypeAttribute do not recognize, causing `Attribute(ref)` to error with "unknown attribute kind". Add LLVMIsConstantRangeAttribute (LLVM >= 17) and LLVMIsConstantRangeListAttribute (LLVM >= 20) to LLVMExtra, expose them in the per-version Julia bindings, and use them to dispatch to new ConstantRangeAttribute and ConstantRangeListAttribute types. Also adds a ConstantRangeAttribute constructor (LLVM >= 19, when LLVMCreateConstantRangeAttribute was upstreamed via llvm/llvm-project#90505) and a test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## master #556 +/- ##
==========================================
- Coverage 86.05% 85.90% -0.15%
==========================================
Files 47 47
Lines 2968 2980 +12
==========================================
+ Hits 2554 2560 +6
- Misses 414 420 +6
🚀 New features to boost your workflow:
|
Delete the attribute after testing it so the subsequent length == 0 check passes on LLVM >= 19. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The function was added to LLVM main in March 2024 (after LLVM 18 branched) and first appeared in LLVM 19.x. Building with LLVM 18 fails because isConstantRangeAttribute() does not exist in that release. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both FunctionAttrSet and CallSiteAttrSet were missing delete! methods for these attribute kinds, causing a MethodError in the test suite. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Upstream PR: llvm/llvm-project#196312
Noticed when trying to run Enzyme on Julia 1.13