We have investigated, via parameter-free calculations, the effects of hydrostatic and nonhydrostatic strains on the energetics of defect formation and self-diffusion in silicon. The three microscopic mechanisms, vacancy, interstitial, and concerted exchange, have very similar activation enthalpies at zero pressure but exhibit different behavior with hydrostatic pressure. Our results suggest that experiments performed at different pressures can determine the relative contributions of each of these mechanisms. The calculations also show that the neutral Si vacancy has a negative relaxation volume, with the nearest neighbors of the vacancy relaxing inwards, in contrast to the Si (111) surface. Large nonhydrostatic strains, which are present in e.g. Si/GexSi1-x pseudomorphic heterostractures, substantially reduce the formation energy of the tetrahedral interstitial, but do not affect the formation energy of the vacancy. These findings suggest that, aside from being another useful tool for the investigation of self-diffusion in Si, nonhydrostatic strain may significantly affect annealing and impurity diffusion in strained heterostructures. In particular, the interstitial-assisted impurity diffusion may proceed more rapidly in Si lattice-matched to GexSi1-x, but be slowed down in GexSi1-x lattice-matched to Si. The compressed GexSi1-x layers may thus act as diffusion barriers for impurities diffusing with help of native interstitials, such as B or P.