-
Notifications
You must be signed in to change notification settings - Fork 75
Fix deprecated LLVM Type::getPointerTo() for LLVM 20 compatibility #5576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: crcrpar <16191443+crcrpar@users.noreply.github.com>
|
!build |
Auto-merge Status✅ Internal CI is finished Description
|
| Relevant files | |||
|---|---|---|---|
| Bug fix |
|
PR Reviewer Guide
Here are some key observations to aid the review process:
| 🧪 No relevant tests |
| 🔒 No security concerns identified |
| ⚡ Recommended focus areas for review |
Build Verification Needed
|
Greptile OverviewGreptile SummaryThis PR replaces deprecated LLVM API Changes made:
The new API maintains identical semantics (address space 0) and has been available since LLVM 18.1, which matches the project's minimum LLVM version requirement. The change is consistent with the existing usage in Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Code as nvfuser Code
participant OldAPI as Type::getPointerTo()
participant NewAPI as PointerType::getUnqual()
participant LLVM as LLVM IR Type System
Note over Code,LLVM: Before (LLVM 19 and earlier)
Code->>OldAPI: type->getPointerTo()
OldAPI->>LLVM: Create pointer type (address space 0)
LLVM-->>Code: Return PointerType*
Note over Code,LLVM: After (LLVM 18.1+ compatible, LLVM 20 required)
Code->>NewAPI: PointerType::getUnqual(type)
NewAPI->>LLVM: Create pointer type (address space 0)
LLVM-->>Code: Return PointerType*
Note over Code,LLVM: Changes applied to:
Note over Code,LLVM: 1. getTensorPtrType() - line 138
Note over Code,LLVM: 2. getInt64PtrType() - line 149
Note over Code,LLVM: 3. launch_kernel params - lines 715, 717
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, no comments
|
!test |
|
Would you expect me to merge this or will you merge this? |
We expect authors to merge their changes, but I'll do it for you this time. Good question -- I didn't realize we follow a different convention than Thunder. |
…compatibility Replace PointerType::getUnqual(Type*) with PointerType::getUnqual(LLVMContext&) to fix build errors with newer LLVM versions that have deprecated the typed pointer APIs in favor of opaque pointers. The typed pointer overload `PointerType::getUnqual(Type*)` is deprecated and pending removal. The context-only overload has been available since LLVM 18.1 and maintains identical semantics (address space 0) for opaque pointers. Changes: - jit.cpp: Update getInt8PtrType(), getInt8PtrDynamicArrayType(), getTensorPtrType(), and getInt64PtrType() helper functions - jit_tensor_utils.cpp: Update packTensorArgument() BitCast operations Fixes regression from PR NVIDIA#5576 which only partially addressed the issue by changing Type::getPointerTo() to PointerType::getUnqual(Type*), but that API is also deprecated.
…compatibility Replace PointerType::getUnqual(Type*) with PointerType::getUnqual(LLVMContext&) to fix build errors with newer LLVM versions that have deprecated the typed pointer APIs in favor of opaque pointers. The typed pointer overload `PointerType::getUnqual(Type*)` is deprecated and pending removal. The context-only overload has been available since LLVM 18.1 and maintains identical semantics (address space 0) for opaque pointers. Changes: - jit.cpp: Update getInt8PtrType(), getInt8PtrDynamicArrayType(), getTensorPtrType(), and getInt64PtrType() helper functions - jit_tensor_utils.cpp: Update packTensorArgument() BitCast operations Fixes regression from PR NVIDIA#5576 which only partially addressed the issue by changing Type::getPointerTo() to PointerType::getUnqual(Type*), but that API is also deprecated.
LLVM 20 deprecates
Type::getPointerTo()in favor ofPointerType::getUnqual(), causing compilation failures with-Werror=deprecated-declarations.Changes
Type::getPointerTo()→PointerType::getUnqual()in 4 locations:getTensorPtrType()- opaque struct pointer creationgetInt64PtrType()- int64 pointer type helpercompileFunctionDeclarations()- tensor pointer parameters (2 occurrences)The new API has been available since LLVM 18.1 (project minimum) and maintains identical semantics (address space 0).
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.