fix(cuda_std): pack warp shuffle/match return into i64 for LLVM 19 verifier#391
Draft
brandonros wants to merge 6 commits intoRust-GPU:mainfrom
Draft
fix(cuda_std): pack warp shuffle/match return into i64 for LLVM 19 verifier#391brandonros wants to merge 6 commits intoRust-GPU:mainfrom
brandonros wants to merge 6 commits intoRust-GPU:mainfrom
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collapse the per-LLVM duplication in the build script into a single `LlvmFlavor` struct with two const instances (LLVM7, LLVM19). One `find_llvm_config`, `find_llvm_as`, `configure_libintrinsics`, and `rustc_llvm_build` now drive both toolchain paths; `required_major_llvm_version`, `find_llvm_config_llvm7`, `find_llvm_config_llvm19`, and `find_llvm_as_llvm19` are gone. Functional changes that fall out of the refactor: - Prebuilt LLVM download now works for the `llvm19` feature too, gated on `USE_PREBUILT_LLVM=1` or as an automatic fallback when no LLVM 19 toolchain is found locally. New `PREBUILT_LLVM_URL_LLVM19` points at the `llvm-19.1.7` release tag. - Prebuilt download now supports `linux-x86_64` and `linux-aarch64` in addition to `windows-x86_64`. The "currently disabled because of segfaults" note on Linux x86_64 is gone — the prebuild repos that produce these archives have been refactored to fix the underlying issue. - `PREBUILT_LLVM_URL_LLVM7` retagged to lowercase `llvm-7.1.0/` to match the new release-tag scheme used by the prebuild repos. - `libintrinsics.bc` is no longer checked in; both LLVM versions now assemble `libintrinsics.ll` on the fly using the `llvm-as` that ships next to the resolved `llvm-config`. Removes the only remaining version-specific branch and means the LLVM 7 path can no longer drift silently when the `.ll` changes. The LLVM 7 candidate-search behavior is also slightly stricter: previously `LLVM_CONFIG` only had to literally start with "7" (matching 7, 70, 700...) and a mismatched env var skipped straight to download; now major-version match is exact and PATH `llvm-config` is tried as a fallback before downloading. `USE_PREBUILT_LLVM=1` still forces direct download. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rifier
LLVM 19's verifier rejects the `align N` return-attribute that rustc's
C ABI lowering attaches to calls returning small aggregates like
{ i32, i8 } (align is only valid on pointer returns). Three intrinsic
wrappers in libintrinsics.ll triggered this:
- __nvvm_warp_shuffle
- __nvvm_warp_match_all_32
- __nvvm_warp_match_all_64
Switch their return type from { i32, i8 } to a packed i64 (low 32 bits
= value, bit 32 = predicate). Primitive integer return ⇒ no struct ABI
⇒ no spurious return-attribute. Uses only LLVM 1.0-era IR primitives
(zext/shl/or), so it's safe under both LLVM 7 (CUDA 12.x libnvvm) and
LLVM 19 (CUDA 13.x libnvvm). Removes the now-redundant
WarpShuffleResult struct.
Co-Authored-By: Claude Opus 4.7 (1M context) <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.
if we land #386 this becomes smaller, opening it for now
fixes