-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[FIXME] settle future of MIR pass manager #41712
Copy link
Copy link
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
In #41625, the role of the MIR pass manager has been significantly scaled back. Once can still register passes, but they always take an
&mut Mir, and the set of passes is defined indriverand cannot be readily changed (in particular, the session no longer has aPassesstruct). @eddyb would like to go further, I think, and remove thePassesstrruct from thetcxaltogether -- the main reason it is still there is that it allows the MIR code to (indirectly) invoke passes defined in other crates, e.g.elaborate_drops. I tend to also think it's nice to "collect" the MIR passes into one single data-structure to ensure that (e.g.) we have the option to dump the MIR in between each pass and apply other debugging conventions (as well as to easily reorder passes or introduce new ones).Longer term, what do we think this should look like? One extreme future might remove the
Passesstruct altogether and have the invocations of each pass kind of hard-coded -- we could build up the set ofPassobjects in the various "mir queries", for example. Another extreme would be to make thePassesstruct more complex to support plugins adding custom optimizations -- it seems like we're a long way from there, and that may never make sense.To do the "radically scaled back" version of futures, we'd have to at least consolidate the borrowck and mir crates, or make one a dependency of the other, or something like that.
cc @rust-lang/compiler -- thoughts?