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

Redundant Set Elimination pass #1344

Merged
merged 32 commits into from Jan 6, 2018

Conversation

Projects
None yet
1 participant
@kripken
Member

kripken commented Dec 30, 2017

This optimizes #1343. It looks for stores of a value that is already present in the local, which in particular can remove the initial set to 0 of loops starting at zero, since all locals are initialized to that already. This helps in real-world code, but is not super-common since coalescing means we tend to have assigned something else to it anyhow before we need it to be zero (so this mainly helps in small functions, it seems).

So far this just handles constant values.

@kripken

This comment has been minimized.

Member

kripken commented Dec 31, 2017

I extended this to handle redundant sets of values coming from a merge or an arbitrary set. Helps a little bit more on some codebases (mono) but no difference on most.

@kripken

This comment has been minimized.

Member

kripken commented Jan 1, 2018

Fixed a bug that prevented this from optimizing some cases it should.

@kripken

This comment has been minimized.

Member

kripken commented Jan 5, 2018

This should now be complete. I worried for a while about convergence being guaranteed, but ended up being able to write a proof for it. The convergence property is also tested with assertions, and this has been heavily fuzzed.

@kripken kripken merged commit 2372862 into master Jan 6, 2018

@kripken kripken deleted the opt branch Jan 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment