<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">You’ll excuse me if I got mixed up somewhere.<div class=""><br class=""></div><div class="">The initial problem I had is that adding a required analysis in my CallGraphSCCPass’s getAnalysisUsage caused a runtime error:</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class="">Unable to schedule 'Dominator Tree Construction' required by ‘My Pass'<br class="">Unable to schedule pass<br class="">UNREACHABLE executed at LegacyPassManager.cpp:1264!</blockquote></div><div class=""><br class=""></div><div class="">My pass is declared in the same program that links against LLVM. The correct way to register these passes appears to use the RegisterPass<T> template, however it does not appear to allow declaring pass dependencies.</div><div class=""><br class=""></div><div class="">At the time, I was advised to bypass the DomTreeWrapperPass and just use DominatorTree::recalculate when I needed it.</div><div class=""><br class=""></div><div class="">It’s with this background that I was saying that the passes are run "manually".<br class=""><div class=""><br class=""></div><div class="">Félix</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Le 2015-05-19 à 12:47:32, John Criswell <<a href="mailto:jtcriswel@gmail.com" class="">jtcriswel@gmail.com</a>> a écrit :</div><br class="Apple-interchange-newline"><div class="">
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type" class="">
<div bgcolor="#FFFFFF" text="#000000" class="">
<div class="moz-cite-prefix">On 5/19/15 10:04 AM, Félix Cloutier
wrote:<br class="">
</div>
<blockquote cite="mid:AF9052E3-2335-4290-B625-48EA2A18C0B7@yahoo.ca" type="cite" class="">
<meta http-equiv="Context-Type" content="text/html;
charset=windows-1252" class="">
Thanks John.
<div class=""><br class="">
</div>
<div class="">Does this solve the problem of analysis availability
though? If I still have to run the function analyses manually, I
might as well keep rolling with the CallGraphSCCPass. (I
probably should have mentioned that this is what I’m using right
now.)</div>
</blockquote>
<br class="">
I'm not sure what you mean by "manually." If you use a ModulePass,
you can use the getAnalysis<FunctionPassName>(F) method to get
a reference to a function pass. The ModulePass's getAnalysisUsage()
method will need to use addRequired<FunctionPass>() to require
each FunctionPass, but I think the PassManager will run the passes
automatically as needed.<br class="">
<br class="">
Note that you cannot use the PassManager to ensure that certain
optimization passes are run before your pass is run. If you need to
run an optimization pass before your pass (e.g., UnifyExitNodes),
then you need to tell the PassManager to run it before your pass
explicitly.<br class="">
<br class="">
Regards,<br class="">
<br class="">
John Criswell<br class="">
<br class="">
<blockquote cite="mid:AF9052E3-2335-4290-B625-48EA2A18C0B7@yahoo.ca" type="cite" class="">
<div class=""><br class="">
</div>
<div class="">Félix</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">Le 2015-05-19 à 10:12:32, John Criswell <<a moz-do-not-send="true" href="mailto:jtcriswel@gmail.com" class="">jtcriswel@gmail.com</a>> a écrit :</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">
<div class="moz-cite-prefix">On 5/18/15 10:45 PM, Félix
Cloutier wrote:<br class="">
</div>
<blockquote cite="mid:E9ACAC14-F02C-4C55-AA48-6C1E8DBDBD06@yahoo.ca" type="cite" class=""> Hi all,
<div class=""><br class="">
</div>
<div class="">I have one analysis pass that I want to
perform on call graph SCCs. However, for each
function in the SCC, I need function-level analyses,
like the dominator tree and the memory dependency
analysis.</div>
<div class=""><br class="">
</div>
<div class="">I’ve <a moz-do-not-send="true" href="http://stackoverflow.com/questions/30059622/using-dominatortreewrapperpass-in-callgraphsccpass" class="">been told before</a> that these were not
available from a CallGraphSCCPass. What would be the
best approach for me to access this information?
Should I run the passes manually, or is there
another, more pass-scheduler-friendly approach?</div>
</blockquote>
<br class="">
I would write a ModulePass that simply iterates over the
call graph. LLVM provides a CallGraph analysis which
one can use to find SCCs; DSA has an analysis called
CallTargets which does "real" CallGraph analysis (which
means that it tries to reason about function pointers,
though I cannot guarantee that its reasoning will be as
accurate as you want).<br class="">
<br class="">
If you use a ModulePass, can you analyze any part of the
program you like, and you can use FunctionPasses.<br class="">
<br class="">
Regards,<br class="">
<br class="">
John Criswell<br class="">
<br class="">
<blockquote cite="mid:E9ACAC14-F02C-4C55-AA48-6C1E8DBDBD06@yahoo.ca" type="cite" class="">
<div class=""><br class="">
</div>
<div class="">Félix</div>
<br class="">
<fieldset class="mimeAttachmentHeader"></fieldset>
<br class="">
<pre class="" wrap="">_______________________________________________
LLVM Developers mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu/">http://llvm.cs.uiuc.edu</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br class="">
<br class="">
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
<br class="">
<br class="">
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</div>
</div></blockquote></div><br class=""></div></div></body></html>