For those interested in this topic, I worked on improving dead code elimination in js_of_ocaml [1], a compiler from OCaml to JavaScript. The problem is more difficult in that case because of the indirection of OCaml's higher-order modules (functors).
[1]: https://www.micahcantor.com/blog/js-of-ocaml-dead-code/