The initial mass distribution of stars in a galaxy (the initial mass function or IMF) is usually described as being invariant. The universality of the IMF is one of the main assumptions for most of the chemical/chemodynamical models in the literature. However, evidence is emerging that this is not the case: the IMF appears to become top-heavy in galaxies characterized by high star formation rates. The integrated galactic IMF (IGIMF) theory determines the correlation between the star formation rate and the IMF in a galaxy. In this seminar I will show how the global chemical evolution of galaxies change if the hypothesis of an invariant IMF is relaxed and the IGIMF theory is adopted instead. In particular, I will show: (i) how the [alpha/Fe] abundance ratios in early-type galaxies are affected by the steepening of the IMF with decreasing star formation rate, predicted by the IGIMF theory, (ii) what are the consequences of the IGIMF for the chemical evolution of the Milky Way, (iii) how the [alpha/Fe] ratios in the most metal-poor stars of a galaxy vary as a function of its IGIMF.