- TODO * Add a blit instruction * Add jump tables (this implies changing phi arguments from using predecessors to using edges) * Move abi lowering earlier in the pipeline * Memory optimizations (see below) * (?) Add an undef instruction * Loop optimizations (see below) * GVN/GCM (see below) * (Complex) Understand the liveness implications of all the passes. This is important for archs with few registers. - Memory optimizations I now implemented half of my plan: a load elimination that can handle seamlessly aggregates, makes use of aliasing information, and copes with complex control-flow. Two big things remain: 1. The compiler needs to realize when stores to memory are dead and can be gotten rid of. 2. Look at how the Myrddin compiler compiler uses temporary stack slots and optimize useless blits/temporaries. Idiomatic Myrddin will be the "next step" from C, as aggregates play a more important role there. One thing that might be beneficial for Myrddin too would be to merge stack slots. - Loop optimizations The load optimization can already hoist some loads out of loops. Pushing stores out would be good too. And also a simple LICM might help C here and there. - GCM/GVN I.e. global code motion and global value numbering. These two optimizations are presented in an old paper from Click linked in the bibliography. They are both very interesting and are the biggest missing piece of the puzzle (or so I think) to catch up with GCC/Clang on simple integer programs. About GCM: It is more general than loop invariant code motion. It is necessary after GVN, because GVN can completely break the scheduling of instructions. I thought that, inside a block, we could use Sethi/Ullman numbers to limit the number of live temporaries About GVN: I thought that I never wrote redundant code, but after objectively looking at it, it seems that I do. So I guess it can help a bit (although I'd have to measure to be sure). The check() function in minic/test/queen.c is a good example of reasonable code that could benefit from it. We don't want to introduce temporaries for t+x, x+1, x-1, etc. it is just not nice.