At low temperature TiSe2 undergoes a charge-density wave instability. Superconductivity is stabilized either by pressure or by Cu intercalation. We show that the pressure phase diagram of TiSe2 is well described by first-principles calculations. At pressures smaller than 4 GPa charge-density wave ordering occurs, in agreement with experiments. At larger pressures the disappearing of the charge-density wave is due to a stiffening of the short-range force constants and not to the variation of nesting with pressure. Finally, we show that the behavior of T(c) as a function of pressure is entirely determined by the electron-phonon interaction without need of invoking excitonic mechanisms. Our work demonstrates that phase diagrams with competing orders and a superconducting dome are also obtained in the framework of the electron-phonon interaction.