Repository navigation
fix(mir-lower): preserve relocations in packed static initializers - #931
Merged
nihalpasham merged 5 commits intoAug 16, 2026
Merged
Conversation
Signed-off-by: Raul Estrada <[email protected]>
Signed-off-by: Raul Estrada <[email protected]>
uurl
force-pushed
the
fix/packed-static-initializer-relocations
branch
from
August 16, 2026 05:09
0128aab to
5e25ead
Compare
Collaborator
|
Gist: this is the carrier #930 asked for: packed storage only when needed, layout validation before emission, and the exporter prints the real What I verified and did:
Two notes for after #919 lands: rebase to drop the duplicated pliron-migration hunks (your relocation work is untouched by it), and consider adding a by-value packed pointer read ( |
# Conflicts: # crates/llvm-export/src/export/types.rs # crates/mir-lower/src/convert/ops/memory.rs
…izer serde dependency
nihalpasham
approved these changes
Aug 16, 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 #930
Problem
repr(packed)layout could not hold a pointer, because the pointer lands at an unaligned offset:VALUEis only known at link time), and the old lowering refused any relocation slot that was not naturally aligned.Fix
<{ ... }>), replacing chore(deps): update Pliron for explicit struct layouts #919's fail-closed guardGotchas
--materialize-cubinbuild compiled the typed-pointer form (pointer at offset 1, and a getelementptr addend variant at offset 3) through libNVVM and ptxas with zero errorslet p = ENTRY.ptr;), which exercises a different translator path than theaddr_of! + read_unalignedroute the example coversTesting and validation
device_globalPASS with the expected values[123, 305419896, 17, 1090519040, 17493]