Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when compile tvm with latest llvm14git #8682

Merged
merged 4 commits into from
Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/target/llvm/codegen_llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,11 @@ llvm::Value* CodeGenLLVM::CreateIntrinsic(const CallNode* op) {
: llvm::Type::getVoidTy(*ctx_);
llvm::Function* f = GetIntrinsicDecl(id, return_type, arg_type);
ICHECK(f) << "Cannot find intrinsic declaration, possible type mismatch: "
#if TVM_LLVM_VERSION <= 130
<< llvm::Intrinsic::getName(id, {});
#else
<< llvm::Intrinsic::getName(id, return_type, {});
#endif
return builder_->CreateCall(f, arg_value);
} else if (op->op.same_as(builtin::bitwise_and())) {
return builder_->CreateAnd(MakeValue(op->args[0]), MakeValue(op->args[1]));
Expand Down
4 changes: 4 additions & 0 deletions src/target/llvm/llvm_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ class LLVMModuleNode final : public runtime::ModuleNode {
void SaveToFile(const std::string& file_name, const std::string& format) final {
std::string fmt = runtime::GetFileFormat(file_name, format);
std::error_code ecode;
#if TVM_LLVM_VERSION <= 70
llvm::raw_fd_ostream dest(file_name, ecode, llvm::sys::fs::F_None);
#else
llvm::raw_fd_ostream dest(file_name, ecode, llvm::sys::fs::OF_None);
#endif
ICHECK_EQ(ecode.value(), 0) << "Cannot open file: " << file_name << " " << ecode.message();
if (fmt == "o" || fmt == "obj") {
#if TVM_LLVM_VERSION <= 60
Expand Down