search for: functionpassmanager

Displaying 20 results from an estimated 276 matches for "functionpassmanager".

2007 Jun 21
2
[LLVMdev] PassManager vs FunctionPassManager
Right now, addPassesToEmitFile requires a FunctionPassManager. If I'm working with code that uses a plain PassManager and want it to generate code, are there any options better than doing this: /** * Wrapper class to run a FunctionPassManager as a ModulePass so that it * can be added to a plain PassManager. */ class FunctionPassManagerModulePass : pub...
2007 Jun 21
0
[LLVMdev] PassManager vs FunctionPassManager
On Jun 21, 2007, at 4:13 PM, Dan Gohman wrote: > Right now, addPassesToEmitFile requires a FunctionPassManager. If I'm > working with code that uses a plain PassManager and want it to > generate > code, are there any options better than doing this: That's what FPPassManager does (include/llvm/PassManagers.h) . Function pass manager itself is a module level pass. FunctionPassManager i...
2007 Jun 25
1
[LLVMdev] PassManager vs FunctionPassManager
On Thu, Jun 21, 2007 at 04:37:14PM -0700, Devang Patel wrote: > > On Jun 21, 2007, at 4:13 PM, Dan Gohman wrote: > > > Right now, addPassesToEmitFile requires a FunctionPassManager. If I'm > > working with code that uses a plain PassManager and want it to > > generate > > code, are there any options better than doing this: > > That's what FPPassManager does (include/llvm/PassManagers.h) . > Function pass manager itself is a module level...
2011 Sep 25
1
[LLVMdev] reusing FunctionPassManager with different Modules
Thanks. The reason I ask is because I'm looking at some code that does just that. A single FunctionPassManager is constructed with a dummy Module and createStandardFunctionPasses is called on it. The FunctionPassManager cached and run on Functions in other Modules. So far I haven't noticed any problems but I guess that is because the passes added by createStandardFunctionPasses don't touch the Modul...
2011 Sep 23
2
[LLVMdev] reusing FunctionPassManager with different Modules
Hi, Is it generally safe to cache a FunctionPassManager and reuse it on modules other than the one it was constructed with (assuming they have the same target triple)? paul -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110923/cd845b59/attachment.html>
2004 Jun 24
3
[LLVMdev] Pass vs. FunctionPass
I wonder in what cases FunctionPass is better that Pass. For example, addPassesToEmitAssembly takes PassManger and addPassesToJITCompile takes FunctionPassManager. Another question is about FunctionPassManager::run(Function&) and FunctionPass(Function&). The former calls the later, which is fine, but the latter looks like this: bool FunctionPass::run(Function &F) { if (F.isExternal()) return false;// Passes are not run on external function...
2016 Feb 19
3
target triple in 3.8
I added your suggestion and am using this now llvm::legacy::FunctionPassManager *functionPassManager = new llvm::legacy::FunctionPassManager(Mod); llvm::PassRegistry &registry = *llvm::PassRegistry::getPassRegistry(); initializeScalarOpts(registry); functionPassManager->add( new llvm::TargetLibraryInfoWrapperPass(llvm::TargetLibraryInfoImpl(targetMachine->getTarg...
2011 Sep 24
0
[LLVMdev] reusing FunctionPassManager with different Modules
On 09/23/2011 11:28 AM, Redmond, Paul wrote: > Hi, > > Is it generally safe to cache a FunctionPassManager and reuse it on > modules other than the one it was constructed with (assuming they have > the same target triple)? No. FunctionPass has a pair of methods, doInitialization and doFinalization, which take Module& and are allowed to read or modify it outside runOnFunction. Nick
2004 Apr 14
0
[LLVMdev] FunctionPassManager Issue
...VMCore/Pass.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- /home/vadve/lattner/llvm/lib/VMCore/Pass.cpp 21 Nov 2003 20:23:48 -0000 1.54 +++ /home/vadve/lattner/llvm/lib/VMCore/Pass.cpp 9 Feb 2004 00:59:07 -0000 1.55 @@ -91,8 +91,6 @@ void FunctionPassManager::add(FunctionPass *P) { PM->add(P); } void FunctionPassManager::add(ImmutablePass *IP) { PM->add(IP); } bool FunctionPassManager::run(Function &F) { - Function *mF = MP->getModule()->getNamedFunction(F.getName()); - assert((&F == mF) && "ModuleProvider does not...
2012 Nov 14
0
[LLVMdev] Using LLVM to serialize object state -- and performance
I've been profiling more; see <https://dl.dropbox.com/u/46791180/perf.png>. One thing I'm a bit confused about is why I see a FunctionPassManager there. I use a FunctionPassManager at the end of LLVM IR code generation, write the IR to disk, then read it back later. Why is apparently another FunctionPassManager being used during the JIT'ing of the IR code? And how do I control what the passes are to that FunctionPassManager? The func...
2012 Nov 14
2
[LLVMdev] Using LLVM to serialize object state -- and performance
...Lucas Sent: Tuesday, November 13, 2012 4:33 PM To: llvmdev at cs.uiuc.edu List Subject: Re: [LLVMdev] Using LLVM to serialize object state -- and performance I've been profiling more; see <https://dl.dropbox.com/u/46791180/perf.png>. One thing I'm a bit confused about is why I see a FunctionPassManager there. I use a FunctionPassManager at the end of LLVM IR code generation, write the IR to disk, then read it back later. Why is apparently another FunctionPassManager being used during the JIT'ing of the IR code? And how do I control what the passes are to that FunctionPassManager? The func...
2004 Jun 24
0
[LLVMdev] Pass vs. FunctionPass
On Thu, 24 Jun 2004, Vladimir Prus wrote: > I wonder in what cases FunctionPass is better that Pass. For example, > addPassesToEmitAssembly takes PassManger and addPassesToJITCompile takes > FunctionPassManager. Here's a simple way to look at it. Use a Function pass whenever you can. A function pass will always work where a Pass works (it derives from pass as you've noticed), but not the other way around. In particular, there are *strict* rules that must be followed by FunctionPass's, descr...
2004 Apr 14
2
[LLVMdev] FunctionPassManager Issue
Hi, I'm a cs326 student that uses LLVM for our MP. While some of the COOL program can be run seamlessly, I get the following assertion error for many of them. lli: Pass.cpp:95: bool llvm::FunctionPassManager::run(llvm::Function&): >> Assertion `(&F == mF) && "ModuleProvider does not contain this >> function!"' failed. >> >> It seems like I need to link a library to it but I'm not sure how to resolve this. Funny thing, when I use lli -force-i...
2014 Jan 15
2
[LLVMdev] Loop unrolling a function
The loop rotation pass does modify the function, which I'm guessing means that a FunctionPassManager can be used to run LoopPasses (this is not obvious to me after looking through the FunctionPassManager code). Unfortunately none of the other passes I'm using (ScalarEvolution, LCSSA, IndVarSimplify, and LoopUnroll) appear to have an effect. I verified that the function can be loop unrolled by...
2013 Nov 01
2
[LLVMdev] loop vectorizer: this loop is not worth vectorizing
...has a trip count of 4. The L5 outer loop has a variable trip count depending on the functions arguments. I cannot make the L3 loop larger so that the vectorizer might be happy, because this will again introduce 'rem' and 'div' in the index calculation. I am using these passes: functionPassManager->add(llvm::createBasicAliasAnalysisPass()); functionPassManager->add(llvm::createLICMPass()); functionPassManager->add(llvm::createGVNPass()); functionPassManager->add(llvm::createLoopVectorizePass()); functionPassManager->add(llvm::createInstructionCombiningPass...
2012 Nov 13
3
[LLVMdev] Using LLVM to serialize object state -- and performance
Switching to CodeGenOpt::None reduced the execution time from 5.74s to 0.84s. By just tweaking things randomly, changing to CodeModel::Small reduced it further to 0.22s. We have some old, ugly, pure C++ code that we're trying to replace (both because it's ugly and because it's slow). It's execution time is about 0.089s, so that's the time to beat. Hence, I'd like to
2008 Nov 07
2
[LLVMdev] Fwd: Basic questions
...e past you just to be sure that it is/isn't possible? I'd like to support users dynamically adding and using functions (plus structs, globals etc) to a Module, JIT compiling to an ExecutionEngine, in an interleaved fashion. That is, declare & define a function, run it through a FunctionPassManager, add it to an ExecutionEngine, use it, go ahead and repeat for a different function with the same Module, FunctionPassManager & ExecutionEngine, etc. Also, does there need to be a 1-1-1 correspondence between Module, FunctionPassManager and ExecutionEngine, or can it be 1-many(1-1)? Tha...
2009 Jul 26
2
[LLVMdev] Pass Scheduling Information without using opt
Hey Daniel, thanks for the response. > I believe all you need to do is call llvm::llvm_shutdown(). > I am not sure that this is what I need. When and how should I call llvm_shutdown()? After the FunctionPassManager is done, the calling ModulePass still performs quite a few actions on the transformed code and also calls the FunctionPassManager on different functions. However, I need to display statistics about the transformation of each function separately. If I call llvm_shutdown() after the FunctionPassMa...
2011 May 31
0
[LLVMdev] Assertion failure in MC emitter running LLVM libs on Android using android-ndk
...s::getHostTriple(); const llvm::Target *target = llvm::TargetRegistry::lookupTarget( targetTriple, errorStr ); llvm::TargetMachine *targetMachine = target->createTargetMachine( targetTriple, "" ); targetMachine->setAsmVerbosityDefault( true ); llvm::FunctionPassManager *functionPassManager = new llvm::FunctionPassManager( module.get() ); targetMachine->addPassesToEmitFile( *functionPassManager, llvm::fouts(), llvm::TargetMachine::CGFT_AssemblyFile, optLevel ); functionPassManager->doInitialization(); llvm::Modul...
2009 Jan 28
1
[LLVMdev] Newbie question: Getting info about JIT-compiled function
Andrew Haley wrote: > Jeff Kuskin wrote: > > Apologies if this is a FAQ. > > > > I am using the LLVM JIT facility on an x86_64 platform. I generate > > IR for a single function using IRBuilder(), use the > > FunctionPassManager to do some optimization passes, and then call > > ExecutionEngine::getPointerToFunction() to get a native-code version > > of the function. Everything works fine so far. > > > > Two questions: > > > > Question (1): How can I get the size of the native function?...