Cuprate superconductors have a universal tendency to form charge density-wave (CDW) order which competes with superconductivity and is strongest at a doping p≃0.12. Here we show that in the archetypal cuprate YBa2Cu3Oy (YBCO) pressure suppresses charge order but does not affect the pseudogap phase. This is based on transport measurements under pressure, which reveal that the onset of the pseudogap at T∗ is independent of pressure, while the negative Hall effect, a clear signature of CDW order in YBCO, is suppressed by pressure. We also find that pressure and magnetic field shift the superconducting transition temperature Tc of YBCO in the same way as a function of doping-but in opposite directions- A nd most effectively at p≃0.12. This shows that the competition between superconductivity and CDW order can be tuned in two ways, either by suppressing superconductivity with field or suppressing CDW order by pressure. Based on existing high-pressure data and our own work, we observe that when CDW order is fully suppressed at high pressure, the so-called "1/8 anomaly" in the superconducting dome vanishes, revealing a smooth Tc dome which now peaks at p≃0.13. We propose that this Tc dome is shaped by the competing effects of the pseudogap phase below its critical point pâ∼0.19 and spin order at low doping.