Skip to content
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

End locals' live range before suspending coroutine #118797

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Dec 10, 2023

State transforms retains storage statements for locals that are not
stored inside a coroutine. It ensures those locals are live when
resuming by inserting StorageLive as appropriate. It forgot to end the
storage of those locals when suspending, which is fixed here.

While the end of live range is implicit when executing return, it is
nevertheless useful for inliner which would otherwise extend the live
range beyond return.

Fixes #117733

@rustbot
Copy link
Collaborator

rustbot commented Dec 10, 2023

r? @davidtwco

(rustbot has picked a reviewer for you, use r? to override)

@rustbot
Copy link
Collaborator

rustbot commented Dec 10, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 10, 2023
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Dec 11, 2023

📌 Commit 6c60abf has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 11, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 11, 2023
End locals' live range before suspending coroutine

State transforms retains storage statements for locals that are not
stored inside a coroutine. It ensures those locals are live when
resuming by inserting StorageLive as appropriate. It forgot to end the
storage of those locals when suspending, which is fixed here.

While the end of live range is implicit when executing return, it is
nevertheless useful for inliner which would otherwise extend the live
range beyond return.

Fixes rust-lang#117733
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 11, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#118647 (dump bootstrap shims)
 - rust-lang#118708 (tests: add sanity-check assembly test for every target)
 - rust-lang#118797 (End locals' live range before suspending coroutine)
 - rust-lang#118818 (llvm-wrapper: adapt for LLVM API change)
 - rust-lang#118826 (Edit target doc template to remove email)
 - rust-lang#118827 (Update table for linker-plugin-lto docs)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr
Copy link
Member

@bors r-
may need update #118831 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 11, 2023
@rust-log-analyzer

This comment has been minimized.

State transforms retains storage statements for locals that are not
stored inside a coroutine. It ensures those locals are live when
resuming by inserting StorageLive as appropriate. It forgot to end the
storage of those locals when suspending, which is fixed here.

While the end of live range is implicit when executing return, it is
nevertheless useful for inliner which would otherwise extend the live
range beyond return.
The special case is subsumed by the check for always live locals that
follows it.
@tmiasko
Copy link
Contributor Author

tmiasko commented Dec 11, 2023

  • Updated mir test output for panic=abort strategy

@bors r=davidtwco

@bors
Copy link
Contributor

bors commented Dec 11, 2023

📌 Commit eaaa290 has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 11, 2023
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Dec 12, 2023
End locals' live range before suspending coroutine

State transforms retains storage statements for locals that are not
stored inside a coroutine. It ensures those locals are live when
resuming by inserting StorageLive as appropriate. It forgot to end the
storage of those locals when suspending, which is fixed here.

While the end of live range is implicit when executing return, it is
nevertheless useful for inliner which would otherwise extend the live
range beyond return.

Fixes rust-lang#117733
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 12, 2023
…mpiler-errors

Rollup of 7 pull requests

Successful merges:

 - rust-lang#118445 (Let `reuse` look inside git submodules)
 - rust-lang#118534 (codegen: panic when trying to compute size/align of extern type)
 - rust-lang#118756 (use bold magenta instead of bold white for highlighting)
 - rust-lang#118797 (End locals' live range before suspending coroutine)
 - rust-lang#118840 (remove some redundant clones)
 - rust-lang#118844 (Monomorphize args while building Instance body in StableMIR)
 - rust-lang#118848 (Add myself back to review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 12, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#118445 (Let `reuse` look inside git submodules)
 - rust-lang#118756 (use bold magenta instead of bold white for highlighting)
 - rust-lang#118797 (End locals' live range before suspending coroutine)
 - rust-lang#118840 (remove some redundant clones)
 - rust-lang#118844 (Monomorphize args while building Instance body in StableMIR)
 - rust-lang#118846 (Fix BinOp `ty()` assertion and `fn_sig()` for closures)
 - rust-lang#118848 (Add myself back to review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b862e7e into rust-lang:master Dec 12, 2023
11 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Dec 12, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 12, 2023
Rollup merge of rust-lang#118797 - tmiasko:dead-coro, r=davidtwco

End locals' live range before suspending coroutine

State transforms retains storage statements for locals that are not
stored inside a coroutine. It ensures those locals are live when
resuming by inserting StorageLive as appropriate. It forgot to end the
storage of those locals when suspending, which is fixed here.

While the end of live range is implicit when executing return, it is
nevertheless useful for inliner which would otherwise extend the live
range beyond return.

Fixes rust-lang#117733
@tmiasko tmiasko deleted the dead-coro branch December 12, 2023 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
6 participants