Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Cmm arithmetic optimisations #17
Some optimisations on Cmm expressions involving tagging or constants. Here's a (best-case) example:
Trunk compiles this to:
This branch compiles this to:
Floating all of the constant operations, tags, etc. out of arithmetic means they can be merged into one addition.
Thanks for the quick response, sorry it took me a while to get back. I've fixed the things you pointed out.
A couple of days ago, you said that it might have O(n^2) behaviour. I'm fairly sure it doesn't:
In a test, compiling a function
This PR have been discussed during the last developers' meeting, where I had the pleasure to be. To sum-up: