cdl-saarland / rv

RV: A Unified Region Vectorizer for LLVM
Other
105 stars 15 forks source link

Check for compiler-rt sources when RV_ENABLE_CRT=on #39

Closed simoll closed 5 years ago

simoll commented 5 years ago

RV's cmake files should verify that compiler-rt source files are present in llvm/projects/compiler-rt when the cmake build is configured with the option -DRV_ENABLE_CRT=on.

Otw, the build will crash in an attempt to compile non-existent source files of compiler-rt into BC.

mppf commented 5 years ago

@simoll - the case in which I ran into the error was using the LLVM mono-repo. Could you try that configuration? Maybe RV needs to be updated to understand the monorepo paths? Because with the monorepo, compiler-rt is not in llvm-project/llvm/projects but rather in llvm-project/compiler/rt.

Or maybe I just need to be passing -DLLVM_ENABLE_PROJECTS=clang to the LLVM cmake?

simoll commented 5 years ago

Could you check whether 23d013c fixes the issues for LLVM monorepo? RV will look for compiler-rt sources at these locations:

  1. llvm/runtimes/compiler-rt
  2. llvm/projects/compiler-rt
  3. llvm/../compiler-rt <-- the mono repo case
mppf commented 5 years ago

I'm still getting errors, but they are different:

In file included from /home/mppf/w/llvm2/third-party/llvm/llvm-project/llvm/tools/rv/src/analysis/AllocaSSA.cpp:1:
/home/mppf/w/llvm2/third-party/llvm/llvm-project/llvm/tools/rv/include/rv/analysis/AllocaSSA.h:183:54: error: ‘getProvenance’ function uses ‘auto’ type specifier without trailing return type
   const auto & getProvenance(const llvm::Value& val) const {
                                                      ^~~~~
/home/mppf/w/llvm2/third-party/llvm/llvm-project/llvm/tools/rv/include/rv/analysis/AllocaSSA.h:183:54: note: deduced return type only available with -std=c++14 or -std=gnu++14
[ 96%] Building CXX object tools/rv/src/CMakeFiles/RV.dir/analysis/predicateAnalysis.cpp.o
In file included from /home/mppf/w/llvm2/third-party/llvm/llvm-project/llvm/tools/rv/include/rv/analysis/VectorizationAnalysis.h:14,
                 from /home/mppf/w/llvm2/third-party/llvm/llvm-project/llvm/tools/rv/src/analysis/VectorizationAnalysis.cpp:11:
/home/mppf/w/llvm2/third-party/llvm/llvm-project/llvm/tools/rv/include/rv/analysis/AllocaSSA.h:183:54: error: ‘getProvenance’ function uses ‘auto’ type specifier without trailing return type
   const auto & getProvenance(const llvm::Value& val) const {
                                                      ^~~~~
/home/mppf/w/llvm2/third-party/llvm/llvm-project/llvm/tools/rv/include/rv/analysis/AllocaSSA.h:183:54: note: deduced return type only available with -std=c++14 or -std=gnu++14
make[7]: *** [tools/rv/src/CMakeFiles/RV.dir/build.make:258: tools/rv/src/CMakeFiles/RV.dir/analysis/AllocaSSA.cpp.o] Error 1
make[7]: *** Waiting for unfinished jobs....
In file included from /home/mppf/w/llvm2/third-party/llvm/llvm-project/llvm/tools/rv/include/rv/analysis/VectorizationAnalysis.h:14,
                 from /home/mppf/w/llvm2/third-party/llvm/llvm-project/llvm/tools/rv/src/rv.cpp:22:
/home/mppf/w/llvm2/third-party/llvm/llvm-project/llvm/tools/rv/include/rv/analysis/AllocaSSA.h:183:54: error: ‘getProvenance’ function uses ‘auto’ type specifier without trailing return type
   const auto & getProvenance(const llvm::Value& val) const {
                                                      ^~~~~
/home/mppf/w/llvm2/third-party/llvm/llvm-project/llvm/tools/rv/include/rv/analysis/AllocaSSA.h:183:54: note: deduced return type only available with -std=c++14 or -std=gnu++14
simoll commented 5 years ago

RV requires C++ 14. Try building with -DLLVM_CXX_STD:STRING=c++14.

simoll commented 5 years ago

db86b1431b2 aborts cmake with a helpful message when trying to compile RV with c++11.

mppf commented 5 years ago

@simoll - thanks, that resolved the build issues for me.