<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">I’m writing a CallGraphSCCPass which needs dominator tree information on each function. My getAnalysisUsage is fairly straightforward:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Consolas;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">virtual</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">void</span> getAnalysisUsage(<span style="font-variant-ligatures: no-common-ligatures; color: #5c2699" class="">AnalysisUsage</span>& au) <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">const</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">override</span></div><div style="margin: 0px; font-size: 11px; font-family: Consolas;" class="">{</div><div style="margin: 0px; font-size: 11px; font-family: Consolas; color: rgb(61, 29, 129);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>au.</span>setPreservesAll<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">();</span></div><div style="margin: 0px; font-size: 11px; font-family: Consolas; color: rgb(92, 38, 153);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>au.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">addRequired</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><</span>DominatorTreeWrapperPass<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">>();</span></div><div style="margin: 0px; font-size: 11px; font-family: Consolas;" class="">}</div></div><div class=""><br class=""></div><div class="">The pass is registered like this:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Consolas; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">char</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>MyPass<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">::ID = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">;</span></div><div style="margin: 0px; font-size: 11px; font-family: Consolas; color: rgb(196, 27, 23);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">static</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #5c2699" class="">RegisterPass</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><</span><span style="color: rgb(79, 129, 135);" class="">MyPass</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">> tmp(</span>"My Pass"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span>"Do fancy analysis"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">true</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">true</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">);</span></div></div><div style="margin: 0px; font-size: 11px; font-family: Consolas; color: rgb(196, 27, 23);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; font-family: Consolas; color: rgb(196, 27, 23);" class=""><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #78492a" class="">INITIALIZE_PASS_BEGIN</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(MyPass, </span>"My Pass"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span>"Do fancy analysis"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">true</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">true</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; color: rgb(120, 73, 42);" class="">INITIALIZE_PASS_DEPENDENCY<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">DominatorTreeWrapperPass</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #78492a" class="">INITIALIZE_PASS_END</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(MyPass, </span>"My Pass"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span>"Do fancy analysis"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">true</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">true</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div></div><div class=""><br class=""></div><div class="">When I try to add my pass to a legacy::PassManager, it dies with this error message:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px;" class=""><b class=""><font face="Menlo" class=""><span style="font-size: 11px;" class="">Unable to schedule 'Dominator Tree Construction' required by ‘My Pass'</span></font></b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><b class="">Unable to schedule pass</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><b class="">UNREACHABLE executed at LegacyPassManager.cpp:1264!</b></div></div><div class=""><br class=""></div><div class="">I statically link LLVM to my program, and define the pass in my program, too.</div><div class=""><br class=""></div><div class="">Am I doing something wrong? Does it make sense to require the DominatorTreeWrapperPass from a CallGraphSCCPass?</div><div class=""><br class=""></div><div class="">Thanks!</div><div class=""><br class=""></div><div class="">Félix</div></body></html>