Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Pass vs. FunctionPass"
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 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
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
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
2003 Dec 15
1
[LLVMdev] Assertion failed in Pass.cpp
Hi all,
I am trying to write a pass for the llc tool. I register this pass
with the RegisterLLC template. However, when I try to run llc and load
up the pass, I get a failed assertion:
$ /storage/anshuman/llvmCVS/llvm/tools/Debug/llc -load=./libTest.so
--help
...
...
llc: Pass.cpp:327: void
llvm::RegisterPassBase::unregisterPass(llvm::PassInfo*): Assertion `I
!= PassInfoMap->end()
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
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.
*
2010 Aug 12
0
[LLVMdev] Optimization pass questions
On Aug 11, 2010, at 4:55 PM, Larry Gritz 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? 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?
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 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>
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
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
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:
2010 Aug 12
1
[LLVMdev] Optimization pass questions
On Aug 11, 2010, at 5:57 PM, Tanya Lattner wrote:
> Have you read this document?
> http://llvm.org/docs/WritingAnLLVMPass.html#passtype
Yes, but I didn't find it as instructive as I'd hoped. The only two examples of pass sets I can find are the Kaleidoscope tutorial and StandardPasses.h (corresponding, I assume, to what llvm-gcc does). Just looking at the two of these, some
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.
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
2006 Sep 29
2
[LLVMdev] FunctionPass requiring SCCs
I have a FunctionPass F that needs a list of all the SCCs for use in its
doFinalization() method. Let's say I write a CallGraphSCCPass C that
creates an array of all SCCs. Let C be required by F, and let F call
getAnalysis<C>() from its doFinalization() method. Am I guaranteed that
C's runOnSCC() method will have executed on all SCCs before F's
doFinalization() method?
2015 May 06
3
[LLVMdev] (Possibly buggy?) doFinalization method behavior of FunctionPass
Hello again,
First of all, thanks for all the answers =) they really helped a lot =D
*Have you verified that some other pass is not adding the function
declarations back in after your pass is executed (e.g., by using the
-debug-pass=Executions argument to see what passes run after your pass)?*
I considered that for a moment, but I realized that wouldn't be possible
for two reasons: I
2015 May 06
3
[LLVMdev] (Possibly buggy?) doFinalization method behavior of FunctionPass
Hello there,
I'm writing some LLVM passes, and just ran into an interesting situation:
now, I don't know if I misunderstood the way doFinalization is supposed to
work, but I hope someone could help =)
One of the transformations I wrote needed to replace some instructions
within the code, so I needed to clean up the code after the process was
completed. The pass basically swapped some
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