Strain engineering using ion beams is a current topic of research interest in semiconductor materials. Synchrotron-based high-resolution x-ray diffraction has been utilized for strain-depth analysis in GaAs irradiated with 300 keV Ar and 4H-SiC and GaAs irradiated with 100 MeV Ag ions. The direct displacement-related defect formation, anticipated from the elastic energy loss of Ar ions, can well explain the irradiation-induced strain depth profiles. The maximum strain in GaAs is evaluated to be 0.88% after Ar irradiation. The unique energy loss depth profile of 100 MeV Ag (swift heavy ions; SHIs) and resistance of pristine 4H-SiC and GaAs to form amorphous/highly disordered ion tracks by ionization energy loss of monatomic ions allow us to examine strain buildup due to the concentrated displacement damage by the elastic energy loss near the end of ion range (∼12 μm). Interestingly, for the case of SHIs, the strain-depth evolution requires consideration of recovery by ionization energy loss component in addition to the elastic displacement damage. For GaAs, strain builds up throughout the ion range, and the maximum strain increases and then saturates at 0.37% above an ion fluence of 3×1013 Ag/cm2. For 4H-SiC, the maximum strain reaches 4.6% and then starts to recover for fluences above 1×1013 Ag/cm2. Finally, the contribution of irradiation defects and the purely mechanical contribution to the total strain have been considered to understand the response of different compounds to ion irradiation.