use full params when legalizing phis, not just their idents; fixes #1702