do some simple dead instruction elimination before trying to collapse the loops