[LLVMdev] Add a new information and preserve it in LLVM

Hanbing Li hanbing.li at inria.fr
Fri Apr 4 13:02:59 PDT 2014



Hello, 




I am trying to add some thing into LLVM, while I encountered some problems. 




So my situation is that I have some information W, some transform passes may change it, after these passes, I need the new W. What I did is to create an analysis pass similar to scalar-evolution or loopinfo, I can get the information by using getAnalysis<W>(); and preserve this information W by using AU.addPreserved<W>();. Then the problem came, for the module pass, the information can’t be preserved. (I found this: To the best of my knowledge, the LLVM pass manager never preserves a FunctionPass analysis that is requested by a ModulePass; every time you call getAnalysis for a function, the FunctionPass is re-run. http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-March/048139.html ) So this means that I can’t update W when some module passes changed it? 




My questions are: 

1, Module pass really can’t preserve the W? 

2, If it’s real, why and how can I fix this? If it’s not, what should I do to keep the information W? 

3, The way of using an analysis pass to keep the information of W is suitable? Any other better solution? 




Thank you, 




Best regards, 




Hanbing 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140404/b8576129/attachment.html>


More information about the llvm-dev mailing list