From small signal model:
ro1 and ro2 are the output resistances of M1 and M2 (1/gds1,2), Vx is the drain voltage of M1.
Basically if ro1 and ro2 is enough high and Rp is low the gain equals with -gm1/gm2.
If you increase Rp then the gain will decrease until the sign turn into positive then the gain will increase again.
If Rp is larger than ro1 and ro2, then the output voltage is around: (-gm1*ro1)*(-gm2*ro2)= gm1*ro2*gm2*ro2, which is same as the above equation. Thanks.