Displaying 20 results from an estimated 60000 matches similar to: "[LLVMdev] About loop information in LLVM during compiling"
2010 Aug 12
2
[LLVMdev] Questions about trip count
On 08/12/2010 09:41 PM, Douglas do Couto Teixeira wrote:
> Dear guys,
>
> I am having problems to obtain good information from the LoopInfo.
> I am always getting a trip count of 0, even though I am clearly passing
> a loop with a constant bound. I am using this pass below:
Hi,
I would propose to first check if the trip count is calculated
correctly. I would do this with opt
2014 Apr 04
3
[LLVMdev] Add a new information and preserve it in LLVM
Hello,
I am trying to add some thing into LLVM, while I encountered some problems.
So my situation is that I have some information W, some transform passes may change it, after these passes, I need the new W. What I did is to create an analysis pass similar to scalar-evolution or loopinfo, I can get the information by using getAnalysis<W>(); and preserve this information W by using
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
2008 Nov 30
3
[LLVMdev] Error when using getAnalysis
Hi,
I'm trying to use the function getAnalysis. This is the code I'm using :
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<LoopInfo>();
AU.setPreservesAll();
}
virtual bool runOnModule(Module &M) {
LoopInfo &LI = getAnalysis<LoopInfo>();
}
I get following error when I try to run my pass :
opt:
2010 Aug 14
0
[LLVMdev] Questions about trip count
On Thu, Aug 12, 2010 at 5:22 PM, Tobias Grosser
<grosser at fim.uni-passau.de>wrote:
> On 08/12/2010 09:41 PM, Douglas do Couto Teixeira wrote:
>
>> Dear guys,
>>
>> I am having problems to obtain good information from the LoopInfo.
>> I am always getting a trip count of 0, even though I am clearly passing
>> a loop with a constant bound. I am using
2012 Jul 05
3
[LLVMdev] "symbol lookup error" while running a Simple Loop Pass
Hello;
I wrote this simple loop pass to collect the number of instructions in each
loop of the program. The code is as follows-
#define DEBUG_TYPE "loopinst"
#include "llvm/Pass.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Instructions.h"
#include
2015 Jul 29
1
[LLVMdev] Loop Dependence Analysis(getDistance())
Hi,
I am trying to use the DependenceAnalysis pass to get the Distance vector
for the innermost loop. I am in LLVM learing process. I have used the
following code inside my original code to get the distance vector. It is
not giving any syntax error but it is has some logical but and giving
segmentation fault.
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
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
2014 Aug 29
2
[LLVMdev] The problem of densemap and loop
Dear John,
First thing, the 3 loops in Densemap are all " Loop at depth 1 containing: %1<header><exiting>,%3,%5<latch> " in the 3 functions.
The dense map is in a ImmutablePass. I got it in FunctionPass and tried insert the information in this FunctionPass. So to turn the FunctionPass to ModulePass may be a better idea?
Another interesting thing: if just before
2012 Jul 05
0
[LLVMdev] "symbol lookup error" while running a Simple Loop Pass
Problem solved. I was building llvm in a separate llvm-build directory. I
built it within the llvm-src directory (which kept all the llvm .so and my
pass' .so in the llvm-src/Release+Asserts/lib directory) to solve the
problem.
Can anyone tell me what's the difference between writing a pass as a
"struct" (as in the tutorial) and as a "class" (as most developers do)?
2012 Mar 09
3
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
Thank you for your quick reply.
Actually I am using a std::map to map Function* to LoopInfo*, but that does not help in this case. Each time I call getAnalysis<llvm::LoopInfo>(*F), it returns the same instance of llvm::LoopInfo, so the std::map is just mapping every function into the same instance. It seems only the analysis result for the last function is valid, because all the result for
2017 Jul 10
2
Problems with registering of ModulePass (with Dependencies)
Hello,
I have created a ModulePass, that now needs LoopInfo information.
The ModulePass registration is taken from [1]. I use clang to directly invoke
it (This is also a hard requirement, because I need the fancy output of clang
warnings/remarks).
The problem is, that the dependency to the LoopInfoWrapperPass does not seem
to work. The error is:
--- snip ---
clang-4.0:
2012 Mar 09
0
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
On 3/9/12 4:28 PM, Fan Long wrote:
> Thank you for your quick reply.
>
> Actually I am using a std::map to map Function* to LoopInfo*, but that
> does not help in this case. Each time I call
> getAnalysis<llvm::LoopInfo>(*F), it returns the same instance of
> llvm::LoopInfo, so the std::map is just mapping every function into
> the same instance. It seems only the
2010 Apr 20
1
[LLVMdev] iterate over loops inside the runOnFunction
Hello
I'm wandring to write a Function parser that iterates over loops inside each
function and inside each loop iterates over instructions
So I found a way to do the Function parser that iterates over BasicBlocks
(using the runOnfunction Pass) but I no know how make it iterates over
loops ?
So my question is there any way to make a loop inside the runOnfunction to
iterate over
2012 Apr 26
2
[LLVMdev] Detect if a basicblock is part of a loop
Hi Rinaldini,
In order to find information about loops inside a given function you should use something like "LoopInfo *LI = P->getAnalysis<LoopInfo>()", remembering to add "AU.addRequired<LoopInfo>();" to your getAnalysisUsage method.
If the function you are interested to is not located in the module being compiled (if you created it as an auxiliary function,
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 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
2012 Jul 05
1
[LLVMdev] "symbol lookup error" while running a Simple Loop Pass
Hi,
> Problem solved. I was building llvm in a separate llvm-build directory. I
> built it within the llvm-src directory (which kept all the llvm .so and my
> pass' .so in the llvm-src/Release+Asserts/lib directory) to solve the
> problem.
I do not fully understand what you mean, there should be no difference
on building out of source AFAIK.
> Can anyone tell me what's
2012 Mar 09
2
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
Hello,
I am trying to write a new ModulePass using LoopInfo analysis result, but it seems I misunderstand some concept about PassManager. Basically I want to keep LoopInfo analysis result alive. Here is an example showing the problem I encountered, assuming I already addRequired<llvm::LoopInfo>() in getAnalysisUsage:
void foo(llvm::Function *F1, llvm::Function *F2) {
llvm::LoopInfo
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