Remove unused variables at the end of dead code elimination