similar to: [LLVMdev] reusing FunctionPassManager with different Modules

Displaying 20 results from an estimated 7000 matches similar to: "[LLVMdev] reusing FunctionPassManager with different Modules"

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
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.
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
2010 Aug 11
4
[LLVMdev] Optimization pass questions
I have a whole slew of questions about optimization passes. Answers to any or all would be extremely helpful: How important are doInitialization/doFinalization? I can't detect any difference if I use them or not. Why does the function pass manager have doInitialization/doFinalization, but the global pass manager doesn't? If I am applying the function passes to many functions, do I
2010 Aug 12
0
[LLVMdev] Optimization pass questions
Larry, On Wed, Aug 11, 2010 at 4:55 PM, Larry Gritz <lg at larrygritz.com> wrote: > I have a whole slew of questions about optimization passes. Answers to any > or all would be extremely helpful: > > How important are doInitialization/doFinalization? Most of the passes do not use them. > I can't detect any difference if I use them or not. Say, if you are writing
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),
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 : public ModulePass { FunctionPassManager
2020 Apr 04
2
Running opt O1 outside of llvm
Hi, I would like to run the -O1 pass sequence followed by -reg2mem from an out of tree project which uses llvm. I am using the following code snippet to do so but in some cases, my method is also vectorising the code, which doesn't happen when running the same sequence(-S -O1 -reg2mem) through opt. Can someone please help me find what I am missing? Thanks, Akash. *
2007 Jan 22
2
[LLVMdev] addPassesToEmit(Whole)File changes?
Hi folks, just installed the new llvm 1.9 build and noticed that my code no longer worked. It seems something has changed with addPassesToEmitFile(). First, the arguments to that method changed so that it no longer takes a PassManager, but only a FunctionPassManager. Instead there is a addPassesToEmitWholeFile() method, but that is marked as optional, and when I change my code to
2016 May 10
2
Some questions about phase ordering in OPT and LLC
> >> You can look at AddOptimizationPasses() in opt.cpp. > > > > As far as I understand, the two passmanager do not interleave their > > passes. It first runs all the function passes and below. Then all the > > module passes. So if you specify: > > > > opt -mymodulepass0 -myfunctionpass -mymodulepass1 > > > > What you actually get is:
2015 Dec 20
3
How to run InternalizePass
I'm working on a whole program optimizer that uses LLVM as a library, and one of the things I want to do is eliminate dead global functions and variables even when they are not local to a module. (This understandably doesn't happen by default because the optimizer has to assume it could be compiling a library rather than a program.) I've actually written a function to do this, but
2007 Jan 22
0
[LLVMdev] addPassesToEmit(Whole)File changes?
On Sun, 21 Jan 2007, Marcel Weiher wrote: > just installed the new llvm 1.9 build and noticed that my code no > longer worked. It seems something has changed with > addPassesToEmitFile(). First, the arguments to that method changed so > that it no longer takes a PassManager, but only a > FunctionPassManager. Instead there is a addPassesToEmitWholeFile() > method, but that is
2015 May 06
2
[LLVMdev] (Possibly buggy?) doFinalization method behavior of FunctionPass
On 5/6/15 11:15 AM, Kuperstein, Michael M wrote: > > I’ve always thought that the only guarantee is that > doFinalization(Module &M) runs after runOnFunction() was executed for > all functions in M, and there’s no guarantee it runs *immediately* after. > > That is, a PM may run a bunch of function passes over each function, > and only then call doFinazliation() for each
2015 May 06
5
[LLVMdev] (Possibly buggy?) doFinalization method behavior of FunctionPass
On 5/6/15 10:19 AM, Kuperstein, Michael M wrote: > > Hello Cristiano, > > I don’t think doFinalization() is really meant to be used this way. > My understanding is that doInitialization() and doFinalization() are designed specifically for modifying the LLVM IR (otherwise, why would a mutable reference to the Function be provided)? If that is not the case, then there is either a
2012 Dec 17
3
[LLVMdev] LoopPass doFinalization() called multiple times per program?
On Sun, Dec 16, 2012 at 7:23 AM, Duncan Sands <baldrick at free.fr> wrote: > Hi Stephen, > > > On 13/12/12 18:58, Stephen McGruer wrote: > >> I'm wondering if the documentation for LoopPass >> (http://llvm.org/docs/**WritingAnLLVMPass.html#**LoopPass<http://llvm.org/docs/WritingAnLLVMPass.html#LoopPass>) >> is misleading or >> incorrect (or
2012 Dec 13
2
[LLVMdev] LoopPass doFinalization() called multiple times per program?
I'm wondering if the documentation for LoopPass ( http://llvm.org/docs/WritingAnLLVMPass.html#LoopPass) is misleading or incorrect (or if I'm just missing something.) The documentation states: "The doFinalization method ... is called when the pass framework has finished calling runOnLoop<http://llvm.org/docs/WritingAnLLVMPass.html#runOnLoop> for every loop in the program being
2011 Jun 29
2
[LLVMdev] How to disable pass grouping(scheduling)
Thanks John, this is an easy way to achieve this goal, but I'm wondering if this is the only way? I have around 100 passes. Quoting John Criswell <criswell at illinois.edu>: > On 6/28/11 11:35 PM, kecheng at cecs.pdx.edu wrote: >> Hi all, >> >> Llvm can automatically group a list passes. I want to do some >> experiment to see the difference between grouping
2007 Feb 22
3
[LLVMdev] opt -verify
I followed what you said and called verifyModule() with the AbortProcessAction option. verifyModule() returns false, but does not abort and does not print out any information about what caused the verification to fail. Chris Lattner wrote: > On Wed, 21 Feb 2007, Ryan M. Lefever wrote: >> I am writing an interprocedural compiler pass. Because the passneeds >> information from a
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.
2008 May 28
1
[LLVMdev] Asm output while executing
Hello, I'm trying to catch assembly output and do some formatting for its presentation while being executed. I face a problem, which is clear from the error, although I have no clue on how to do it otherwise. If generating the code for its asm output and then for jit execution I get: ********** static llvm::MachineFunction& llvm::MachineFunction::construct(const llvm::Function*, const