The extended Higgs model with the CP-violation is a good candidate realizing baryogenesis. However, such extra CP violation is strongly constrained by the electric dipole moment (EDM) data. In this talk, we consider the general two Higgs doublet model in which the CP phases are originated by the Higgs potential and the Yukawa interaction, and we discuss the cancellation between the contributions of these CP phases to the EDM. As a result, we show that the individual CP-violating phases can get O(1) [rad] while the EDM constraints are satisfied. This talk is based on the paper S. Kanemura, M. Kubota, K. Yagyu, arXiv:2004.03943 [hep-ph].