[PATCH] D61446: Generalize the pass registration mechanism used by Polly to any third-party tool

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 16:25:13 PDT 2019


Meinersbur added a comment.

This didn't work for me, neither on Windows nor on Linux.

Linux error:

  [138/138] Linking CXX executable bin/opt
  /usr/bin/ld: cannot find -lpolly
  collect2: error: ld returned 1 exit status

Windows error:

  [1654/1715] Linking CXX executable bin\opt.exe
  LINK : fatal error LNK1181: cannot open input file 'polly.lib'

This might indicate that "Polly" is not a recognized target during `target_link_libraries`. If it did, it would add `lib/libPolly.a` instead of `-lPolly` to the linker command line. My Polly is in ${LLVM_ROOT}/tools/Polly. I can see it has been picked up since `ninja Polly` works and "-- Registering polly as a compiler extension" is printed as well. My Linux cmake-line is:

  cmake "${SRCPATH}" \
    -GNinja \
    -DCMAKE_C_COMPILER=/soft/compilers/gcc/8.2.0/linux-rhel7-x86_64/bin/gcc \
    -DCMAKE_CXX_COMPILER=/soft/compilers/gcc/8.2.0/linux-rhel7-x86_64/bin/g++ \
    -DCMAKE_INSTALL_PREFIX="${INSTALLPATH}" \
    -DCLANG_ENABLE_STATIC_ANALYZER=OFF \
    -DLLVM_PARALLEL_LINK_JOBS=2 \
    -DCLANG_ENABLE_ARCMT=OFF \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
    '-DLLVM_TARGETS_TO_BUILD=X86;NVPTX' \
    -DLLVM_ENABLE_ASSERTIONS=ON \
    -DCMAKE_BUILD_TYPE=Release \
    -DPOLLY_ENABLE_GPGPU_CODEGEN=ON \
    -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \
    -DCUDA_TOOLKIT_ROOT_DIR=/soft/compilers/cuda/cuda-10.0.130/

My Extension.def contains:

  //extension handlers
  HANDLE_EXTENSION(polly, Polly)
  #undef HANDLE_EXTENSION


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61446/new/

https://reviews.llvm.org/D61446





More information about the llvm-commits mailing list