[LLVMdev] Use LoopInfo in a non-pass class such as ProfileInfoLoader?

Wenhao Jia tynarex at gmail.com
Tue Oct 6 19:33:29 PDT 2009


Hi everyone,

I'm adding loop profiling to LLVM built-in profiler. I'm just
wondering in a class that's not a pass, such as ProfileInfoLoader, how
can I get information produced by passes such as LoopInfo and
DominatorTree?

In other words, ProfileInfoLoader is not a pass, so it can't call
AnalysisUsage::addRequired and AnalysisUsage::getAnalysisUsage
directly. Then how can it know if an arbitrary basic block is a loop
header using information/classes/methods available to it?

Thanks a lot!

Wenhao Jia



More information about the llvm-dev mailing list