We present a systematic study of the evolution of intermediate-and low-mass X-ray binaries consisting of an accreting neutron star of mass 1.0-1.8 M and a donor star of mass 1.0-6.0 M . In our calculations we take into account physical processes such as unstable disk accretion, radio ejection, bump-induced detachment, and outflow from the L 2 point. Comparing the calculated results with the observations of binary radio pulsars, we report the following results. (1) The allowed parameter space for forming binary pulsars in the initial orbital period-donor mass plane increases with increasing neutron star mass. This may help explain why some millisecond pulsars with orbital periods longer than ∼60 days seem to have less massive white dwarfs than expected. Alternatively, some of these wide binary pulsars may be formed through mass transfer driven by planet/brown-dwarf-involved common envelope evolution. (2) Some of the pulsars in compact binaries might have evolved from intermediate-mass X-ray binaries with anomalous magnetic braking. (3) The equilibrium spin periods of neutron stars in low-mass X-ray binaries are in general shorter than the observed spin periods of binary pulsars by more than one order of magnitude, suggesting that either the simple equilibrium spin model does not apply or there are other mechanisms/processes spinning down the neutron stars.