diff --git a/src/codegen/llvm/codegen_amdgpu.cc b/src/codegen/llvm/codegen_amdgpu.cc index 97858079..de18b2d6 100644 --- a/src/codegen/llvm/codegen_amdgpu.cc +++ b/src/codegen/llvm/codegen_amdgpu.cc @@ -200,8 +200,13 @@ runtime::Module BuildAMDGPU(Array funcs, std::string target) { dest_ll.SetUnbuffered(); destAsm.SetUnbuffered(); module->print(dest_ll, nullptr); +#if TVM_LLVM_VERSION <= 60 std::unique_ptr mAsm = llvm::CloneModule(module.get()); std::unique_ptr mObj = llvm::CloneModule(module.get()); +#else + std::unique_ptr mAsm = llvm::CloneModule(*module.get()); + std::unique_ptr mObj = llvm::CloneModule(*module.get()); +#endif llvm::legacy::PassManager pass; CHECK(tm->addPassesToEmitFile(