I am trying to build TVM with setting USE_LLVM in config.cmake. I have llvm-v10 which I compiled from source for Arm Cortex-M7. I am also interested in using TVM only for Arm Cortex-M7. However, when I try to compile TVM with specifying the LLVM path in config.cmake, it throws this following error:
/home/deb/src/tvm/src/target/llvm/llvm_common.h:42:10: fatal error: llvm/IR/IntrinsicsAMDGPU.h: No such file or directory
The 42th line is: #include <llvm/IR/IntrinsicsAMDGPU.h>
When I compiled LLVM, I disabled all the backends I would not use (due to size) and it does not support AMDGPU. I think the error is because of that. Is there a simple way to specify the backend target when building TVM so that I can bypass AMDGPU, and other backends that my LLVM does not support? I would prefer not to compile LLVM with all the backends enabled, due to the compilation time and size.
I already tried commenting out the line and removing the codegen files (e.g., src/target/llvm/codegen_amdgpu.cc) as mentioned here (Make fails during installation on ARM error: âamdgcn_s_barrierâ is not a member of âllvm::Intrinsicâ), but it just kept throwing errors for different files. I tried removing other files the compiler complains about but I got stuck as it started to complain about it cannot find âllvm::CGFT_AssemblyFileâ. (which is weird because my LLVM source has llvm::TargetMachine::CGFT_AssemblyFile instead. It seems like TVM thinks that the TargetMachine namespace is only for llvm-v9? Is my llvm version messed up?)
I wonder if there is a simple way to disable AMDGPU backend. If not, can someone help me out in figuring out exactly which files I should remove to make it compile correctly?