Skip to content

Commit

Permalink
Use std::move to avoid warnings on clang-13
Browse files Browse the repository at this point in the history
  • Loading branch information
vinx13 committed Jul 26, 2022
1 parent eada707 commit 581af5e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/te/operation/create_primfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class LayoutFreePlaceholdersNormalizer : public StmtMutator {
}
block.CopyOnWrite()->annotations.erase(topi_attr);
}
return block;
return std::move(block);
}

std::unordered_map<tir::Buffer, int, ObjectPtrHash, ObjectPtrEqual> buffer2index_;
Expand Down
2 changes: 1 addition & 1 deletion src/tir/schedule/primitive/blockize_tensorize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ Stmt Substitute(const Stmt& stmt, const Map<Var, PrimExpr>& sub,
if (!src.same_as(tgt)) {
block_sref_reuse_->Set(src, tgt);
}
return tgt;
return std::move(tgt);
}

const Map<Var, PrimExpr>& sub_;
Expand Down
6 changes: 3 additions & 3 deletions src/tir/schedule/primitive/cache_read_write.cc
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ class ReIndexRewriter : public StmtExprMutator {
n->alloc_buffers.push_back(info_->alloc);
stmt = Block(n);
info_->block_reuse.Set(old_stmt, stmt);
return stmt;
return std::move(stmt);
}

// Visiting the blokc being reindexed
Expand Down Expand Up @@ -917,9 +917,9 @@ class ReIndexRewriter : public StmtExprMutator {
stmt = Block(n);
}
info_->block_reuse.Set(old_stmt, stmt);
return stmt;
return std::move(stmt);
}
return old_stmt;
return std::move(old_stmt);
}

template <typename Node>
Expand Down
2 changes: 1 addition & 1 deletion src/tir/transforms/remove_weight_layout_rewrite_block.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class WeightLayoutRewriteBlockRemover : public StmtMutator {
n->alloc_buffers = std::move(alloc_buffers);
return Stmt(n);
} else {
return block;
return std::move(block);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/tir/usmp/transform/assign_pool_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Stmt PoolInfoAssigner::VisitStmt_(const AllocateNode* op) {
Stmt body = VisitStmt(op->body);
auto allocate =
Allocate(op->buffer_var, op->dtype, op->extents, op->condition, body, annotations);
return allocate;
return std::move(allocate);
}

Stmt PoolInfoAssigner::VisitStmt_(const AllocateConstNode* op) {
Expand All @@ -157,7 +157,7 @@ Stmt PoolInfoAssigner::VisitStmt_(const AllocateConstNode* op) {
Stmt body = VisitStmt(op->body);
auto allocate_const =
AllocateConst(op->buffer_var, op->dtype, op->extents, op->data, body, annotations);
return allocate_const;
return std::move(allocate_const);
}

IRModule PoolInfoAssigner::operator()() {
Expand Down

0 comments on commit 581af5e

Please sign in to comment.