Add a branch selection pass to avoid long branches