Implement dead code elimination