<div dir="ltr"><div>Hi Daniel, thanks for your reply! Yes I didn't implement AA by myself but called builtin -basicaa interface for temporary use. Just add the -basicaa option in my opt command.</div><div><br></div><div><div>I hope -basicaa can be called to process to check some simple aliases. And when I do </div><div><div><br></div><div>DataDependencyGraph &ddgGraph = getAnalysis<DataDependencyGraph>(*F);<br></div></div><div><br></div><div>inside a Function Pass, it works.What make me confused is when my Pass is a Module Pass, --basicaa cannot be called anymore. It seems the -basicaa option cannot be seen by getAnalysis() if I call it in a Module Pass. <br></div></div><div><br></div><div>Do you have any suggestions?</div><div><br></div><div>Best Regards,</div><div><br></div><div>Shen </div><div><br></div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 29, 2015 at 4:45 PM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On Wed, Apr 29, 2015 at 1:27 PM, Shen Liu <<a href="mailto:shl413@lehigh.edu" target="_blank">shl413@lehigh.edu</a>> wrote:<br>
> Dear LLVM developers,<br>
><br>
> I am Shen, a PhD student at Lehigh Univ. PA. Now I am implementing a<br>
> Program Dependence Graph(PDG) on LLVM. I have 4 passes here:<br>
><br>
> 1. ProgramDependenceGraph (a ModulePass on the highest level)<br>
> 2. DataDependenceGraph (a Intermediate FunctionPass).<br>
> 3. FlowDependenceAnalysis Pass (a intermediate FunctionPass) which uses llvm<br>
> built-in AliasAnalysis (-basicaa)<br>
<br>
</span>Does this implement AliasAnalysis?<br></blockquote><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span><br>
> 4. AliasAnalysis Pass (LLVM built-in Pass)<br>
><br>
> When my call chain is<br>
><br>
> DatadependenceGraph <-- FlowDependenceAnalysis <-- AliasAnalysis<br>
><br>
> everything is fine and basicaa is executed successfully.<br>
<br>
</span>BasicAA is not AliasAnalysis. BasicAA is *an* AliasAnalysis.<br>
<br>
If you have not added BasicAliasAnalysis to the pass list, it will not<br>
be called when you call AliasAnalysis API.<br>
<span><br>
><br>
> My problem is, when I use a Module Pass to call a Function Pass, the low<br>
> level AliasAnalysis does not work anymore, all return values for location<br>
> comparisons are "May Alias". In other words, the call chain<br>
><br>
> ProgramDependenceGraph(Module Pass) <-- DatadependenceGraph(Function Pass)<br>
> <-- FlowDependenceAnalysis <-- AliasAnalysis if failed.<br>
><br>
> However, if I change ProgramDependenceGraph into a Function Pass, this call<br>
> chain works and AliasAnalysis can be executed successfully.<br>
><br>
> So, i guess there may be an error in my interaction between Module Pass and<br>
> Function Pass. Could you give me some hints to help me solve it? Thank you<br>
> very much!<br>
><br>
><br>
> Here are some key code for Pass interaction in my implementation:<br>
><br>
> bool ProgramDependencyGraph::runOnModule(Module &M)<br>
> {<br>
> ...<br>
> for(Module::iterator F = M.begin(), E = M.end(); F != E; ++F)<br>
> {<br>
> DataDependencyGraph &ddgGraph = getAnalysis<DataDependencyGraph>(*F);<br>
> ....<br>
> }<br>
> }<br>
><br>
> ...<br>
> void ProgramDependencyGraph::getAnalysisUsage(AnalysisUsage &AU) const<br>
> {<br>
> ...<br>
> AU.addRequired<DataDependencyGraph>();<br>
> AU.setPreservesAll();<br>
> }<br>
><br>
<br>
</span>This does not require alias analysis or it's analysis group, which is<br>
wrong if you want those to work?<br>
<br>
><br>
> Best Regards,<br>
><br>
> Shen<br>
><br>
><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
</blockquote></div><br></div></div></div>