Repository navigation
Conversation
Signed-off-by: Raul Estrada <[email protected]>
Collaborator
|
Closing this PR because the packed-AS3 carrier rule is incomplete and can generate wrong code.
A replacement needs to address the full pointer path and include call, block-argument, cast, and projection controls, consistent with the acceptance criteria announced on Discord. |
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 #1036
Summary
Support local materialization and field projections for the deliberately narrow packed-AS3 shape introduced by the internal device ABI work.
Eligible packed locals now use a target-stable carrier representation:
Loads reconstruct the semantic value in the opposite direction.
Field projections from those locals are addressed directly through the carrier slots. An AS3 pointer field therefore physically loads/stores as p0 and is explicitly converted between p0 and p3 at the semantic boundary.
Arbitrary packed-AS3 memory remains fail-closed.
Implementation
Local carrier admission
Add a dedicated
packed_shared_local_storage_infogate for local storage.The local-storage gate is intentionally independent of the internal ABI classifier:
Keeping this gate independent prevents future widening of the internal device ABI classifier from implicitly widening local-storage support.
Local allocation
mir.allocauses the target-stable carrier type for eligible packed-AS3 locals:Whole-value local stores and loads
Stores into compiler-owned carrier locals coerce the semantic packed value to the target-stable storage representation before emitting
llvm.store.Loads use the physical carrier type and reconstruct the semantic packed value after
llvm.load.The existing fail-closed path is preserved for arbitrary packed-AS3 memory.
Field projections
mir.field_addrrecognizes an eligible carrier-backed local and emits a typed GEP through the carrier struct.This keeps field addressing by-slot while preserving the existing rustc byte-offset fallback for ordinary packed aggregates.
For the AS3 field:
The projected load/store path uses operand type history to distinguish the semantic MIR pointee from the physical carrier pointee.
End-to-end regression
Strengthen
packed_aggregate_abisoconsume_packed_sharedactually projects both fields from the returned packed value.The test now:
value.tag;value.ptr;value.ptr;This makes broken carrier-to-semantic reconstruction observable at runtime, while the lowering tests independently cover the inverse projected-store conversion.
Tests
Added lowering coverage for:
Validation performed:
Results:
Out of scope
This PR intentionally does not add support for:
Those remain separate work.