[LLVMdev] Live Intervals vs. Live Variables

David Greene greened at obbligato.org
Tue Apr 3 13:48:31 PDT 2007


Fernando Magno Quintao Pereira wrote:
> LiveVariables gives you something like liveness analysis: where each 
> variable is alive, that is, across each basic blocks, where it is defined, 
> and where it is killed.

If I read this correctly, it means that at each instruction there's a
list of live variables?  I'm trying to figure out how to get at this
information to build the interference graph.

> LiveIntervals gives you a linear representation of the variables as a set 
> of intervals. Yes, it handle holes in the live ranges. There is a very 
> nice description of these analysis and related data structures here:
> 
> http://llvm.org/ProjectsWithLLVM/2004-Fall-CS426-LS.pdf

I've been looking at this paper and reading the code but there are
some things I can't figure out.

Where is PHI elimination done in the linear scan algorithm?  From my
reading, allocation happens before PHI nodes are eliminated, so where
do PHI nodes get removed?

The PNE pass declares that it preserved LiveVariables.  I take it
then that LiveIntervals are lost?

In LiveIntervalsAnalysis.cpp there's a statement in the top block
comment that it computes intervals conservatively.  I would like
to understand what information is lost.  What does LiveVariables
convey that LiveIntervals cannot?

Thanks for your help.

                                   -Dave



More information about the llvm-dev mailing list