Support LLVM 22 and fix diagnostics lifetime#1645
Draft
shi-eric wants to merge 1 commit into
Draft
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change filters Windows linker inputs to ChangesLLVM compatibility and linking
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR updates Warp's LLVM integration for newer external LLVM installs. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "Support LLVM 22 and fix diagnostics life..." | Re-trigger Greptile |
Warp-clang could not compile against LLVM 19 through 22 because upstream API changes were either guarded at the wrong version or not handled. LLVM 21 also exposed a latent diagnostics bug: changing an owned consumer to a non-owning pointer deleted the consumer and retained a dangling pointer. Select the appropriate host-feature and ORC debug APIs by LLVM version. Transfer the diagnostic consumer out of its temporary engine and bind its options to the compiler invocation so both objects outlive compilation. Filter external Windows LLVM directories to .lib files so package metadata does not reach the linker. This keeps the source-build default at LLVM 21.1.0 while allowing externally supplied LLVM 22 installations. Signed-off-by: Eric Shi <ershi@nvidia.com>
5498fff to
d4974dc
Compare
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.
Description
Make
warp-clangcompatible with externally supplied LLVM 22 installations while keeping Warp's source-build default at LLVM 21.1.0. This also fixes a latent diagnostic-consumer use-after-free in the shared LLVM 21+ path.LLVM 22 removed the ORC debug-object APIs Warp used, and LLVM 19 changed the host CPU feature query to return its map by value. On LLVM 21+, the diagnostics setup also deleted its owned
TextDiagnosticPrinterbefore retaining the same pointer as a non-owned client. LLVM 22 on Windows made that dangling pointer reliably visible as a crash during CPU kernel compilation.Changes
takeClient()and bind its options to the compiler invocation for the required lifetime..libfiles so package metadata such as Conan'scomponents.jsonis not passed tolink.exe.Checklist
Unreleasedsection.Validation summary
components.jsonreaches the linker inputs, then passes after the.libfilter is applied.warp.soandwarp-clang.sofrom clean native sources with the bundled LLVM 18.1.3 toolchain and CUDA 13.0.test_modules_lite(6 tests) and the full autodetected Warp suite (14,769 tests, 21 skipped); both passed.warp-clangcompilation, linking, and a CPU JIT smoke kernel.Bug fix
With
warp-clangbuilt against externally supplied LLVM 22 libraries, a CPU kernel compile exercised the dangling diagnostic consumer and crashed before this change. The equivalent smoke kernel now compiles and runs:Summary by CodeRabbit