Skip to content

rustc_mir: hardcode pass list internally and remove premature pluggability. - #45916

Merged
bors merged 4 commits into
rust-lang:masterfrom
eddyb:even-mirer-0
Nov 14, 2017
Merged

rustc_mir: hardcode pass list internally and remove premature pluggability.#45916
bors merged 4 commits into
rust-lang:masterfrom
eddyb:even-mirer-0

Conversation

@eddyb

@eddybeddyb commented Nov 10, 2017

Copy link
Copy Markdown
Contributor

Fixes#41712 by moving the MIR pass lists from rustc_driver to rustc_mir.
The application of the passes is done with the rustc_mir::transform::run_passes macro, which is public, as are all the passes AFAIK, and can be used to apply MIR passes outside of rustc_mir.

With the ability to override query providers through the rustc_driver (orthogonal to, and not included in this PR), custom drivers will be able to substitute the entire pass list if they want to.
EDIT: the aforementioned ability is added by #45944.

r? @nikomatsakis

@kennytmkennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 10, 2017
@nikomatsakis

Copy link
Copy Markdown
Contributor

r? @nikomatsakis

@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Nov 11, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 9eadc36 has been approved by nikomatsakis

@bjorn3

Copy link
Copy Markdown
Member

Please dont do this as this would make it very hard to update holyjit for the latest nightly. Currently it just requires a rustc patch of a few lines.

@eddyb

Copy link
Copy Markdown
ContributorAuthor

@bjorn3 See this PR's description for the appropriate course of action. Being able to replace the provider for, e.g., the optimized_mir query, and then reusing the macro from rustc_mir, with a slightly modified set of passes, should allow pretty much everything.
There are no composition rules for MIR passes, nor is the idea of a MIR pass permanent, so it's not really meaningful to "just add another pass".

@bjorn3

Copy link
Copy Markdown
Member

I see. Should have read the description completely.

@nbp

nbp commented Nov 12, 2017

Copy link
Copy Markdown
Contributor

@bjorn3 Thanks for your concern for HolyJit. Yes this patch is going to break the ability to simply rebase a patch on top of rustc, but HolyJit is a prototype, and I have been warned and explicitly been suggested against using a plugin approach from the beginning.

I still went with the plugin approach because this is something I understand and which was close enough to what is currently documented for making syntax plugins.

@kennytmkennytm 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 Nov 12, 2017
@bors

bors commented Nov 14, 2017

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #45909) made this pull request unmergeable. Please resolve the merge conflicts.

@eddyb

Copy link
Copy Markdown
ContributorAuthor

@bors r=nikomatsakis

@bors

bors commented Nov 14, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit d6aa56f has been approved by nikomatsakis

@bors

bors commented Nov 14, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit d6aa56f with merge 24840da...

bors added a commit that referenced this pull request Nov 14, 2017
rustc_mir: hardcode pass list internally and remove premature pluggability.
Fixes#41712 by moving the MIR pass lists from `rustc_driver` to `rustc_mir`.
The application of the passes is done with the `rustc_mir::transform::run_passes` macro, which is public, as are all the passes AFAIK, and can be used to apply MIR passes outside of `rustc_mir`.
With the ability to override query providers through the `rustc_driver` (orthogonal to, and not included in this PR), custom drivers will be able to substitute the entire pass list if they want to.
**EDIT**: the aforementioned ability is added by #45944.
r? @nikomatsakis
@bors

bors commented Nov 14, 2017

Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 24840da to master...

@bors
bors merged commit d6aa56f into rust-lang:masterNov 14, 2017
@eddyb
eddyb deleted the even-mirer-0 branch November 14, 2017 10:29
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@eddyb@nikomatsakis@bors@bjorn3@nbp@kennytm