ponyc
ponyc copied to clipboard
Optimisation pass order tuning
We're currently using the standard LLVM pass order when optimising programs. This doesn't look like the best strategy as I've often observed improvements to the generated IR when rerunning opt on it. We should tune the pass order to suit our needs more precisely.
Current areas to investigate:
- Range check elimination in loop. Some useless checks aren't eliminated even when the loop invariant is trivial.
- Dead code elimination. Some dead code (apparently mostly dead stores) isn't eliminated.
heap2stackandmergereallocorder. These Pony-specific passes currently run multiple times in the optimisation pipeline. This is not ideal since they take quite a long time to complete. Reducing the number of runs without losing final code quality would be good.
This is a really good idea.