Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] LoopInfo Question"
2011 Feb 28
2
[LLVMdev] LoopInfo of a basic block
On 2/28/11 4:43 PM, Devang Patel wrote:
>
> On Feb 28, 2011, at 2:35 PM, Naznin Fauzia wrote:
>
>> Hi all,
>>
>> How Can I get the Loops around an Instruction?
>>
>> I know I can get the basic block of an instruction using
>> inst.getParent() which returns a BasicBlock*. Now I want to use the
>> getLoopFor(BasicBlock) method of the class
2011 Feb 28
2
[LLVMdev] LoopInfo of a basic block
Hi all,
How Can I get the Loops around an Instruction?
I know I can get the basic block of an instruction using inst.getParent()
which returns a BasicBlock*. Now I want to use the getLoopFor(BasicBlock)
method of the class LoopInfo.
But I dont know how to get the LoopInfo.
BasicBlock* bb = inst.getParent();
(... what should I add here?)
Loop* innerloop = LI -> getLoopFor(bb):
Thanks.
2011 Feb 28
0
[LLVMdev] LoopInfo of a basic block
Thanks Devang and John. My pass is actually a loop pass, not a function
pass. So, I couldnt override the getAnalysisUsage.
I am in a loop pass, I know the outermost loop. Now How can I get the
loopInfo from here? I couldn't find helpful methods in the LoopInfo class
documents.
On Mon, Feb 28, 2011 at 5:52 PM, John Criswell <criswell at illinois.edu>wrote:
> On 2/28/11 4:43 PM,
2011 Feb 28
0
[LLVMdev] LoopInfo of a basic block
On Feb 28, 2011, at 2:35 PM, Naznin Fauzia wrote:
> Hi all,
>
> How Can I get the Loops around an Instruction?
>
> I know I can get the basic block of an instruction using inst.getParent() which returns a BasicBlock*. Now I want to use the getLoopFor(BasicBlock) method of the class LoopInfo.
> But I dont know how to get the LoopInfo.
>
> BasicBlock* bb =
2011 Feb 28
1
[LLVMdev] LoopInfo of a basic block
On Mon, Feb 28, 2011 at 6:04 PM, Naznin Fauzia <laboni14 at gmail.com> wrote:
> Thanks Devang and John. My pass is actually a loop pass, not a function
> pass. So, I couldnt override the getAnalysisUsage.
>
A LoopPass is no different from a FunctionPass here. You can use
getAnalysisUsage and getAnalysis in a LoopPass.
> I am in a loop pass, I know the outermost loop. Now How
2004 Aug 05
2
[LLVMdev] How to get LoopInfo within Pass subclass?
Hi, I have a hopefully quick question. I'm writing a Pass that needs to
see a whole module at a time and keep some state, so I subclassed Pass.
However, I want to be able to see the Loops in each Function. Roughly,
here's what I want:
virtual bool run(Module &M){
// do stuff...
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I){
if(! I->isExternal())
2011 Nov 16
0
[LLVMdev] CallSite in innermost loop
On Nov 16, 2011, at 2:43 AM, Pankaj Gode wrote:
> In order to detect whether CallSite is present in innermost loop, do I need to insert logic from LoopInfo pass for collecting loops, within a CallGraphSCC pass?
>
> Is there any other approach for this?
>
PassManager not only schedules passes, it also
- manages memory
- ensures that analysis info is valid at the point of use
-
2011 Nov 16
2
[LLVMdev] CallSite in innermost loop
In order to detect whether CallSite is present in innermost loop, do I need to insert logic from LoopInfo pass for collecting loops, within a CallGraphSCC pass?
Is there any other approach for this?
Regards,
Pankaj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111116/cd9d51b7/attachment.html>
2012 Apr 26
2
[LLVMdev] Detect if a basicblock is part of a loop
Hi,
I'm trying to detect if a basicblock is part of a loop or not.
I tried the llvm::LoopInfo like that (http://llvm.org/docs/doxygen/html/classllvm_1_1LoopInfo.html#a4abca289c73cd09487e05d11d9f7d877):
LoopInfo *loop = new LoopInfo();
bool isLoop = loop->getLoopFor(myBB); // getLoopFor - Return the inner most loop that BB lives in. If a basic block is in no loop (for example the entry
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
2012 Apr 26
0
[LLVMdev] Detect if a basicblock is part of a loop
Rinaldini,
What exactly did you run? Specifically, you may be missing some
analysis passes that are necessary for LoopInfo to have the loop
information you desire.
-Hal
On Thu, 26 Apr 2012 14:02:04 +0000
Rinaldini Julien <julien.rinaldini at heig-vd.ch> wrote:
> Hi,
>
> I'm trying to detect if a basicblock is part of a loop or not.
>
> I tried the llvm::LoopInfo
2011 Jun 15
2
[LLVMdev] get LPPassManager to use it in llvm::CloneLoop
Thanks , your suggestion was welcome and CloneLoop works without passing the
LPPassManager.
However, I reached another problem. When the loop to be cloned has some
subloops, the subloops are not properly cloned. Some clones of the clones are
created and the CFG between the cloned basic blocks of the subloops is not
correctly built. There are clones like for.body.clone,
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,
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
2012 Mar 09
0
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
On 3/9/12 4:10 PM, Fan Long wrote:
> 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
2011 Nov 10
4
[LLVMdev] Problem getting LoopInfo inside non-LoopPass
John,
This did not work. It compiles (isDeclaration was the name of the
function) and I passed a reference (&F) (F is a function pointer). I still
get the opt load error from the original message (UNREACHABLE exectuted!).
Thanks.
On Thu, Nov 10, 2011 at 10:00 AM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> 1. Ok will do.
> 2. Ok, will do.
> 3. It's a CallGraphPass. I
2005 Jun 29
1
[LLVMdev] null pointer check missing in LoopInfo
In LLVM 1.5, the function isLoopHeader fails to check for a null
pointer after calling getLoopFor. Dunno if this is fixed in CVS, but
attaching a patch anyway ...
Sameer.
--
Research Scholar, KReSIT, IIT Bombay
http://www.it.iitb.ac.in/~sameerds/
-------------- next part --------------
--- LoopInfo.h 2005-06-29 17:42:43.000000000 +0530
+++ llvm/include/llvm/Analysis/LoopInfo.h 2005-06-29
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
2008 May 09
0
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
Hi All,
the attached patch performs the splitting in the proposed manner.
before applying the patch, please execute
svn cp lib/Transforms/Scalar/LoopUnroll.cpp lib/Transforms/Utils/UnrollLoop.cpp
to make the patch apply and preserve proper history.
Transforms/Utils/UnrollLoop.cpp contains the unrollLoop function, which is now
used by the LoopUnroll pass. I've also moved the
2011 May 09
2
[LLVMdev] get LPPassManager to use it in llvm::CloneLoop
Hi,
I try to write a FunctionPass that, among other tasks, has to clone some loops
from the current function.
How can I obtain the LPPassManager in order to use the CloneLoop function.
In a LoopPass this is a parameter for the runOnLoop, but how can I obtain it in
a FunctionPass?
I tried simply by creating a new instance :
ValueMap<const Value *, Value* > VMap;