Displaying 20 results from an estimated 8000 matches similar to: "[LLVMdev] how to access loopInfo"
2010 Mar 11
0
[LLVMdev] how to access loopInfo
On Thursday 11 March 2010 12:36:55 Jochen Wilhelmy wrote:
> Hi!
>
> I'd like to analyze a function with the llvm::LoopInfo pass and then
> write some info to disk. I create a FunctionPassManager and insert it and
> a DominatorTree which is required by LoopInfo.
> As it turns out the analysis info is only available to other
> passes and gets cleared when the run function of
2010 Mar 11
1
[LLVMdev] how to access loopInfo
Hi!
> I'm not sure what you mean by this new pass being of no use to other passes.
> It's not generating any new information about the program (or if it is, it's
> writing it to disk), so other passes wouldn't need it anyway.
>
So I know that I'm on the right way. I just think it's a bit of overhead
implementing an own pass
and register it using
2011 May 04
1
[LLVMdev] 2.9 segfault when requesting for both LoopInfo and DominatorTree analyses.
Your constructor is not calling initializeTestMPPass(), and you're
using RegisterPass which I think was deprecated in favor of
INITIALIZE_PASS. You can look at, for example,
lib/Transforms/Scalar/IndVarSimplify.cpp for examples of how to
initialize, e.g. having "INITIALIZE_PASS_DEPENDENCY(LoopInfo)"
sandwiched between BEGIN and END. Note that you'll want a forward
declaration of
2011 May 03
4
[LLVMdev] 2.9 segfault when requesting for both LoopInfo and DominatorTree analyses.
When migrating my project to 2.9, I've encountered a strange segfault
where if a ModulePass's getAnalysisUsage adds LoopInfo and
DominatorTree, then llvm::PMTopLevelManager::findAnalysisUsage will
segfault. What's odd is that if I rearrange this (add required for
DominatorTree before LoopInfo), it does not segfault. I realize that
LoopInfo requires and preserves DominatorTree, but this
2011 May 04
0
[LLVMdev] 2.9 segfault when requesting for both LoopInfo and DominatorTree analyses.
Hi Michael, hi Duncan,
yesterday I stumbled over something that might be related.
At least I could also just be doing some initialization wrong or
something in this direction...
In my case, I hit a segfault in PassInfo::isAnalysisGroup() after
PassManager.add(myModulePass) is called.
My setup seems fairly simple, the attached code should reproduce the error.
Compile with
g++ test.cpp
2011 May 04
2
[LLVMdev] 2.9 segfault when requesting for both LoopInfo and DominatorTree analyses.
Thanks for the response. I do have assertions enabled, and none of
them are getting hit. I did do a search of the mailing list for the
past year (approximately) before writing my email, and what I found
was that you should be allowed to use LoopInfo and other analysis
function passes from a module pass, with the only difference being
that getAnalysis is passed the function. The example code I
2011 May 04
0
[LLVMdev] 2.9 segfault when requesting for both LoopInfo and DominatorTree analyses.
Hi Michael,
> When migrating my project to 2.9, I've encountered a strange segfault
> where if a ModulePass's getAnalysisUsage adds LoopInfo and
> DominatorTree, then llvm::PMTopLevelManager::findAnalysisUsage will
> segfault.
I suggest you build LLVM with assertions enabled - then you should get a
helpful error message rather than a segfault. I think you are not allowed
to
2011 Mar 03
2
[LLVMdev] how can I have LoopInfo in a module pass?
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 did the above in runOnModule, and run the pass, the following error popped
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
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
2019 Apr 03
3
How can I use llvm::LoopInfo in the runOnModule method?
Interesting that we're getting a relative flood of these recently.
See here:
http://lists.llvm.org/pipermail/llvm-dev/2019-March/131346.html
I don't think one can reliably get a Function analysis pass from within
a ModulePass using the legacy pass manager. You have to manually
construct the pass yourself.
-David
Jonathan Smith via llvm-dev <llvm-dev at
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
2011 Oct 25
1
[LLVMdev] Using a FunctionPass inside a CallGraphSCCPass
Hi,
I am writing a CallGraphSCCPass that uses LoopInfo which is a FunctionPass.
However, doing so results in the following error.
****
Unable to schedule 'Natural Loop Information' required by '......'
****
Google led me to this page, where Devang Patel suggests implementing the
addLowerLevelRequiredPasses in CGPassManager in a manner similar to
MPPassManager.
2011 May 17
0
[LLVMdev] 2.9 segfault when requesting for both LoopInfo and DominatorTree analyses.
Hi,
I am running into the same issue with a module pass, that calls
LoopInfo.(does not call DominatorTree)
I am using RegisterPass, since it is a dynamically loaded module(as per
lib/Transforms/Hello)
It does seem possible from the discussion, to use LoopInfo inside a
ModulePass.
I am wondering what the fix to this problem was.
Also, the code works in 2.7.(I did not try 2.8)
Thanks,
Arushi
2011 Nov 30
0
[LLVMdev] Fwd: Problem getting LoopInfo inside non-LoopPass
The following code is causing an "UNREACHABLE executed!" and a stack dump,
any ideas?
namespace {
struct myPass : public CallGraphSCCPass {
static char ID;
myPass() : CallGraphSCCPass(ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired<LoopInfo>();
}
virtual bool runOnSCC(CallGraphSCC &SCC)
2010 Sep 15
2
[LLVMdev] getAnalysis<LoopInfo> from ModulePass
Hi,
I wrote tiny ModulePass which iterates over functions and then uses getAnalysis<LoopInfo> in order to get informations about the loop.
It compiles smoothly, but whenever I try to run it I got error like this:
opt: .. PassAnalysisSupport.h:203: AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*) const [with AnalysisType = llvm::LoopInfo]: Assertion `ResultPass &&
2016 Jul 13
3
[PM] I think that the new PM needs to learn about inter-analysis dependencies...
On Wed, Jul 13, 2016 at 12:25 AM Sean Silva <chisophugis at gmail.com> wrote:
> On Tue, Jul 12, 2016 at 11:39 PM, Chandler Carruth <chandlerc at gmail.com>
> wrote:
>
>> On Tue, Jul 12, 2016 at 11:34 PM Sean Silva <chisophugis at gmail.com>
>> wrote:
>>
>>> On Tue, Jul 12, 2016 at 11:32 PM, Xinliang David Li <davidxl at google.com>
2009 Oct 07
1
[LLVMdev] Use LoopInfo in a non-pass class such as ProfileInfoLoader?
Hi everyone,
I'm adding loop profiling to LLVM built-in profiler. I'm just
wondering in a class that's not a pass, such as ProfileInfoLoader, how
can I get information produced by passes such as LoopInfo and
DominatorTree?
In other words, ProfileInfoLoader is not a pass, so it can't call
AnalysisUsage::addRequired and AnalysisUsage::getAnalysisUsage
directly. Then how can it know
2011 Nov 30
2
[LLVMdev] Fwd: Problem getting LoopInfo inside non-LoopPass
On Tue, Nov 29, 2011 at 6:59 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> The following code is causing an "UNREACHABLE executed!" and a stack dump,
> any ideas?
The stack might be handy.
> namespace {
> struct myPass : public CallGraphSCCPass {
> static char ID;
> myPass() : CallGraphSCCPass(ID) {}
> virtual void getAnalysisUsage(AnalysisUsage
2019 Apr 02
2
How can I use llvm::LoopInfo in the runOnModule method?
Hi all,
I tried to have a LoopInfo object in a function pass, and add addRequired
in getAnalysisUsage, and then use getAnalysis 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 did the above in runOnModule, and build the module pass, the
following error popped out, and the