[llvm-dev] Polly Dependency Analysis in MyPass

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Mon Jan 29 07:45:40 PST 2018


How do you compile the code? Within the Polly subdirectory using CMake?
How do you run your pass. Using "opt -mypass inputfile.ll"?

Michael

2018-01-28 9:30 GMT-06:00 hameeza ahmed via llvm-dev <llvm-dev at lists.llvm.org>:
> Hello,
>
> I need to analyze dependencies in my llvm ir by using polly. i created a new
> pass called mypass there i added polly dependency analysis pass but when i
> execute this pass in gdb i get no data.
>
> Why is that so?

Are you sure there is a SCoP detected in your input file? "opt mypass
-debug" may give you some information.

> My code is follows;
>
>
>
> namespace {
> struct mypass : public FunctionPass {
> static char ID;
>
> mypass() : FunctionPass(ID) {
> }
>  virtual bool runOnFunction(Function &F)
>         {
> polly::DependenceInfoWrapperPass dp;
>
> auto &SI = *getAnalysis<polly::ScopInfoWrapperPass>().getSI();
>
>   for (auto &It : SI) {
>     assert(It.second && "Invalid SCoP object!");
>     dp.recomputeDependences(It.second.get(), polly::Dependences::AL_Access);
> }
> virtual void getAnalysisUsage(AnalysisUsage &AU) const
>         {
>
>   AU.addRequiredTransitive<polly::ScopInfoWrapperPass>();
>  AU.setPreservesAll();
>         }
> };
> }
> char mypass::ID = 0;
> static RegisterPass<mypass> X("mypass", "mypass World Pass", false, false);
>
> please help. i have been trying a lot.
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


More information about the llvm-dev mailing list