[PATCH] D33299: [Polly][CMake] Use the CMake Package instead of llvm-config in out-of-tree builds

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 07:53:33 PDT 2017


Meinersbur added a comment.

In https://reviews.llvm.org/D33299#762008, @philip.pfaffe wrote:

> In https://reviews.llvm.org/D33299#761863, @Meinersbur wrote:
>
> > My first tryout failed with this error:
>
>
> When importing a package you automatically get <PACK>_DIR variable pointing to the directory where the package Config is located. I.e., setting LLVM_DIR to ${LLVM_BUILD_TREE}/lib/cmake/llvm is what you want to do.
>
> > Next try by setting `CMAKE_PREFIX_PATH`:
>
> This works, too, however setting the LLVM_DIR variable instead usually is cleaner.


Could you document this please?

>> With `-DLLVM_TOOL_POLLY_BUILD=OFF` it compiles, but almost all regression tests fail. For instance:
> 
> I can't reproduce this.  I've seen similar errors before, though, when I broke ABI compatibilty between builds, e.g. by mixing Debug with Release, or mismatched SVN revisions.

Is it possible to add some checks for whether LLVM and Polly are compatible?

In this case it was Release LLVM and Debug Polly. Because with Release-Release, I get the following error (for almost every test):

  #0 0x00000000013e4c6a (opt+0x13e4c6a)
  #1 0x00000000013e29ee (opt+0x13e29ee)
  #2 0x00000000013e2b62 (opt+0x13e2b62)
  #3 0x00007f63c93f1390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
  #4 0x00007f63c7b4c2e1 llvm::TerminatorInst::classof(llvm::Value const*) /root/src/llvm/include/llvm/IR/InstrTypes.h:80:0
  #5 0x00007f63c7b4c2e1 llvm::isa_impl<llvm::TerminatorInst, llvm::User, void>::doit(llvm::User const&) /root/src/llvm/include/llvm/Support/Casting.h:57:0
  #6 0x00007f63c7b4c2e1 llvm::isa_impl_cl<llvm::TerminatorInst, llvm::User const*>::doit(llvm::User const*) /root/src/llvm/include/llvm/Support/Casting.h:105:0
  #7 0x00007f63c7b4c2e1 llvm::isa_impl_wrap<llvm::TerminatorInst, llvm::User const*, llvm::User const*>::doit(llvm::User const* const&) /root/src/llvm/include/llvm/Support/Casting.h:131:0
  #8 0x00007f63c7b4c2e1 llvm::isa_impl_wrap<llvm::TerminatorInst, llvm::User* const, llvm::User const*>::doit(llvm::User* const&) /root/src/llvm/include/llvm/Support/Casting.h:123:0
  #9 0x00007f63c7b4c2e1 bool llvm::isa<llvm::TerminatorInst, llvm::User*>(llvm::User* const&) /root/src/llvm/include/llvm/Support/Casting.h:142:0
  #10 0x00007f63c7b4c2e1 llvm::PredIterator<llvm::BasicBlock, llvm::Value::user_iterator_impl<llvm::User> >::advancePastNonTerminators() /root/src/llvm/include/llvm/IR/CFG.h:47:0
  #11 0x00007f63c7b4c2e1 llvm::PredIterator<llvm::BasicBlock, llvm::Value::user_iterator_impl<llvm::User> >::PredIterator(llvm::BasicBlock*) /root/src/llvm/include/llvm/IR/CFG.h:57:0
  #12 0x00007f63c7b4c2e1 llvm::pred_begin(llvm::BasicBlock*) /root/src/llvm/include/llvm/IR/CFG.h:99:0
  #13 0x00007f63c7b4c2e1 llvm::GraphTraits<llvm::Inverse<llvm::BasicBlock*> >::child_begin(llvm::BasicBlock*) /root/src/llvm/include/llvm/IR/CFG.h:191:0
  #14 0x00007f63c7b4c2e1 llvm::iterator_range<llvm::GraphTraits<llvm::Inverse<llvm::BasicBlock*> >::ChildIteratorType> llvm::children<llvm::Inverse<llvm::BasicBlock*> >(llvm::GraphTraits<llvm::Inverse<llvm::BasicBlock*> >::NodeRef const&) /root/src/llvm/include/llvm/ADT/GraphTraits.h:108:0
  #15 0x00007f63c7b4c2e1 llvm::LoopBase<llvm::BasicBlock, llvm::Loop>::getLoopLatches(llvm::SmallVectorImpl<llvm::BasicBlock*>&) const /root/src/llvm/include/llvm/Analysis/LoopInfo.h:246:0
  #16 0x00007f63c7b4c2e1 polly::ScopDetection::canUseISLTripCount(llvm::Loop*, polly::ScopDetection::DetectionContext&) const /root/src/llvm/tools/polly/lib/Analysis/ScopDetection.cpp:1139:0
  #17 0x00007f63c7b4c796 polly::ScopDetection::isValidLoop(llvm::Loop*, polly::ScopDetection::DetectionContext&) const /root/src/llvm/tools/polly/lib/Analysis/ScopDetection.cpp:1182:0
  #18 0x00007f63c7b4e48d polly::ScopDetection::allBlocksValid(polly::ScopDetection::DetectionContext&) const /root/src/llvm/tools/polly/lib/Analysis/ScopDetection.cpp:1383:0
  #19 0x00007f63c7b4e8e4 polly::ScopDetection::isValidRegion(polly::ScopDetection::DetectionContext&) const /root/src/llvm/tools/polly/lib/Analysis/ScopDetection.cpp:1515:0
  #20 0x00007f63c7b4f526 polly::ScopDetection::findScops(llvm::Region&) /root/src/llvm/tools/polly/lib/Analysis/ScopDetection.cpp:1332:0
  #21 0x00007f63c7b4f578 polly::ScopDetection::findScops(llvm::Region&) /root/src/llvm/tools/polly/lib/Analysis/ScopDetection.cpp:1341:0
  #22 0x00007f63c7b4fa8b polly::ScopDetection::ScopDetection(llvm::Function&, llvm::DominatorTree const&, llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::RegionInfo&, llvm::AAResults&) /root/src/llvm/tools/polly/lib/Analysis/ScopDetection.cpp:295:0
  #23 0x00007f63c7b5030e void std::swap<polly::ScopDetection*>(polly::ScopDetection*&, polly::ScopDetection*&) /usr/include/c++/5/bits/move.h:185:0
  #24 0x00007f63c7b5030e std::unique_ptr<polly::ScopDetection, std::default_delete<polly::ScopDetection> >::reset(polly::ScopDetection*) /usr/include/c++/5/bits/unique_ptr.h:342:0
  #25 0x00007f63c7b5030e polly::ScopDetectionWrapperPass::runOnFunction(llvm::Function&) /root/src/llvm/tools/polly/lib/Analysis/ScopDetection.cpp:1698:0
  #26 0x0000000000ef5b33 (opt+0xef5b33)
  #27 0x0000000000ef5bfc (opt+0xef5bfc)
  #28 0x0000000000ef569d (opt+0xef569d)
  #29 0x000000000066aa8b (opt+0x66aa8b)
  #30 0x00007f63c8110830 __libc_start_main /build/glibc-9tT8Do/glibc-2.23/csu/../csu/libc-start.c:325:0
  #31 0x00000000006a9559 (opt+0x6a9559)

(I switched to debug to get symbols; to get this trace I manually added "-g" to CMAKE_CXX_FLAGS)

The revisions are compatible, the in-LLVM-tree builds work well. It also works with the previous llvm-config based trunk (even mixes of Release/Debug build). Any other idea?


https://reviews.llvm.org/D33299





More information about the llvm-commits mailing list