About the information about live variable analysis

Hi,

I worked in llvm to get some information from live variable analysis.
If the live range of one variable interferes with another, we could record the related two variables into a pair. For example, with a function with local variables ‘a’, ‘b’, ‘c’, ‘x’ and ‘y’, the pair set { (a, b), (b,c), (x,y)} indicates that ‘a’ interferes with ‘b’, ‘b’ interferes with ‘c’, and ‘x’ interferes with ‘y’.

The question is: How can I get this information (maybe in other forms) by using llvm to compile a program?

Could anyone help me?
Thanks in advance.

This information is only available during register allocation in the code generator. Look at LiveInterval::overlaps().

That is quite late in the compilation process, and it is not easy to translate back to variables in the original program.

/jakob

This information is only available during register allocation in the code generator. Look at LiveInterval::overlaps().

That is quite late in the compilation process, and it is not easy to translate back to variables in the original program.

/jakob

I'm noticing too that some useful analysis/transforms are only available in the code generator, after the IR has been transformed to another format. At least for my application, I'm finding it would be useful to have some of these analysis (eg. register allocation) available in the optimizer as well, though I'm sure there is a good reason architecturally that LLVM is using a separate representation for codegen.

Andrew