Phase transitions and mineralogy of the upper mantle