Rematerialization shouldn't ever return a spill instruction
Summary:
When finding an instruction to rematerialize a spill from, we usually
look "through" a spill instruction. The only exception is if the
source of the spill is a physical register. We cannot proceed past
this past, so we just return the instruction. However, this is
incorrect, since it means we return a spill for
rematerialization. This ends up "rematerializing" a spill, which
causes the state tracking to get out of sync. In this case, instead
return a synthesized copy, since we can rematerialize from copying
from the source physical register.
Reviewed By: mofarrell
Differential Revision:
D30869836
fbshipit-source-id:
795ebeed011ea458c05dfb2d69818ad19b6e7826