Displaying 20 results from an estimated 40000 matches similar to: "[LLVMdev] Minor change to Pass API: use ModulePass now"
2007 Apr 25
2
[LLVMdev] ModulePass that requires FunctionPass
Hi Devang,
You recently mentioned that the pass manager now allows a ModulePass
to require a FunctionPass. I just tried it but ran into errors. Could
you please take a look to see if I did anything wrong? Thanks!
Basically I changed the HelloWorld sample pass to be a ModulePass and
tried to use the LoopInfo pass inside the runOnModule routine.
See below for the source code and error messages.
2009 Apr 10
0
[LLVMdev] Pass Manager Restriction?
"A module pass can use function level passes (e.g. dominators) using
getAnalysis interfacegetAnalysis<DominatorTree>(Function), if the
function pass does not require any module passes."
http://llvm.org/docs/WritingAnLLVMPass.html
In your case, A module pass (ModPass2) is trying tu use function level
pass (FunPass1) which uses module level pass (ModPass1). This is not
2009 Apr 09
3
[LLVMdev] Pass Manager Restriction?
Having a ModulePass that requires a FunctionPass that in turn requires
another ModulePass results in an assertion being fired. Is this
expected behavior (that seems to be undocumented), or a bug?
Specifically, the following code will emit the assertion:
[VMCore/PassManager.cpp:1597: virtual void
llvm::ModulePass::assignPassManager(llvm::PMStack&,
llvm::PassManagerType): Assertion
2009 Aug 10
2
[LLVMdev] How to use a FunctionPass in a ModulePass?
Hi, all:
I wanted to use a FunctionPass (e.g. *MemoryDependenceAnalysis*) in a
ModulePass, and then I used the method "getAnalysis<*
MemoryDependenceAnalysis*>(llvm::Function *)" described at
http://llvm.org/docs/WritingAnLLVMPass.html#ModulePass to get the
FunctionPass. But , it still crashed when I invoked this pass in tool 'opt'.
However, if I change my pass to
2009 Apr 10
2
[LLVMdev] Pass Manager Restriction?
Good to know. I was referencing a local copy of 2.3 docs which didn't
include the "does not require any module passes" statement. It appears
the docs were changed two days before 2.4 was released in November. I
suppose I should update my docs more often.
Are there any plans to change this restriction, or any best practices
to get similar behavior? Since immutable pass is a subclass
2010 May 11
0
[LLVMdev] [Fwd: Error while running my pass with opt]
John Criswell wrote:
> ambika wrote:
>> Here is getAnalysisUsage() i am using,
>>
>> void getAnalysisUsage(AnalysisUsage&AU) const {
>> AU.setPreservesAll();
>> AU.addRequired<DominatorTree>();
>> }
>>
>> and then I use it as,
>>
>>
>> bool ptrTest::runOnModule(Module&M) {
>>
>>
2011 Jun 16
0
[LLVMdev] Cannot use function pass in a module pass
On 6/15/11 6:46 PM, Alexey Bakhirkin wrote:
> Hi. I'm trying to implement a module pass which can be dynamically
> loaded by `opt` (against up-to-date llvm from 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
2011 Jun 15
3
[LLVMdev] Cannot use function pass in a module pass
Hi. I'm trying to implement a module pass which can be dynamically
loaded by `opt` (against up-to-date llvm from 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
2011 Jun 16
1
[LLVMdev] Cannot use function pass in a module pass
Thanks, John.
There were a couple of function declarations in the module, and
'getAnalysis' failed for those.
By the way, what do you mean by "in older versions of LLVM"? I'm quite
sure I was using the latest llvm trunk.
2011/6/16 John Criswell <criswell at cs.uiuc.edu>:
> On 6/15/11 6:46 PM, Alexey Bakhirkin wrote:
>> Hi. I'm trying to implement a module
2007 Dec 18
0
[LLVMdev] Another Pass Manager Assertion
On Dec 18, 2007, at 10:55 AM, John Criswell wrote:
> Dear All,
>
> The attached code (which is a contrived test case) hits the following
> assertion:
>
> test:
> /home/vadve/criswell/src/llvm22/include/llvm/PassAnalysisSupport.h:
> 226:
> AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*,
> llvm::Function&) [with AnalysisType = Pass1]: Assertion
2010 May 10
2
[LLVMdev] [Fwd: Error while running my pass with opt]
ambika wrote:
> Here is getAnalysisUsage() i am using,
>
> void getAnalysisUsage(AnalysisUsage &AU) const {
> AU.setPreservesAll();
> AU.addRequired<DominatorTree>();
> }
>
> and then I use it as,
>
>
> bool ptrTest::runOnModule(Module &M) {
>
> DominatorTree &DT = getAnalysis<DominatorTree>();
> ......
>
2011 Mar 03
0
[LLVMdev] how can I have LoopInfo in a module pass?
On 3/3/11 3:09 PM, Wenbin Zhang wrote:
> Hi all,
> I tried to have a LoopInfo object in a function pass, add
> addRequired<LoopInfo> in getAnalysisUsage, and then use
> getAnalysis<LoopInfo> in runOnFunction(). It worked OK.
> Now I want to have a module pass to traverse the functions, and
> similarly I want to have to loop information of the functions. When I
>
2011 Mar 03
0
[LLVMdev] how can I have LoopInfo in a module pass?
I think this assertion failure may be caused by the getAnalysisUsage(). Mine is like the following:
class myclass : public ModulePass{
...
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<LoopInfo>();
}
...
}
Is it enough? Thanks!
Best,
--Wenbin
----- Original Message -----
From: Wenbin Zhang
To: John Criswell
Cc: llvmdev at
2006 Oct 08
1
[LLVMdev] modulepass requiring a functionpass
I have a ModulePass, which we'll call MP, that generates a dependency
graph for an entire program. I want MP to require the
UnifyFunctionExitNodes pass, which is a FunctionPass. Since its not
possible to make a ModulePass depend on a FunctionPass, is my only
choice to make MP a FunctionPass in which the runOnFunction() routine
does nothing, and the doFinalization routine does all the
2011 Oct 15
1
[LLVMdev] pass utilizing MemoryDependenceAnalysis?
This gives me: Assertion failed: (0 && "Unable to find on the fly
pass"), function getOnTheFlyPass, file PassManager.cpp
#include "llvm/Module.h"
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
struct Hello: public FunctionPass {
public:
static char ID;
Hello(): FunctionPass(ID) {
2011 May 18
0
[LLVMdev] 2.9 pass manager asserts "Unable to handle Pass that requires lower level Analysis pass"
Hi,
I am trying to write an LLVM project, using LLVM 2.9. My passes are defined
as follows, where the Pass2 requires Pass1.
namespace llvm {
class BaseClass : public ModulePass {
// Name for printing
const char* printname;
protected:
BaseClass(char id, const char* name)
: ModulePass(id),printname(name){
}
};
class Pass1 : public BaseClass {
public:
static char ID;
Pass1() :
2011 Mar 03
2
[LLVMdev] how can I have LoopInfo in a module pass?
Thanks John, I modify my code to like this:
bool XXX::ModulePass(Module &M){
....
LoopInfo &li = getAnalysis<LoopInfo>(fi);
....
}
Here fi is a Function* pointing to main().
Now when I run the pass, another error shows up:
AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*, llvm::Function&) [with AnalysisType = llvm::LoopInfo]: Assertion `ResultPass
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.
2012 Aug 29
0
[LLVMdev] How to require ScalarEvolution analysis in a Module pass?
Guys,
What I want to do is to hack global opt pass, which needs ScalarEvolution
analysis. However opt crashed saying
"opt: /home/xchen/llvm/include/llvm/PassAnalysisSupport.h:242:
AnalysisType& llvm::Pass::getAnalysisID(const void*, llvm::Function&) [with
AnalysisType = llvm::ScalarEvolution]: Assertion `ResultPass && "Unable to
find requested analysis info"'
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