-
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
Remove movability from TyKind::Coroutine
#119174
Conversation
Some changes occurred in compiler/rustc_codegen_gcc Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Type relation code was changed Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes might have occurred in exhaustiveness checking cc @Nadrieril Some changes occurred in src/tools/clippy cc @rust-lang/clippy This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras This PR changes Stable MIR cc @oli-obk, @celinval, @spastorino, @ouz-a |
f6109ae
to
3b7be08
Compare
lol i guess this could've been a draft -- forgot that I touched so many files 💀 @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Remove movability from `TyKind::Coroutine` This seems like something that we can just have a query to compute... let's see what this does to perf. r? `@ghost`
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (23cf56b): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 672.809s -> 671.782s (-0.15%) |
3b7be08
to
a74f6d9
Compare
r? compiler |
(&ty::Coroutine(def_id_a, args_a, mov_a), &ty::Coroutine(def_id_b, args_b, mov_b)) | ||
if def_id_a == def_id_b && mov_a == mov_b => | ||
(&ty::Coroutine(def_id_a, args_a), &ty::Coroutine(def_id_b, args_b)) | ||
if def_id_a == def_id_b => |
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.
Is this safe?
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.
Yes. Movability is a property uniquely determined by def-id -- its inclusion here was redundant.
@@ -460,7 +460,7 @@ pub enum RigidTy { | |||
FnDef(FnDef, GenericArgs), | |||
FnPtr(PolyFnSig), | |||
Closure(ClosureDef, GenericArgs), | |||
Coroutine(CoroutineDef, GenericArgs, Movability), |
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.
I was wondering if we could leave this here for now and make it always the same value. We could add a comment documenting that for now?
BTW, we need to figure out the best mechanism to make breaking changes to StableMIR, but this one I believe we can delay this one for now.
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.
What do you mean by making it always the same value?
I'd rather expose a fn movability(CoroutineDef) -> Movability
fn in the long term, but I can "pre-populate" it here I guess for the mean time.
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.
Yes, that would work. I misunderstood the reason why you were removing it.
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.
Which would you like for me to do first? Make smir::TyKind::Coroutine
keep the Movability
argument even though it's redudant, or add a fn movability(CoroutineDef) -> Movability
to the tables?
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.
I've just restored movability to SMIR, and added a FIXME(stable_mir)
.
☔ The latest upstream changes (presumably #119173) made this pull request unmergeable. Please resolve the merge conflicts. |
a74f6d9
to
d991a97
Compare
☔ The latest upstream changes (presumably #119258) made this pull request unmergeable. Please resolve the merge conflicts. |
3a9ec21
to
016694c
Compare
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.
A few nits and r=me
016694c
to
e24da8e
Compare
@bors r=cjgillot |
☀️ Test successful - checks-actions |
Finished benchmarking commit (fb5ed72): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 672.476s -> 670.748s (-0.26%) |
Relevant PRs: - rust-lang/rust#119601 - rust-lang/rust#119146 - rust-lang/rust#119174 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
There's no reason to store movability in the generator struct directly. It is computed from the HIR, and can be pulled into a query to access when necessary.