-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
CTFE core engine allocation & memory API improvemenets #85376
Conversation
Some changes occured to rustc_codegen_cranelift cc @bjorn3 Some changes occured to the CTFE / Miri engine cc @rust-lang/miri Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
@@ -176,8 +176,7 @@ pub(crate) fn codegen_const_value<'tcx>( | |||
std::iter::repeat(0).take(size.bytes_usize()).collect::<Vec<u8>>(), | |||
align, | |||
); | |||
let ptr = Pointer::new(AllocId(!0), Size::ZERO); // The alloc id is never used | |||
alloc.write_scalar(fx, ptr, x.into(), size).unwrap(); | |||
alloc.write_scalar(fx, alloc_range(Size::ZERO, size), x.into()).unwrap(); |
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.
Nice, no more dummy pointers!
I am curious if this will have any perf impact... I did reduce the number of times we query the |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit e968add0d2e7080e67498dc6f5903cd8dc0aa2de with merge de65837601ca2358d97f64015476026c73caadd6... |
This comment has been minimized.
This comment has been minimized.
Re-try after pushing a fmt fix. |
⌛ Trying commit 3f3aeca70f8e1e6873b060149a2611d371c69bf3 with merge 70a1cef598f09b48d15858b4ea6894e1df0c3f40... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
Queued 70a1cef598f09b48d15858b4ea6894e1df0c3f40 with parent f8e1e92, future comparison URL. |
Finished benchmarking try commit (70a1cef598f09b48d15858b4ea6894e1df0c3f40): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
so many different changes intermingled in one commit 😢 this is going to take me forever to review as right now I'm not able to be at a computer for long enough to untangle all of that. |
I didn't really find a way to split this into separate commits that makes sense on their own (in the sense that they at least pass Thinking about it, it might be possible to use the new memory API with the old allocation API (I didn't think of that since I made the changes bottom-up, i.e., allocation API first). But you should be getting basically the same effect by reviewing split-by-folders as I suggested. |
This comment has been minimized.
This comment has been minimized.
The Miri-side PR is ready: rust-lang/miri#1804. |
Rebased. |
thanks! this was much better to review, just a nit, then r=me |
- make Allocation API offset-based (no more Pointer) - make Memory API higher-level (combine checking for access and getting access into one operation)
Wow, that was quick, thanks :) |
📌 Commit d5ccf68 has been approved by |
☀️ Test successful - checks-actions |
Tested on commit rust-lang/rust@3e827cc. Direct link to PR: <rust-lang/rust#85376> 💔 miri on windows: test-pass → build-fail (cc @RalfJung @oli-obk @eddyb). 💔 miri on linux: test-pass → build-fail (cc @RalfJung @oli-obk @eddyb).
update for Memory API changes The Miri side of rust-lang/rust#85376.
update for Memory API changes The Miri side of rust-lang/rust#85376.
update for Memory API changes The Miri side of rust-lang/rust#85376.
Miri: fix alignment check in array initialization rust-lang#85376 introduced a regression in Miri, reported at rust-lang/miri#1919 and rust-lang/miri#1925. This PR fixes that. I will add tests to Miri once this lands. r? `@oli-obk` Fixes rust-lang/miri#1919 Fixes rust-lang/miri#1925
This is a first step towards rust-lang/miri#841.
Allocation
API offset-based (no more making upPointer
s just to access anAllocation
)Memory
API higher-level (combine checking for access and getting access into one operation)The Miri-side PR is at rust-lang/miri#1804.
r? @oli-obk