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

alg/opt: generic optimization #24

Open
mmcloughlin opened this issue Jul 6, 2019 · 1 comment
Open

alg/opt: generic optimization #24

mmcloughlin opened this issue Jul 6, 2019 · 1 comment
Labels
idea Something to think about

Comments

@mmcloughlin
Copy link
Owner

mmcloughlin commented Jul 6, 2019

We currently have the opt.Optimize() function which removes one form of obvious redundancy.

Are there any other "generic" optimization passes like this we can perform?

An addition chain is like an extremely simple SSA form. Can we learn anything from SSA optimizers?

@mmcloughlin mmcloughlin transferred this issue from mmcloughlin/ec3 Feb 1, 2020
@mmcloughlin mmcloughlin added the idea Something to think about label Feb 1, 2020
@mmcloughlin mmcloughlin changed the title addchain: generic optimization alg/opt: generic optimization May 16, 2020
@mmcloughlin
Copy link
Owner Author

I was playing with the existing redundancy-removal opt pass. It picks one set of extraneous chain entries to remove, but there are multiple options. My quick hack was to remove bigger values first instead of smaller values, because they tend to be more expensive to generate but a better plan is probably to do an actual cost calculation to decide which subset to keep. That’ll be more expensive to calculate, though.

https://twitter.com/commaok/status/1454906489626193921

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

No branches or pull requests

1 participant