search for: mymodulepass

Displaying 20 results from an estimated 26 matches for "mymodulepass".

2008 Mar 05
1
[LLVMdev] getAnalysis*() called on an analysis that was not " "'required' by pass!
...onst llvm::PassInfo*) const [with AnalysisType = llvm::DominatorTree]: Assertion `ResultPass && "getAnalysis*() called on an analysis that was not " "'required' by pass!"' failed. The following is the command I typed in: opt -load /usr/local/llvm/install/lib/mymodulepass.so -mymodulepass <idct.bc> /dev/null Here are the header and implementation files of my class with just the bare minimum that produces the error messages. (MyModulePass.h) #ifndef MYMODULEPASS_H #define MYMODULEPASS_H #include "llvm/Pass.h" namespace llvm { class MyModuleP...
2011 Jun 15
3
[LLVMdev] Cannot use function pass in a module pass
...om svn). Despite what the tutorial (http://llvm.org/docs/WritingAnLLVMPass.html) states in my module pass I cannot perform getAnalysis and fetch the function pass result. When trying to do so `opt` fails with the following mesage: [***@*** ***]$ opt -load ~/llvm/Debug+Asserts/lib/MyPassLibrary.so -mymodulepass < input.bc >/dev/null MyModulePass::runOnModule MyFunctionPass::runOnFunction(process) opt: /***/llvm/include/llvm/MyFunctionPass.h:241: AnalysisType& llvm::Pass::getAnalysisID(llvm::AnalysisID, llvm::Function&) [with AnalysisType = {anonymous}::MyFunctionPass, llvm::AnalysisID = cons...
2011 Jun 16
0
[LLVMdev] Cannot use function pass in a module pass
...u cannot call getAnalysis<FunctionPassName>(F) if F is a function with no body. You need to do something like: if (!(F->isDeclaration())) { getAnalysis<FunctionPassName>(F); ... } -- John T. > [***@*** ***]$ opt -load ~/llvm/Debug+Asserts/lib/MyPassLibrary.so > -mymodulepass< input.bc>/dev/null > MyModulePass::runOnModule > MyFunctionPass::runOnFunction(process) > opt: /***/llvm/include/llvm/MyFunctionPass.h:241: AnalysisType& > llvm::Pass::getAnalysisID(llvm::AnalysisID, llvm::Function&) [with > AnalysisType = {anonymous}::MyFunctionPass,...
2011 Jun 16
1
[LLVMdev] Cannot use function pass in a module pass
...>(F) if F is a function with no body. > You need to do something like: > > if (!(F->isDeclaration())) { >     getAnalysis<FunctionPassName>(F); >     ... > } > > -- John T. > >> [***@*** ***]$ opt -load ~/llvm/Debug+Asserts/lib/MyPassLibrary.so >> -mymodulepass<  input.bc>/dev/null >> MyModulePass::runOnModule >> MyFunctionPass::runOnFunction(process) >> opt: /***/llvm/include/llvm/MyFunctionPass.h:241: AnalysisType& >> llvm::Pass::getAnalysisID(llvm::AnalysisID, llvm::Function&) [with >> AnalysisType = {anonymo...
2010 Jul 29
1
[LLVMdev] Controlling the order of a FunctionPass
...(like LoopInfo), your ModulePass > can declare them as prerequisites and get access to them using the > getAnalysis<PassName>(Function *) method. Yes, I remember trying this before but was unsuccessful. I made a second attempt just now and am again running into the same issue: bool MyModulePass::runOnModule(Module &M) { for (Module::iterator i = M.begin(), e = M.end(); i != e; ++i) { Function *function = i; LoopInfo &loopInfo = getAnalysis<LoopInfo>(function); ... } ... } MyModulePass.cpp: In member function ‘virtual bool MyModule...
2010 Jul 23
0
[LLVMdev] Controlling the order of a FunctionPass
Trevor Harmon wrote: > On Jul 22, 2010, at 2:05 PM, John Criswell wrote: > > >> If you write your pass as a ModulePass, then you can iterate over the >> functions in any order that you want. >> > > I had considered that, but my FunctionPass depends on other passes > processing the functions first: > Two things to consider: 1) The PassManager
2010 Jul 22
3
[LLVMdev] Controlling the order of a FunctionPass
On Jul 22, 2010, at 2:05 PM, John Criswell wrote: > If you write your pass as a ModulePass, then you can iterate over the > functions in any order that you want. I had considered that, but my FunctionPass depends on other passes processing the functions first: void MyPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<UnifyFunctionExitNodes>();
2020 Apr 22
3
how to add my own passes to LTO pass
Hi, I have a module pass and I hope to use it to optimize a real-world program. I need LTO,and I have got LTO plugin. But How can I add my passes to LTO Pass. I can't find solution. What should I do? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200422/76d2b046/attachment.html>
2011 Oct 10
0
[LLVMdev] Using analysis results from a CallGraphSCCPass in a ModulePass
...hSCCPass in a ModulePass. Here is the relevant code: struct MyCallGraphSCCPass : CallGraphSCCPass { ... bool runOnSCC(CallGraphSCC& scc){...} }; char MyCallGraphSCCPass::ID = 0; static RegisterPass<MyCallGraphSCCPass> X("cgscc", "Dummy CG SCC pass"); struct MyModulePass : public ModulePass { ... bool runOnModule(Module& m){...} void getAnalysisUsage(AnalysisUsage& au) const { au.addRequired<MyCallGraphSCCPass>(); } }; char MyModulePass::ID = 0; static RegisterPass<MyModulePass> Y("mod", "Dummy module...
2010 Nov 01
2
[LLVMdev] Identify recursion in a call graph
...ties in SCCIterator.h, or declare your pass to be a > CallGraphSCCPass in which case it will work one strongly connected > component at a time. Converting my ModulePass to a CallGraphSCCPass doesn't seem feasible, so I'll use llvm::scc_iterator. Here's what I have so far: bool MyModulePass::isRecursive() { CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot(); for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode), E = scc_end(rootNode); SCCI != E; ++SCCI) { const std::vector<CallGraphNode*> &nextSCC = *SCCI; if (nextSCC.size() == 1 &&am...
2011 Jul 12
3
[LLVMdev] running a module pass via opt on multiple bitcode files
...object to process an entire program as a unit. The target program is built from multiple object files, hence multiple bitcode files. However, it seems that opt does not take the whole program, but just one bitcode file, "test.bc" in the example run shown below. $ opt -load mypass.dylib -mymodulepass < test.bc > /dev/null How do I run my module pass in a library on a whole program? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110712/c5b2bd6f/attachment.html>
2010 Nov 02
0
[LLVMdev] Identify recursion in a call graph
Hi Trevor, > Converting my ModulePass to a CallGraphSCCPass doesn't seem feasible, so I'll > use llvm::scc_iterator. Here's what I have so far: > > bool MyModulePass::isRecursive() { > CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot(); > for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode), E = > scc_end(rootNode); SCCI != E; ++SCCI) { > const std::vector<CallGraphNode*> &nextSCC = *SCCI; > if (nextSCC.siz...
2011 Jul 12
0
[LLVMdev] running a module pass via opt on multiple bitcode files
...e program as a unit. The target program is built from multiple > object files, hence multiple bitcode files. However, it seems that opt > does not take the whole program, but just one bitcode file, "test.bc" > in the example run shown below. > > $ opt -load mypass.dylib -mymodulepass < test.bc > /dev/null > > How do I run my module pass in a library on a whole program? > Link the bitcode files together into a single bitcode file with llvm-ld. You can then run the single bitcode file through opt. -- John T. > Thanks. > > > > ___________________...
2010 Nov 02
2
[LLVMdev] Identify recursion in a call graph
...unkel On Tue, Nov 2, 2010 at 4:27 AM, Duncan Sands <baldrick at free.fr> wrote: > Hi Trevor, > > > Converting my ModulePass to a CallGraphSCCPass doesn't seem feasible, so > I'll > > use llvm::scc_iterator. Here's what I have so far: > > > > bool MyModulePass::isRecursive() { > > CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot(); > > for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode), E = > > scc_end(rootNode); SCCI != E; ++SCCI) { > > const std::vector<CallGraphNode*> &nextSCC = *SCCI;...
2011 Aug 19
2
[LLVMdev] running a module pass via opt on multiple bitcode files
...object to process an entire program as a unit. The target program is built from multiple object files, hence multiple bitcode files. However, it seems that opt does not take the whole program, but just one bitcode file, "test.bc" in the example run shown below. $ opt -load mypass.dylib -mymodulepass < test.bc > /dev/null How do I run my module pass in a library on a whole program? Link the bitcode files together into a single bitcode file with llvm-ld. You can then run the single bitcode file through opt. -- John T. Thanks. _______________________________________________ L...
2009 Mar 24
1
[LLVMdev] Problem with MemoryDependenceAnalysis
...tAnalysis of MemoryDependenceAnalysis from it, i didn't use TargetData directly to regenerate the error i am attaching a c file containing an example code to regenerate the error. with its Makefile the command line i used is: opt -time-passes -analyze -load ${LLVM_PATH}/Release/lib/.libs/libMYMODULEPASS.so -MyModulePass < test.bc i tried the same but from a function pass and it worked. John Criswell wrote: > Amr Yehia wrote: > >> no .. i am calling a function pass from a module pass, adding other >> function passes to my module pass works, but when i try to add >&...
2011 Aug 19
0
[LLVMdev] running a module pass via opt on multiple bitcode files
...e program as a unit. The target program is built from multiple > object files, hence multiple bitcode files. However, it seems that opt > does not take the whole program, but just one bitcode file, "test.bc" > in the example run shown below. > > $ opt -load mypass.dylib -mymodulepass < test.bc > /dev/null > > How do I run my module pass in a library on a whole program? > > > Link the bitcode files together into a single bitcode file with > llvm-ld. You can then run the single bitcode file through opt. > > -- John T. > > > Thanks. > &g...
2010 Oct 29
2
[LLVMdev] Identify recursion in a call graph
Hi, Is there any facility in LLVM to identify recursion in a call graph? I realize this is undecidable in the general case due to function pointers, but at least the static cases could be identified. I don't even care about whole-program recursion, just looking at a single module would suffice. But I don't see anything like this already in LLVM, so do I simply write some code to
2010 Oct 30
0
[LLVMdev] Identify recursion in a call graph
Hi Trevor, > Is there any facility in LLVM to identify recursion in a call graph? I > realize this is undecidable in the general case due to function > pointers, but at least the static cases could be identified. I don't > even care about whole-program recursion, just looking at a single > module would suffice. But I don't see anything like this already in > LLVM, so do
2010 Nov 02
0
[LLVMdev] Identify recursion in a call graph
...27 AM, Duncan Sands <baldrick at free.fr> wrote: > >> Hi Trevor, >> >> > Converting my ModulePass to a CallGraphSCCPass doesn't seem feasible, so >> I'll >> > use llvm::scc_iterator. Here's what I have so far: >> > >> > bool MyModulePass::isRecursive() { >> > CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot(); >> > for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode), E = >> > scc_end(rootNode); SCCI != E; ++SCCI) { >> > const std::vector<CallGraphNode*> &n...