-
Notifications
You must be signed in to change notification settings - Fork 211
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Run optimization passes multiple times #1450
Comments
This is the CFG emitted when the above code is compiled
It looks like the constant folding produced the desired output, but unused variables were not removed. |
Yes, as discussed in the chat; In my opinion the proper way to fix that is to turn unused variable elimination into an optimization pass, and then run all passes passes multiple times until the code converges or a limit is reached. This is also another good example why we want to run all optimization passes multiple times. Thanks! |
We need to change the current model so that optimization passes can run multiple times. Extracted from a discussion in the chat:
My opinion is that any optimization pass should be able to be run as many times as we want. The only thing that should happen that the code might get further optimized with more iterations of the same pass.
Compile time ABI encoding depends on this. Some optimization passes in can also benefit mutually from having multiple pass runs, for example constant folding and CSE. I think we should run optimizations until the CFG doesn't change after running them any more (converges) or a limit (maximum runs) is reached.
The text was updated successfully, but these errors were encountered: