Problem getting LoopInfo inside non-LoopPass

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Problem getting LoopInfo inside non-LoopPass

Ryan Taylor-5
 
 
 Thanks for the info. Curious, do you know if there is an opt that will put all loops, including nested ones, in functions (ie each loop in it's own function)? What I'm trying to do is create a way for each loop to have only one exit. I want all loops to be single exit loops?
 
  I can write my own pass but I'd rather not. I think that if I can put each loop into it's own function then call merge return that might do it. Ideas?

On Thu, Dec 1, 2011 at 12:32 AM, Pankaj Gode <[hidden email]> wrote:
In addition to the link below, please check for functions like "llvm.debug.declare", "llvm.debug.value", as you will not get LoopInfo for these.
 
Pankaj
 

From: Devang Patel <[hidden email]>
To: Ryan Taylor <[hidden email]>
Cc: [hidden email]
Sent: Wednesday, November 30, 2011 11:08 PM

Subject: Re: [LLVMdev] Problem getting LoopInfo inside non-LoopPass

Ryan,

See http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-November/045423.html

-
Devang

On Nov 29, 2011, at 6:59 PM, Ryan Taylor wrote:

> 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) {
>        for (CallGraphSCC::iterator CGNodeItr = SCC.begin(), CFNodeItrE=SCC.end();CGNodeItr!=CGNodeItrE;++CGNodeItr)  }
>                  const CallGraphNode *CGNode = *CGNodeItr;
>                  Function *F = CGNode->getFunction();
>                  if (!F->isDeclaration())
>                                LoopInfo &LI = getAnalysis<LoopInfo>(*F);
>        }
>        return false;
>    }
>  };
>    char myPass::ID = 0;
>    static RegisterPass<myPass> X("myPass", "This is my pass", false, false);
> }
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]        http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

_______________________________________________
LLVM Developers mailing list
[hidden email]        http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Problem getting LoopInfo inside non-LoopPass

Ryan Taylor-5
So it seems that Polly has what I am looking for but when installing, the polly-test is unable to see libisl.so.8 even though it's installed. I've set all the paths correctly according to their website. I realize they have their own mailing list but figured someone here might know also.

On Wed, Nov 30, 2011 at 10:29 PM, Ryan Taylor <[hidden email]> wrote:
 
 
 Thanks for the info. Curious, do you know if there is an opt that will put all loops, including nested ones, in functions (ie each loop in it's own function)? What I'm trying to do is create a way for each loop to have only one exit. I want all loops to be single exit loops?
 
  I can write my own pass but I'd rather not. I think that if I can put each loop into it's own function then call merge return that might do it. Ideas?

On Thu, Dec 1, 2011 at 12:32 AM, Pankaj Gode <[hidden email]> wrote:
In addition to the link below, please check for functions like "llvm.debug.declare", "llvm.debug.value", as you will not get LoopInfo for these.
 
Pankaj
 

From: Devang Patel <[hidden email]>
To: Ryan Taylor <[hidden email]>
Cc: [hidden email]
Sent: Wednesday, November 30, 2011 11:08 PM

Subject: Re: [LLVMdev] Problem getting LoopInfo inside non-LoopPass

Ryan,

See http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-November/045423.html

-
Devang

On Nov 29, 2011, at 6:59 PM, Ryan Taylor wrote:

> 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) {
>        for (CallGraphSCC::iterator CGNodeItr = SCC.begin(), CFNodeItrE=SCC.end();CGNodeItr!=CGNodeItrE;++CGNodeItr)  }
>                  const CallGraphNode *CGNode = *CGNodeItr;
>                  Function *F = CGNode->getFunction();
>                  if (!F->isDeclaration())
>                                LoopInfo &LI = getAnalysis<LoopInfo>(*F);
>        }
>        return false;
>    }
>  };
>    char myPass::ID = 0;
>    static RegisterPass<myPass> X("myPass", "This is my pass", false, false);
> }
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]        http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

_______________________________________________
LLVM Developers mailing list
[hidden email]        http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
12