The thermal evolution of planets during their accretionary growth is strongly influenced by impact heating. The temperature increase following a collision takes place mostly below the impact location in a volume a few times larger than that of the impactor. Impact heating depends essentially on the radius of the impacted planet. When this radius exceeds ~ 1000 km, the metal phase melts and forms a shallow and dense pool that penetrates the deep mantle as a diapir. To study the evolution of a metal diapir we propose a model of thermo-chemical readjustment that we compare to numerical simulations in axisymmetric spherical geometry and with variable viscosity. We show that the metallic phase sinks with a velocity of order of a Stokes velocity. The thermal energy released by the segregation of metal is smaller but comparable to the thermal energy buried during the impact. However as the latter is distributed in a large undifferentiated volume and the former potentially liberated into a much smaller volume (the diapir and its close surroundings) a significant heating of the metal can occur raising its temperature excess by at most a factor of 2 or 3. When the viscosity of the hot differentiated material decreases, the proportion of thermal energy transferred to the undifferentiated material increases and a protocore is formed at a temperature close to that of the impact zone.