-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
miri: use AllocId instead of u64. #47205
Conversation
Ha. That was on my list. Thanks for doing it. Lgtm |
@bors delegate=oli-obk |
✌️ @oli-obk can now approve this pull request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's readd the pointer once we implement the optimization
@bors r+
/// | ||
/// The pointers are to the beginning of an `alloc_by_id` allocation | ||
alloc_cache: FxHashMap<interpret::GlobalId<'tcx>, interpret::Pointer>, | ||
alloc_cache: FxHashMap<interpret::GlobalId<'tcx>, interpret::AllocId>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was that you could have globals which are located inside other locals in the future. So if a constant's value is obtained by indexing another constant, we'd just point to the offset in the array constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do need miri allocations properly exposed for miri alloc -> LLVM global translation, or at least some guarantee that static
s don't get optimized like that.
FWIW I think MemoryPointer
would be a better fit, eventually.
@bors r+ Maybe bors doesn't like reviews? |
📌 Commit 0907494 has been approved by |
This makes @alexreg's miri allocation -> LLVM global translation more straight-forward.
r? @oli-obk