Related articles |
---|
Help with Live Range Analysis? j.carney@yahoo.com (John Carney) (2008-01-12) |
Re: Help with Live Range Analysis? sdn@svpal.org (Steven Nichols) (2008-01-13) |
Re: Help with Live Range Analysis? rayiner@gmail.com (Rayiner Hashem) (2008-01-13) |
Re: Help with Live Range Analysis? rayiner@gmail.com (Rayiner Hashem) (2008-01-13) |
Re: Help with Live Range Analysis? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-01-14) |
Re: Help with Live Range Analysis? j.carney@yahoo.com (John Carney) (2008-01-17) |
From: | Rayiner Hashem <rayiner@gmail.com> |
Newsgroups: | comp.compilers |
Date: | Sun, 13 Jan 2008 20:38:59 -0800 (PST) |
Organization: | Compilers Central |
References: | 08-01-034 08-01-039 |
Keywords: | registers, analysis |
Posted-Date: | 14 Jan 2008 00:13:24 EST |
> There is a pretty decent explanation of how to construct live-in/live-
> out here:http://www.cs.cornell.edu/courses/cs412/2001sp/lectures/lec25.pdf
Small note: unless you need speed, just use the back-tracking
technique in that presentation. Basically, walk backwards over each
basic block. Every time you come to a read of a register that isn't
written-to earlier in the same basic block, look backwards along the
CFG for a write to that register, and add the register to the live-out
sets of any blocks you encounter along the way. The pseudo-code for
the traversal looks like this:
update-live-out(bb, reg):
set-add(reg, live-out(bb))
unless set-member?(reg, defed(bb)):
for pred-bb in preds(bb):
update-live-out(pred-bb, reg)
Where the function defed(bb) gives the set of variables written-to by
the instructions in a basic-block, and the function preds(bb) gives
the predecessors of a basic block.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.