Skip to content

Commit

Permalink
remove clang compile warnings (apache#9942)
Browse files Browse the repository at this point in the history
  • Loading branch information
wrongtest-intellif authored and crazydemo committed Jan 27, 2022
1 parent ee1d946 commit 469b25b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/relay/ir/indexed_graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ IndexedGraph<Expr> CreateIndexedGraph(const Expr& expr) {
}

protected:
using MixedModeVisitor::VisitExpr_;

void VisitLeaf(const Expr& expr) override {
MixedModeVisitor::VisitLeaf(expr);
auto node = std::make_shared<IndexedGraph<Expr>::Node>(expr, index_++);
Expand Down
16 changes: 8 additions & 8 deletions src/tir/analysis/device_constraint_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class ApplyDeviceConstraintsMutator : public StmtExprMutator {
if (!new_buffer_var.same_as(new_load->buffer_var)) {
return Load(load_node->dtype, new_buffer_var, load_node->index, load_node->predicate);
}
return new_load;
return std::move(new_load);
}

PrimExpr VisitExpr_(const BufferLoadNode* buffer_load_node) final {
Expand All @@ -265,7 +265,7 @@ class ApplyDeviceConstraintsMutator : public StmtExprMutator {
if (!new_buffer.same_as(new_buffer_load->buffer)) {
return BufferLoad(new_buffer, new_buffer_load->indices, new_buffer_load->span);
}
return new_buffer_load;
return std::move(new_buffer_load);
}

Stmt VisitStmt_(const LetStmtNode* let_stmt_node) final {
Expand All @@ -284,7 +284,7 @@ class ApplyDeviceConstraintsMutator : public StmtExprMutator {
new_attr_stmt->body);
}
}
return new_attr_stmt;
return std::move(new_attr_stmt);
}

// ForNode default ok since loop_var never of PointerType
Expand All @@ -302,7 +302,7 @@ class ApplyDeviceConstraintsMutator : public StmtExprMutator {
if (!new_buffer_var.same_as(new_store->buffer_var)) {
Store(new_buffer_var, new_store->value, new_store->index, new_store->predicate);
}
return new_store;
return std::move(new_store);
}

Stmt VisitStmt_(const BufferStoreNode* buffer_store_node) final {
Expand All @@ -313,7 +313,7 @@ class ApplyDeviceConstraintsMutator : public StmtExprMutator {
return BufferStore(new_buffer, new_buffer_store->value, new_buffer_store->indices,
new_buffer_store->span);
}
return new_buffer_store;
return std::move(new_buffer_store);
}

Stmt VisitStmt_(const BufferRealizeNode* buffer_realize_node) final {
Expand All @@ -324,7 +324,7 @@ class ApplyDeviceConstraintsMutator : public StmtExprMutator {
return BufferRealize(new_buffer, new_buffer_realize->bounds, new_buffer_realize->condition,
new_buffer_realize->body, new_buffer_realize->span);
}
return new_buffer_realize;
return std::move(new_buffer_realize);
}

// IfThenElseNode default ok
Expand All @@ -338,7 +338,7 @@ class ApplyDeviceConstraintsMutator : public StmtExprMutator {
if (!new_buffer.same_as(new_prefetch->buffer)) {
return Prefetch(new_buffer, prefetch_node->bounds, prefetch_node->span);
}
return new_prefetch;
return std::move(new_prefetch);
}

// SeqStmtNode default ok
Expand Down Expand Up @@ -390,7 +390,7 @@ class ApplyDeviceConstraintsMutator : public StmtExprMutator {
new_block->name_hint, new_block->body, new_block->init, new_block->alloc_buffers,
std::move(new_match_buffers), new_block->annotations, new_block->span);
}
return new_block;
return std::move(new_block);
}

// BlockRealizeNode default ok
Expand Down
6 changes: 3 additions & 3 deletions src/tir/schedule/primitive/block_annotate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class StorageScopeMutator : StmtExprMutator {
ptr->buffer = it->second;
return PrimExpr(ptr);
} else {
return res;
return std::move(res);
}
}

Expand All @@ -291,7 +291,7 @@ class StorageScopeMutator : StmtExprMutator {
ptr->buffer = it->second;
return Stmt(ptr);
} else {
return res;
return std::move(res);
}
}

Expand Down Expand Up @@ -348,7 +348,7 @@ class StorageScopeMutator : StmtExprMutator {

Block new_block(n);
block_sref_reuse_->Set(GetRef<Block>(block), new_block);
return new_block;
return std::move(new_block);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/tir/transforms/unify_thread_binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ThreadBindingUnifier : public StmtExprMutator {
}
For new_loop = Downcast<For>(stmt);
new_loop.CopyOnWrite()->annotations = std::move(annotations);
return new_loop;
return std::move(new_loop);
}

template <typename Node>
Expand Down

0 comments on commit 469b25b

Please sign in to comment.