Skip to content

Commit

Permalink
Fix compilation errors with clang 11 (apache#7783)
Browse files Browse the repository at this point in the history
- Replace llvm::MaybeAlign::MaybeAlign() with llvm::MaybeAlign().
- Use ICHECK instead of assert in hexagon_module.cc.
  • Loading branch information
Krzysztof Parzyszek authored and Trevor Morris committed May 6, 2021
1 parent 922e728 commit 48e5718
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/runtime/hexagon/hexagon_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ void HexagonModuleNode::RemapArgs(const TVMArgs& args, std::vector<TVMValue>& va
case kTVMNDArrayHandle:
case kTVMDLTensorHandle: {
DLTensor* t = static_cast<DLTensor*>(a);
assert(TVMDeviceExtType(t->device.device_type) == kDLHexagon);
ICHECK(TVMDeviceExtType(t->device.device_type) == kDLHexagon);
TVMValue v;
v.v_handle = CreateRemoteTensor(t);
remote_tensors.push_back(v.v_handle);
Expand Down
6 changes: 2 additions & 4 deletions src/target/llvm/codegen_amdgpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ class CodeGenAMDGPU : public CodeGenLLVM {
if (op->args[1]->dtype.is_float()) {
#if TVM_LLVM_VERSION >= 90
#if TVM_LLVM_VERSION >= 130
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::FAdd, v0, v1,
llvm::MaybeAlign::MaybeAlign(),
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::FAdd, v0, v1, llvm::MaybeAlign(),
llvm::AtomicOrdering::Monotonic);
#else
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::FAdd, v0, v1,
Expand All @@ -203,8 +202,7 @@ class CodeGenAMDGPU : public CodeGenLLVM {
#endif
}
#if TVM_LLVM_VERSION >= 130
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::Add, v0, v1,
llvm::MaybeAlign::MaybeAlign(),
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::Add, v0, v1, llvm::MaybeAlign(),
llvm::AtomicOrdering::Monotonic);
#else
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::Add, v0, v1,
Expand Down
6 changes: 2 additions & 4 deletions src/target/llvm/codegen_nvptx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ llvm::Value* CodeGenNVPTX::CreateIntrinsic(const CallNode* op) {
if (op->args[1]->dtype.is_float()) {
#if TVM_LLVM_VERSION >= 90
#if TVM_LLVM_VERSION >= 130
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::FAdd, v0, v1,
llvm::MaybeAlign::MaybeAlign(),
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::FAdd, v0, v1, llvm::MaybeAlign(),
llvm::AtomicOrdering::Monotonic);
#else
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::FAdd, v0, v1,
Expand All @@ -251,8 +250,7 @@ llvm::Value* CodeGenNVPTX::CreateIntrinsic(const CallNode* op) {
#endif
}
#if TVM_LLVM_VERSION >= 130
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::Add, v0, v1,
llvm::MaybeAlign::MaybeAlign(),
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::Add, v0, v1, llvm::MaybeAlign(),
llvm::AtomicOrdering::Monotonic);
#else
return builder_->CreateAtomicRMW(llvm::AtomicRMWInst::Add, v0, v1,
Expand Down

0 comments on commit 48e5718

Please sign in to comment.