remove unnecessary instructions