tvm
tvm copied to clipboard
Several issues were generated in building the source code with LLVM 18
A few issues were found in building TVM 0.13.0 by using LLVM 18 in Ubuntu22.04, and the way presented in cmake/config.cmake file was tried to build the source code.
llvm::CGFT_ObjectFile and llvm::CGFT_AssemblyFile in several files (codegen_amdgpu.cc codegen_hexagon.cc, codegen_nvptx.cc) should be replaed with llvm::CodeGenFileType::ObjectFile and llvm::CodeGenFileType::AssemblyFile.
BTW, in the file llvm_instance.cc, changes should be made as well in some code snippets which used llvm::CodeGenOpt::Level::None and similar statements. llvm::CodeGenOptLevel::None should be used instead in building the source code of TVM by LLVM 18.0.
FYI.
Thanks for reporting this. Could you please send a PR to fix it?
These changes were done a while back to support LLVM 18 in #15921. I think the #ifdef macro guards should have ensured that we use the correct type if the LLVM version was >= 18.0.
For example in llvm_instance.cc, this condition should become false and it should use the right check.
I'm using LLVM 18 and I'm not seeing the build errors, so could you please check whether the TVM_LLVM_VERSION macro is set correctly?