[LLVMdev] Using a FunctionPass inside a CallGraphSCCPass

Pranav Bhandarkar pranavb at codeaurora.org
Thu Oct 27 14:00:03 PDT 2011


Hi,

Is there any guiding principle that has been used to structure the Pass
Manager infrastructure related header files. I ask because I see a number of
pass managers documented in PassManagers.h but most, except FPPassManager
and a couple others, reside in PassManagers.cpp.

I want to move FunctionPassManagerImpl into PassManagers.h so that it can be
used inside CGPassManager. I want to be able to run function passes on the
fly in a CallGraphSCCPass and I think FunctionPassManagerImpl is the only
way to do it. Or am I wrong in this conclusion ?

Pranav
Qualcomm Innovation Center, Inc is a member of the Code Aurora Forum.

-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Pranav Bhandarkar
Sent: Tuesday, October 25, 2011 4:14 PM
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] Using a FunctionPass inside a CallGraphSCCPass

Hi,

I am writing a CallGraphSCCPass that uses LoopInfo which is a FunctionPass.
However, doing so results in the following error.
****
Unable to schedule 'Natural Loop Information' required by '......'
****

Google led me to this page, where Devang Patel suggests implementing the
addLowerLevelRequiredPasses in CGPassManager in a manner similar to
MPPassManager.
http://old.nabble.com/DominatorTree-Information-required-in-CallGraphPass-td
21968640.html

I tried this but to get analysis passes on the fly I need to use
FunctionPassManagerImpl in CallGraphSCCPass.cpp which I cannot because it is
not part of any header file.
I tried  using FunctionPassManager but it does not implement
getOnTheFlyPass() required by getAnalysis(). I also tried putting
CGPassManager in PassManager.cpp (and therefore in libLLVMCore.a ?) but the
build failed due to a cyclic dependency between libLLVMCore.a,
libLLVMAnalysis.a and libLLVMipa.a.

Any pointers to resolving this would be greatly appreciated.

Thanks in advance,
Pranav
Qualcomm Innovation Center, Inc is a member of the Code Aurora Forum.

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list