Question about VNInfo updates by LiveIntervals::addIntervalsForSpills

Hi,

It looks like LiveIntervals::addIntervalsForSpills does not update all
of the LiveIntervals infos quite correctly.

In particular, if a live interval L is defined by Reg<-Reg copy
instructions whose srcReg is later spilled by the
addIntervalsForSpills() function, its VNInfo information is not
updated in a proper way. It still points to the same MachineInstr as
before, even though the MachineInstr was rewritten by
addIntervalsForSpills(). This may lead to some problems during
coalescing attempts after spilling (I'm trying to do coalescing in an
iterative way), because the assertion in the
LiveIntervals::getVNInfoSourceReg() fails due to the fact that the
copy instruction defining the VNInfo of the live interval L is not a
Reg<-Reg move any more. It is a Reg<-Mem move after spilling function
invocation.

How should such a situation with VNInfos be handled in a proper way?
Any suggestions?

Thanks,
  -Roman

Hi,

It looks like LiveIntervals::addIntervalsForSpills does not update all
of the LiveIntervals infos quite correctly.

Correct.

In particular, if a live interval L is defined by Reg<-Reg copy
instructions whose srcReg is later spilled by the
addIntervalsForSpills() function, its VNInfo information is not
updated in a proper way. It still points to the same MachineInstr as
before, even though the MachineInstr was rewritten by
addIntervalsForSpills(). This may lead to some problems during
coalescing attempts after spilling (I'm trying to do coalescing in an
iterative way), because the assertion in the
LiveIntervals::getVNInfoSourceReg() fails due to the fact that the
copy instruction defining the VNInfo of the live interval L is not a
Reg<-Reg move any more. It is a Reg<-Mem move after spilling function
invocation.

The current implementation simply does not support this. If you want to do iterative coalescing like this, I would recommend you write a different addIntervalsForSpills. The current version is too complicated as it is.

Evan