Repository navigation
test(drop_glue): keep destructor MIR with -Zinline-mir=no, not #[inline(never)] - #1549
Merged
nihalpasham merged 1 commit intoOct 19, 2026
Merged
Conversation
…ne(never)] The compile-only probes put #[inline(never)] on their destructors and empty callees so each destructor's own MIR (a loop, a recursive call, a two-way branch) reaches the importer's no-op proof. verify-code-shape.sh then expects the optimized kernels to show a store followed by a self-loop, which only holds while LLVM inlines those destructors. Once #[inline(never)] is carried to LLVM as noinline, as rustc's own backend does, the destructors stay real PTX functions, the kernels call them, and the check fails. Switch MIR inlining off for this one package instead, the way disjoint_slice_len and kernel_reference_validity do, and drop the attributes. The importer sees the same destructor MIR as before, LLVM may inline as it likes, and the PTX on main is instruction-identical (only block-name comments move). The comments in the script and the README said the attribute was not propagated; they now say why the destructors carry none. Signed-off-by: nihalpasham <nihalp@nvidia.com>
Collaborator
Author
|
/ok to test ae2116b |
This was referenced Oct 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.
What this adds
The
drop_glueexample's compile-only probes used#[inline(never)]on their destructors and empty callees to keep each destructor's own MIR in front of the importer's drop no-op proof, and itsverify-code-shape.shexpects the optimized kernels to show the pre-drop store followed by a self-loop. That only holds while LLVM inlines those destructors anyway, which is true today because the attribute is dropped on the way to LLVM. #1511 carries it asnoinline, so the destructors become real PTX functions and the check fails. The package now switches MIR inlining off instead, the same routedisjoint_slice_lenandkernel_reference_validitytake, and the attributes go.What we fixed
#[inline(never)]is not propagated asnoinlineis replaced by why the destructors carry no attribute.Verification
Checked at
ae2116b6c(nightly-2026-10-11, RTX 5090, CUDA 13.4):cargo oxide run drop_glueon main with this change:SUCCESS: drop glue wrote sentinel in all 256 elements, all nine PASS lines, andverify-code-shape.shpasses for the two diverging probes and the reconverging control.drop_gluefails its check without this change (pre-drop store is not followed by an unconditional self-loop, the kernel calls the destructor instead) and passes with it; thecluster,inline_intentandkernel_reference_validitylanes pass alongside it.cargo fmt --checkandcargo clippy --all-targets -- -D warnings,scripts/sync-example-locks.sh --check(239 locks agree) and the SPDX guard pass.Caveats
RUSTFLAGSentry would fork the shared dependency cache in CI.