You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to change the current model so that optimization passes can run multiple times. Extracted from a discussion in the chat:
What I can say about constant folding is that it is not complete.
E.g.
int a = 1;
int b = 4;
int c = a+b;
int d = c+1;
After constant folding you have:
int c = 1+4;
int d = c+1;
Ideally we would run the optmization many times to eliminate all the constants.
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:
It looks like the constant folding produced the desired output, but unused variables were not removed.
An explicit optimisation pass that takes care of removing unused variables, after constant folding has run, may be useful here.
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: