fix phis from legalized switches