Frank Winter via llvm-dev
2016-Feb-03 15:37 UTC
[llvm-dev] opt with Polly doesn't find the passes
Hi Tobias, I tried to invoke other passes and none of them are available, e.g.: ~/toolchain/install/llvm-3.8/bin/opt -load ~/toolchain/install/llvm-3.8/lib/libPolly.so -polly-cleanup opt: Unknown command line argument '-polly-cleanup'. Try: '/home/fwinter/toolchain/install/llvm-3.8/bin/opt -help' opt: Did you mean '-polly-tiling'? I am just shooting around hoping to get a clue what's going on... On thing.. I recall reading the polly documentation that there was the option to link opt statically with the polly library which I did not select. But that's likely not the problem since a lot of polly options are apparently there. Out of ideas for now. Thanks, Frank fwinter at frank-vaio:~/svn/llvm-3.8/tools/polly$ grep -r INITIALIZE_PASS_BEGIN * lib/CodeGen/CodegenCleanup.cpp:INITIALIZE_PASS_BEGIN(CodegenCleanup, "polly-cleanup", lib/CodeGen/CodeGeneration.cpp:INITIALIZE_PASS_BEGIN(CodeGeneration, "polly-codegen", lib/CodeGen/IslAst.cpp:INITIALIZE_PASS_BEGIN(IslAstInfo, "polly-ast", lib/Transform/CodePreparation.cpp:INITIALIZE_PASS_BEGIN(CodePreparation, "polly-prepare", lib/Transform/Canonicalization.cpp:INITIALIZE_PASS_BEGIN(PollyCanonicalize, "polly-canonicalize", lib/Transform/ScheduleOptimizer.cpp:INITIALIZE_PASS_BEGIN(IslScheduleOptimizer, "polly-opt-isl", lib/Transform/DeadCodeElimination.cpp:INITIALIZE_PASS_BEGIN(DeadCodeElim, "polly-dce", lib/Analysis/DependenceInfo.cpp:INITIALIZE_PASS_BEGIN(DependenceInfo, "polly-dependences", lib/Analysis/ScopDetection.cpp:INITIALIZE_PASS_BEGIN(ScopDetection, "polly-detect", lib/Analysis/ScopInfo.cpp:INITIALIZE_PASS_BEGIN(ScopInfo, "polly-scops", lib/Exchange/JSONExporter.cpp:INITIALIZE_PASS_BEGIN(JSONExporter, "polly-export-jscop", lib/Exchange/JSONExporter.cpp:INITIALIZE_PASS_BEGIN(JSONImporter, "polly-import-jscop", On 02/03/2016 04:46 AM, Tobias Grosser wrote:> On 02/03/2016 02:55 AM, Frank Winter via llvm-dev wrote: >> I just checkout release_38 branches of llvm, clang and polly and built >> it on and x86 Ubuntu with cmake: >> >> CMAKE_BUILD_TYPE="Debug" >> CMAKE_INSTALL_PREFIX="$HOME/toolchain/install/llvm-3.8" >> LLVM_TARGETS_TO_BUILD="X86" >> >> cmake -G "Unix Makefiles" \ >> -DBUILD_SHARED_LIBS="ON" \ >> -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \ >> -DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX \ >> -DLLVM_TARGETS_TO_BUILD=$LLVM_TARGETS_TO_BUILD \ >> $SRC >> >> The build went fine, even 'make check-polly' looks okay: >> >> Scanning dependencies of target check-polly >> [100%] Running polly regression tests >> Testing Time: 37.39s >> Expected Passes : 574 >> Expected Failures : 17 >> [100%] Built target check-polly >> >> Now, I like to follow the matmul example in polly. But whatever polly >> pass I am trying to run opt seem to not find it: >> >> opt -load ~/toolchain/install/llvm-3.8/lib/libPolly.so -S >> -polly-canonicalize matmul.s > matmul.preopt.ll >> >> opt: Unknown command line argument '-polly-canonicalize'. Try: 'opt >> -help' >> opt: Did you mean '-polly-delinearize'? >> >> I am sure that loading the library works, since opt -load >> ~/toolchain/install/llvm-3.8/lib/libPolly.so -help prints out: > > Hi Frank, > > this is interesting and I do not yet understand what is going on here. > Let me shoot some first guesses: > > Which 'opt' are you runnning. Did you run: > > ~/toolchain/install/llvm-3.8/bin/opt -load > ~/toolchain/install/llvm-3.8/lib/libPolly.so > > or rather some > > /usr/local/bin/opt -load ~/toolchain/install/llvm-3.8/lib/libPolly.so > > Also, what does: > > ~/toolchain/install/llvm-3.8/bin/opt -load > ~/toolchain/install/llvm-3.8/lib/libPolly.so -help-hidden | grep > canonicalize give you? > > Best, > Tobias
Tobias Grosser via llvm-dev
2016-Feb-03 15:41 UTC
[llvm-dev] opt with Polly doesn't find the passes
On 02/03/2016 04:37 PM, Frank Winter wrote:> Hi Tobias, > > I tried to invoke other passes and none of them are available, e.g.: > > ~/toolchain/install/llvm-3.8/bin/opt -load > ~/toolchain/install/llvm-3.8/lib/libPolly.so -polly-cleanup > > opt: Unknown command line argument '-polly-cleanup'. Try: > '/home/fwinter/toolchain/install/llvm-3.8/bin/opt -help' > opt: Did you mean '-polly-tiling'?I assume -polly-cleanup still shows in -help-hidden?> > I am just shooting around hoping to get a clue what's going on... > > On thing.. I recall reading the polly documentation that there was the > option to link opt statically with the polly library which I did not > select. But that's likely not the problem since a lot of polly options > are apparently there. > > Out of ideas for now.This is surprising, indeed. The option is: LINK_POLLY_INTO_TOOLS:BOOL=ON. It might be worth giving it a try. What ubuntu version are you on precisely? I can try the 3.8 branch tonight myself. Best, Tobias
Frank Winter via llvm-dev
2016-Feb-03 15:46 UTC
[llvm-dev] opt with Polly doesn't find the passes
On 02/03/2016 10:41 AM, Tobias Grosser wrote:> On 02/03/2016 04:37 PM, Frank Winter wrote: >> Hi Tobias, >> >> I tried to invoke other passes and none of them are available, e.g.: >> >> ~/toolchain/install/llvm-3.8/bin/opt -load >> ~/toolchain/install/llvm-3.8/lib/libPolly.so -polly-cleanup >> >> opt: Unknown command line argument '-polly-cleanup'. Try: >> '/home/fwinter/toolchain/install/llvm-3.8/bin/opt -help' >> opt: Did you mean '-polly-tiling'? > > I assume -polly-cleanup still shows in -help-hidden?No, it doesn't show. It never did. It looks to me that only the clang options show in -help-hidden but not the passes. Can that be right?>> >> I am just shooting around hoping to get a clue what's going on... >> >> On thing.. I recall reading the polly documentation that there was the >> option to link opt statically with the polly library which I did not >> select. But that's likely not the problem since a lot of polly options >> are apparently there. >> >> Out of ideas for now. > > This is surprising, indeed. > > The option is: LINK_POLLY_INTO_TOOLS:BOOL=ON. It might be worth giving > it a try. > > What ubuntu version are you on precisely? I can try the 3.8 branch > tonight myself.Ubuntu 14.04 LTS x86-64.> > Best, > Tobias >
Tobias Grosser via llvm-dev
2016-Feb-03 16:57 UTC
[llvm-dev] opt with Polly doesn't find the passes
On 02/03/2016 04:37 PM, Frank Winter via llvm-dev wrote:> Hi Tobias, > > I tried to invoke other passes and none of them are available, e.g.: > > ~/toolchain/install/llvm-3.8/bin/opt -load > ~/toolchain/install/llvm-3.8/lib/libPolly.so -polly-cleanupIn fact I found the issue. Try to load LLVMPolly.so instead of libPolly.so: ~/toolchain/install/llvm-3.8/bin/opt -load ~/toolchain/install/llvm-3.8/lib/LLVMPolly.so -polly-cleanup This should work with and without BUILD_SHARED_LIBS and should correctly register the passes for you. Best, Tobias
Frank Winter via llvm-dev
2016-Feb-03 17:25 UTC
[llvm-dev] opt with Polly doesn't find the passes
On 02/03/2016 11:57 AM, Tobias Grosser wrote:> On 02/03/2016 04:37 PM, Frank Winter via llvm-dev wrote: >> Hi Tobias, >> >> I tried to invoke other passes and none of them are available, e.g.: >> >> ~/toolchain/install/llvm-3.8/bin/opt -load >> ~/toolchain/install/llvm-3.8/lib/libPolly.so -polly-cleanup > > In fact I found the issue. Try to load LLVMPolly.so instead of libPolly.so: > > ~/toolchain/install/llvm-3.8/bin/opt -load > ~/toolchain/install/llvm-3.8/lib/LLVMPolly.so -polly-cleanup > > This should work with and without BUILD_SHARED_LIBS and should correctly > register the passes for you.Oh. That works. Don't know what brought me to load libPolly. Thanks, Frank> > Best, > Tobias