Chris Lattner wrote:>> Doesn't that last statement actually do the rewrite? > > Hrm, yes, yes it appears so. Question is: doesn't this make the r2r map > dead? Does something else fill it in? My memory is hazy here :). If it > is dead, we should rip it out (actually, we should make it private to the > coallescer function).I'm trying an experiment to eliminate the r2r map altogether. Is there an efficient way to replace all references to a virtual register? That is, given a virtual register number, is there an easy way to get a list of all Instructions and/or Operands that reference it? I've been looking at the Use and Value classes and am wondering if there is something there I could use. -Dave
Chris Lattner wrote:> No there isn't, unfortunately. I'd suggest building up/maintaining the > r2r map inside the coallescer. Once the coallescer is done with the > entire function, do a single pass over the function rewriting all the > coallesced vregs.Ok. I have a version with the coalescer separated from liveIntervalAnalysis. It still uses the r2r map but as we discussed late last week, it looks like the rewrite is already done. I will make the r2r map and all APIs into it private within the coalescer class and submit a patch. Good? -Dave
On Mon, 16 Apr 2007, David Greene wrote:> Chris Lattner wrote: >>> Doesn't that last statement actually do the rewrite? >> Hrm, yes, yes it appears so. Question is: doesn't this make the r2r map >> dead? Does something else fill it in? My memory is hazy here :). If it >> is dead, we should rip it out (actually, we should make it private to the >> coallescer function). > > I'm trying an experiment to eliminate the r2r map altogether. Is there > an efficient way to replace all references to a virtual register? That > is, given a virtual register number, is there an easy way to get a list > of all Instructions and/or Operands that reference it?No there isn't, unfortunately. I'd suggest building up/maintaining the r2r map inside the coallescer. Once the coallescer is done with the entire function, do a single pass over the function rewriting all the coallesced vregs. -Chris -- http://nondot.org/sabre/ http://llvm.org/