-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Allow defining custom optimization passes on MIR #34066
Comments
You can already do this, but really, really shouldn’t for anything serious. We can and, most importantly, will break your use case every half a day. Alas, I do not think we will ever end up providing anything stable in this direction, so I’m hard pressed to see this issue as actionable. cc @nikomatsakis |
I am pretty reluctant to provide custom MIR passes. As @nagisa says, I don't think we'll want to provide a stable interface here -- or, at least, not for a long time. One thing I would eventually consider is to make it possible to input MIR directly into the compiler (this would basically stabilize some version of MIR and have it play a very similar role to Java Bytecode). One can then imagine custom passes that do not directly interact with the compiler, but rather just serialized MIR -- very much like syntax extensions operate on token trees. (It may even be that we don't have to serialize, but the core idea is the same.) This would be somewhat like the design of the rather awesomely flexible SUIF framework. But that all seems rather like science fiction to me at the moment and I'm not inclined to contemplate it just now. |
Should we move this to the RFCs repo, since it seems to be a wishlist item that also involves stabilizing an interface? |
Yes, this is not really a place for such a request and this request has a bunch of other unstable preconditions too. |
Allow one to register a custom optimization on the MIR pass as a compiler plugin.
The text was updated successfully, but these errors were encountered: