For MIRI, cfg out the swap vectorization logic from 94212#94412
For MIRI, cfg out the swap vectorization logic from 94212#94412bors merged 1 commit intorust-lang:masterfrom
Conversation
| let a = ptr::read(x); | ||
| let b = ptr::read(y); | ||
| ptr::write(x, b); | ||
| ptr::write(y, a); |
There was a problem hiding this comment.
However, in Miri this will mean we are copying 4 times rather than 3 times. No idea if that's a problem for performance or not...
|
I agree this makes sense for Miri. Not sure if there is a nice way to also use this for CTFE without code duplication. |
|
I think we should just fix the FIXME mentioned right there:
This will take care of miri, CTFE, spirv in one go |
|
The "right" solution for that is probably to not use an intrinsic, but a lang item. So the default logic is |
|
Ideally we'd have working by now, but... that needs a bit more work. |
Yeah, I was about to say that the logic that is currently implemented here would probably be quite annoying to replicate in a backend. But also, Miri is currently broken by 3 independent issues, and we need to resolve this one to make progress on that. So given that, I think it would make sense to land this or something like #94411 rather soon. (In CTFE it only affects unstable features so hopefully it is a bit less pressing.) |
|
@bors r+ Agreed, we can fix it cleaner later, the FIXME stays in place after all, this PR doesn't make the situation any worse |
|
📌 Commit b582bd3 has been approved by |
…oli-obk For MIRI, cfg out the swap vectorization logic from 94212 Because of rust-lang#69488 the swap logic from rust-lang#94212 doesn't currently work in MIRI. Copying in smaller pieces is probably much worse for its performance anyway, so it'd probably rather just use the simple path regardless. Part of rust-lang#94371, though another PR will be needed for the CTFE aspect. r? `@oli-obk` cc `@RalfJung`
|
@bors r=oli-obk p=1 |
|
💡 This pull request was already approved, no need to approve it again.
|
|
📌 Commit b582bd3 has been approved by |
|
oops |
|
💡 This pull request was already approved, no need to approve it again.
|
|
📌 Commit b582bd3 has been approved by |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (6a70556): comparison url. Summary: This benchmark run shows 4 relevant regressions 😿 to instruction counts.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression |
Because of #69488 the swap logic from #94212 doesn't currently work in MIRI.
Copying in smaller pieces is probably much worse for its performance anyway, so it'd probably rather just use the simple path regardless.
Part of #94371, though another PR will be needed for the CTFE aspect.
r? @oli-obk
cc @RalfJung