DominatorTree Information required in CallGraphPass

Hi all,

I am implementing a new pass for LLVM which extends Call Graph
SCCPass. I need DominatorTree Information when I get to individual
function. I have added AU.addrequired<DominatorTree>() and
AU.addRequired<DominanceFrontier>() in getAnalysisUsage() function.

But, when I get to the pass, Pass Manager gives following runtime error

Unable to schedule 'Dominator Tree Construction' required by '......'

assertion "0 && "Unable to schedule pass"" failed: file "/usr/src/llvm-2.4/llvm-
2.4/lib/VMCore/PassManager.cpp", line 1074

Can't I use dominator Tree Information in case of CallGraphSCCPass. I
found out from documentation that dominator Info can be used in Module
Pass

( http://www.llvm.org/docs/WritingAnLLVMPass.html#getAnalysis )

Thus it seemed feasible that Call GraphSCCPass should also be able to
use Dominator Info.Do I need to add some flag that I need lower level
passes?

Thanks

Regards,
Kapil

Hi all,

I am implementing a new pass for LLVM which extends Call Graph
SCCPass. I need DominatorTree Information when I get to individual
function. I have added AU.addrequired<DominatorTree>() and
AU.addRequired<DominanceFrontier>() in getAnalysisUsage() function.

But, when I get to the pass, Pass Manager gives following runtime error

Unable to schedule 'Dominator Tree Construction' required by '......'

assertion "0 && "Unable to schedule pass"" failed: file "/usr/src/llvm-2.4/llvm-
2.4/lib/VMCore/PassManager.cpp", line 1074

Can't I use dominator Tree Information in case of CallGraphSCCPass. I
found out from documentation that dominator Info can be used in Module
Pass

( http://www.llvm.org/docs/WritingAnLLVMPass.html#getAnalysis )

Thus it seemed feasible that Call GraphSCCPass should also be able to
use Dominator Info.Do I need to add some flag that I need lower level
passes?

Pl. file a bugzilla report. Call graph pass manager is not implementing addLowerLevelRequiredPass() to support this. If you copy the same method from MPPassManager (see Pasmanager.cpp) then it should work. If it works, please send us patch.

Thanks,

I have modified my pass to extend Module Pass instead of Call Graph SCCPass. I insert getAnalyses and use this explicitly instead of extending CallGraphSCCPass. So, the above change need not be made to get my pass work…( as of now)