[LLVMdev] Using DominatorTreeWrapperPass in CallGraphSCCPass

Félix Cloutier felixcca at yahoo.ca
Tue May 5 10:07:24 PDT 2015


Hi all,

I’m writing a CallGraphSCCPass which needs dominator tree information on each function. My getAnalysisUsage is fairly straightforward:

virtual void getAnalysisUsage(AnalysisUsage& au) const override
{
	au.setPreservesAll();
	au.addRequired<DominatorTreeWrapperPass>();
}

The pass is registered like this:

char MyPass::ID = 0;
static RegisterPass<MyPass> tmp("My Pass", "Do fancy analysis", true, true);

INITIALIZE_PASS_BEGIN(MyPass, "My Pass", "Do fancy analysis", true, true)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
INITIALIZE_PASS_END(MyPass, "My Pass", "Do fancy analysis", true, true)

When I try to add my pass to a legacy::PassManager, it dies with this error message:

Unable to schedule 'Dominator Tree Construction' required by ‘My Pass'
Unable to schedule pass
UNREACHABLE executed at LegacyPassManager.cpp:1264!

I statically link LLVM to my program, and define the pass in my program, too.

Am I doing something wrong? Does it make sense to require the DominatorTreeWrapperPass from a CallGraphSCCPass?

Thanks!

Félix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150505/62c39f2c/attachment.html>


More information about the llvm-dev mailing list