In-place phi(x,a) merge