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

Improve documentation of MIR queries & passes #1434

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Jaic1
Copy link

@Jaic1 Jaic1 commented Aug 16, 2022

This PR improve the documentation of MIR queries and passes.

Below is the summary of changes:

  • delete mir_validated
  • add mir_promoted and mir_drops_elaborated_and_const_checked
  • replace the NoLandingPads pass example with CleanupNonCodegenStatements
  • extend the stealing mechanism and give the dependency of MIR queries as an overview
  • add mdbook-mermaid in the build instructions

FIXME:

  • Does ty::queries::foo::force(...) still appear in rustc?

Since rust-lang/rust#99102 may significantly change the MIR queries (and thus its doc), we can wait for its result or send follow-up PRs. This is mostly documenting the code in rustc_mir_transform, so maybe cc @rust-lang/wg-mir-opt.

@JohnTitor JohnTitor added waiting-on-review This PR is waiting for a reviewer to verify its content blocked This PR is blocked waiting for some other PR and removed waiting-on-review This PR is waiting for a reviewer to verify its content labels Aug 17, 2022
src/mir/passes.md Outdated Show resolved Hide resolved
accidently -> accidentally

Co-authored-by: Tshepang Mbambo <tshepang@gmail.com>
@tshepang
Copy link
Member

with rust-lang/rust#99102 now accepted, does this need to change

@JohnTitor JohnTitor added waiting-on-review This PR is waiting for a reviewer to verify its content and removed blocked This PR is blocked waiting for some other PR labels Sep 2, 2022
@Jaic1
Copy link
Author

Jaic1 commented Sep 5, 2022

Yes, the doc in this PR need to change to reflect the recent changes in rust-lang/rust#99102. But we could wait a minute until it gets more stable and complete since the MIR phases and semantics there, I think, are under overhaul.

@JohnTitor JohnTitor added blocked This PR is blocked waiting for some other PR and removed waiting-on-review This PR is waiting for a reviewer to verify its content labels Sep 12, 2022
@jyn514
Copy link
Member

jyn514 commented Jan 1, 2023

rust-lang/rust#99102 has been merged :)

@jyn514 jyn514 removed the blocked This PR is blocked waiting for some other PR label Jan 1, 2023
@JohnTitor JohnTitor added the waiting-on-review This PR is waiting for a reviewer to verify its content label Feb 2, 2023
@JohnTitor
Copy link
Member

@oli-obk Could you help with the review here or ping relevant folks?
@Jaic1 Could you resolve the merge conflict meanwhile?

the final, optimized MIR. For foreign def-ids, we simply read the MIR
If you would like to get the MIR:

- for a function - you can use the `optimized_mir(def_id)` query;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's also the MIR that const eval sees for a function: mir_for_ctfe(def_id)

@oli-obk
Copy link
Contributor

oli-obk commented Feb 9, 2023

cc @JakobDegen

@spastorino spastorino added waiting-on-author This PR is waiting for additional action by the OP and removed waiting-on-review This PR is waiting for a reviewer to verify its content labels Feb 15, 2023
@spastorino
Copy link
Member

I'm not sure what's the current status of this PR, but would be great if we merge something about it, thoughts?.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-author This PR is waiting for additional action by the OP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants