Repository navigation
fix(mir-lower): support recursive packed address-space 3 internal ABI - #1064
Merged
nihalpasham merged 3 commits intoAug 20, 2026
Merged
Conversation
Signed-off-by: Raul Estrada <[email protected]>
The MIR-shape predicate replaced a post-conversion field scan that skipped zero-sized fields before classifying. Restore that parity on the MIR side so a zero-sized non-struct field (e.g. [u8; 0]) does not knock a previously-admitted packed struct out of the ABI lane.
nihalpasham
pushed a commit
that referenced
this pull request
Aug 20, 2026
The docs gate runs `cargo doc` without `--document-private-items`, so it never renders a private item and never checks the intra-doc links in one. #1014 and #1042 cleaned `cuda-macros`, `mir-importer/statement.rs` and the codegen backend's collector; this is one of the four that were left: error: unresolved link to `classify_op` --> crates/llvm-export/src/export/ops.rs:55 `classify_op` is a `macro_rules!` defined further down the same file, at :138. A `macro_rules!` macro is in scope only textually after its definition unless it is exported, so no path resolves from a doc comment above it -- rustdoc says as much: "`macro_rules` named `classify_op` exists in this crate, but it is not in scope at this link's location". It becomes a plain code span, and since the sentence is one step of a four-step contract about this file, it gains "below" so the reference still points somewhere. Three of the four remain. One is `make_disjoint_slice_struct` in `mir-lower/src/convert/ops/aggregate.rs`, which needs only a `crate::convert::types::` prefix; the other two are `MirFieldAddrOp` and `MirArrayElementAddrOp` in `mir-importer/src/translator/rvalue.rs`. Both files are under open pull requests (#1062 and #1064 for the first, #1059 and #1062 for the second), so they are left rather than raced. `--document-private-items` can join the docs gate once they land. Verified: `RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items -p llvm-export` reports one unresolved link on `main` and none with this change. The gate's own invocation passes before and after. fmt clean. Comment-only change. Signed-off-by: Vyncint Ng <[email protected]>
This was referenced Aug 20, 2026
Collaborator
|
nihalpasham
approved these changes
Aug 20, 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.
Closes #1063
Summary
Generalize the packed-AS3 internal device ABI support introduced by #1001 from a single direct shared-pointer leaf to recursive and multi-leaf aggregate shapes.
The internal ABI can now carry packed structs containing:
The function body still operates on the semantic packed aggregate containing AS3 pointers. Internal device arguments continue to use the existing flattened argument ABI. At the return boundary, the existing target-stable storage machinery recursively replaces every admitted AS3 leaf with a generic pointer.
Implementation
This change widens
packed_shared_internal_abi_infowithout duplicating the existing recursive storage/coercion machinery.The classifier now:
target_stable_storage_typeremains responsible for the actual recursive AS3 -> generic storage rewrite.The packed aggregate construction path continues to keep semantic AS3 pointers in SSA and uses the widened classifier only as the admission gate.
Tests
Added coverage for:
Validation performed:
cargo fmt --all -- --checkgit diff --checkcargo test -p mir-lower packed_shared_internal_abi -- --nocapturecargo test -p mir-lower packed_struct_construction_with -- --nocapturecargo test -p mir-lower --all-targetscargo clippy -p mir-lower --all-targets -- -D warningscargo oxide build packed_aggregate_abicargo oxide run packed_aggregate_abicargo oxide run addressof_sharedarraymir-lowerpasses 257 unit tests and 117 lowering tests.The end-to-end
packed_aggregate_abiregression passes onsm_120a, including recursive and multi-leaf packed shared internal ABI coverage.Out of scope
This PR intentionally does not add support for:
Those remain separate follow-up work.