Roman Levenstein
2009-Jan-30 18:18 UTC
[LLVMdev] 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
Evan Cheng
2009-Jan-30 22:26 UTC
[LLVMdev] Question about VNInfo updates by LiveIntervals::addIntervalsForSpills
On Jan 30, 2009, at 10:18 AM, Roman Levenstein wrote:> 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> > > How should such a situation with VNInfos be handled in a proper way? > Any suggestions? > > Thanks, > -Roman > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev