Open myreen opened 6 years ago
This was largely completed some time ago (2ba5cb6355c357ce3af56dfdcb857571c9e69b8b), and then cleaned up (https://github.com/CakeML/cakeml/pull/553).
However, the optimisation is not used in the compiler. This is because:
gc_no_new_locs_def
in word_elimProofScript
) which were not proved at the time of completion.The optimisation might instead be useful for the Pancake compiler.
The optimisation could also be improved. It currently does not deal with Install
functions well - if a program contains any, the elimination pass will leave it unchanged. A better way of handling this would be:
Install
functions are reachable using the analysis pass.
The
data_to_word
compilation pass introduces various helper functions. Some of these are never needed because the compiled program might never use the operations that need these helpers.A deadcode elimination pass that deletes unused code in
wordLang
would consist of three parts::num
)This pass would probably be best to attach to
word_to_stack
. It makes sense to have this pass beforestackLang
so that the GC bitmaps aren't populated with unused entires.This project could serve as a starter project for a new student.