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

Allow defining custom optimization passes on MIR #34066

Closed
ticki opened this issue Jun 3, 2016 · 5 comments
Closed

Allow defining custom optimization passes on MIR #34066

ticki opened this issue Jun 3, 2016 · 5 comments

Comments

@ticki
Copy link
Contributor

ticki commented Jun 3, 2016

Allow one to register a custom optimization on the MIR pass as a compiler plugin.

@hanna-kruppe
Copy link
Contributor

@nagisa
Copy link
Member

nagisa commented Jun 3, 2016

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

@nikomatsakis
Copy link
Contributor

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.

@bstrie
Copy link
Contributor

bstrie commented Jun 7, 2016

Should we move this to the RFCs repo, since it seems to be a wishlist item that also involves stabilizing an interface?

@nagisa
Copy link
Member

nagisa commented Jun 7, 2016

Yes, this is not really a place for such a request and this request has a bunch of other unstable preconditions too.

@nagisa nagisa closed this as completed Jun 7, 2016
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

5 participants