@dragos , long time, no see! Great to see you again!

I fully agree (because of that example and others) that DCE is to be performed always.

The previous submission of this PR ( https://github.com/scala/scala/pull/2603 ) included that *must* functionality in commit
  https://github.com/magarciaEPFL/scala/commit/b0b012e6636263ff982ee4f375ccce7419ed6e25
However, to simplify review, this PR includes only the most basic, barebones, bytecode emitter one can imagine.

To answer your question:

> Is this dead-code elimination phase run all the time, or just optimizing? 

It runs all the time, not just optimizing. Not as a separate phase, given that DCE is intra-method. It's blazing fast:
https://github.com/magarciaEPFL/scala/commit/b0b012e6636263ff982ee4f375ccce7419ed6e25#L5R82