scott-walker-llnl / LLVM-SimPoints

MIT License
5 stars 5 forks source link

Build countBB failed on LLVM 6.0.0 #1

Open furuame opened 6 years ago

furuame commented 6 years ago

Hi, I'm going through a issue when building countBB. I use the LLVM 6.0.0

Could you give me some hints? :) Thx!

In file included from /NOBACKUP/atcpcw06/zhenwei/llvm-pass-simpoints/count_bb/countBB/countBB.cpp:2:0:
/NOBACKUP/atcpcw06/zhenwei/llvm-6.0.0.src/include/llvm/IR/Module.h: In instantiation of 'llvm::Constant* llvm::Module::getOrInsertFunc
tion(llvm::StringRef, llvm::AttributeList, llvm::Type*, ArgsTy ...) [with ArgsTy = {llvm::IntegerType*, llvm::IntegerType*, long int}]
':
/NOBACKUP/atcpcw06/zhenwei/llvm-6.0.0.src/include/llvm/IR/Module.h:353:69:   required from 'llvm::Constant* llvm::Module::getOrInsertF
unction(llvm::StringRef, llvm::Type*, ArgsTy ...) [with ArgsTy = {llvm::IntegerType*, llvm::IntegerType*, long int}]'
/NOBACKUP/atcpcw06/zhenwei/llvm-pass-simpoints/count_bb/countBB/countBB.cpp:52:75:   required from here
/NOBACKUP/atcpcw06/zhenwei/llvm-6.0.0.src/include/llvm/IR/Module.h:344:57: error: invalid conversion from 'long int' to 'llvm::Type*'
[-fpermissive]
     SmallVector<Type*, sizeof...(ArgsTy)> ArgTys{Args...};
                                                         ^
In file included from /NOBACKUP/atcpcw06/zhenwei/llvm-6.0.0.src/include/llvm/ADT/STLExtras.h:21:0,
                 from /NOBACKUP/atcpcw06/zhenwei/llvm-6.0.0.src/include/llvm/ADT/StringRef.h:13,
                 from /NOBACKUP/atcpcw06/zhenwei/llvm-6.0.0.src/include/llvm/Pass.h:32,
                 from /NOBACKUP/atcpcw06/zhenwei/llvm-pass-simpoints/count_bb/countBB/countBB.cpp:1:
/NOBACKUP/atcpcw06/zhenwei/llvm-6.0.0.src/include/llvm/ADT/SmallVector.h:890:3: error:   initializing argument 1 of 'llvm::SmallVector
<T, N>::SmallVector(std::initializer_list<_Tp>) [with T = llvm::Type*; unsigned int N = 3u]' [-fpermissive]
   SmallVector(std::initializer_list<T> IL) : SmallVectorImpl<T>(N) {
   ^
make[2]: *** [countBB/CMakeFiles/countBB.dir/countBB.cpp.o] Error 1
make[1]: *** [countBB/CMakeFiles/countBB.dir/all] Error 2
make: *** [all] Error 2
scott-walker-llnl commented 6 years ago

LLVM-Simpoints works with LLVM-3.x, LLVM-4.x. I tested LLVM-Simpoints on a fresh install of LLVM-3.x for Ubuntu 16 and it works correctly.

Unfortunately, LLVM internals tend to change between major revisions, which is why it will not compile for you. For now I will add this version limitation to the documentation.

Unfortunately I do not have any machines running LLVM-6.x or 7.x because I would need to install them from source, so I do not have a way to test LLVM-Simpoints on these newer versions. If you absolutely must use LLVM-6+ then I will see if I can get a newer version installed so I can create a patch (this could take me a little while). Otherwise I would recommend using a different LLVM version.

furuame commented 6 years ago

Hi, @scott-walker-llnl, thanks for your reply.

May I ask a question not related to this issue? After SimPoint done the clustering, how does it pick the representative of each cluster? After reading the ASPLOS paper and its website, I didn't find any explanation. Do you have any idea?

scott-walker-llnl commented 6 years ago

I have not looked into the clustering algorithm code that SimPoints uses, but since it is based on k-means it is probably looking for a local optimum within each cell to represent the entire cluster. Here are some related articles that should explain it:

https://en.wikipedia.org/wiki/Local_optimum https://en.wikipedia.org/wiki/Voronoi_diagram https://en.wikipedia.org/wiki/K-means_clustering