Qingan Li
2010-Dec-19 01:53 UTC
[LLVMdev] 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. -- Best regards, Li Qingan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101219/39f83265/attachment.html>
Jakob Stoklund Olesen
2010-Dec-19 02:59 UTC
[LLVMdev] About the information about live variable analysis
On Dec 18, 2010, at 5:53 PM, Qingan Li wrote:> 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?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 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1929 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101218/937f1212/attachment.bin>
Andrew Clinton
2010-Dec-20 20:39 UTC
[LLVMdev] About the information about live variable analysis
> 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
Maybe Matching Threads
- [LLVMdev] About the information about live variable analysis
- [LLVMdev] Problem of stack slot coloring
- [LLVMdev] Problem of stack slot coloring
- [LLVMdev] Doubts about register interferences in register allocators
- [LLVMdev] about writing a functionpass requiring a modulepass