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

Create a StableMIR driver #69

Open
4 tasks
celinval opened this issue Mar 11, 2024 · 1 comment
Open
4 tasks

Create a StableMIR driver #69

celinval opened this issue Mar 11, 2024 · 1 comment

Comments

@celinval
Copy link
Contributor

celinval commented Mar 11, 2024

This is a tracking issue for adding a Stable compiler driver that tools can use to extend the Rust compiler. This would replace the existing rustc_smir::run!() macro.

Tasks

@sskeirik
Copy link

Our org is working on building a new MIR operational semantics. Here is a basic wishlist for a stable MIR driver --- and we are also happy to contribute towards it, if there is any interest (most of this is restating points that were made on the zulip).

At a high level, we would like to serialize MIR (plus any needed metadata) so that our operational semantics engine can read the program semantics off the serialized data without needing to perform additional program transformations.

At a more detailed level, some of the following features would be useful:

  1. the ability to collect all instances of items referenced by a designated set of monomorphic "root" functions --- this requires some form of linking to handle inter-crate uses
  2. the ability to generate MIR (post-type-checking, immediately-pre-LLVM-IR-lowering) for all instances of MIR-generating-items referenced in (1) --- this seems like it is partially handled by the monomorphization pass, but const items and items in upstream crates seem like they will require special handling
  3. the ability to collect the set of types used by item instances from (1)
  4. the ability to serialize MIR and a types-to-layout map based on (2)-(3) to some structured representation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants