Skip to content

Commit db9e318

Browse files
committed
update local copy move return to fix compiler warning
1 parent df420b0 commit db9e318

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+214
-178
lines changed

apps/hexagon_launcher/launcher_util.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ std::string load_text_file(const std::string& file_name) {
4747
std::string buffer(file_size + 1, 0);
4848

4949
in_file.read(&buffer[0], file_size);
50-
return std::move(buffer);
50+
return buffer;
5151
}
5252

5353
void* load_binary_file(const std::string& file_name, void* buffer, size_t buffer_size) {

src/arith/canonical_simplify.cc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ PrimExpr CanonicalSimplifier::Impl::VisitExpr_(const AddNode* op) {
752752
} else {
753753
ret.CopyOnWrite()->AddToSelf(ToSplitExpr(b), 1);
754754
}
755-
return std::move(ret);
755+
return ret;
756756
}
757757

758758
PrimExpr CanonicalSimplifier::Impl::VisitExpr_(const SubNode* op) {
@@ -776,7 +776,7 @@ PrimExpr CanonicalSimplifier::Impl::VisitExpr_(const SubNode* op) {
776776
} else {
777777
ret.CopyOnWrite()->AddToSelf(ToSplitExpr(b), -1);
778778
}
779-
return std::move(ret);
779+
return ret;
780780
}
781781

782782
PrimExpr CanonicalSimplifier::Impl::VisitExpr_(const MulNode* op) {
@@ -798,11 +798,12 @@ PrimExpr CanonicalSimplifier::Impl::VisitExpr_(const MulNode* op) {
798798
if (a.as<SumExprNode>()) {
799799
SumExpr ret = Downcast<SumExpr>(std::move(a));
800800
ret.CopyOnWrite()->MulToSelf(bconst->value);
801-
return std::move(ret);
801+
return ret;
802+
802803
} else {
803804
SplitExpr ret = ToSplitExpr(std::move(a));
804805
ret.CopyOnWrite()->MulToSelf(bconst->value);
805-
return std::move(ret);
806+
return ret;
806807
}
807808
}
808809

@@ -969,7 +970,7 @@ PrimExpr CanonicalSimplifier::Impl::VisitExpr_(const DivNode* op) {
969970
// can be divided by cval
970971
if (extra->IsZero()) {
971972
lhs.CopyOnWrite()->DivideBy(cval);
972-
return std::move(lhs);
973+
return lhs;
973974
}
974975
// both lhs and extra are non-negative
975976
if (analyzer_->CanProveGreaterEqual(lhs->Normalize(), 0) &&
@@ -984,7 +985,7 @@ PrimExpr CanonicalSimplifier::Impl::VisitExpr_(const DivNode* op) {
984985
lhs.CopyOnWrite()->AddToSelf(SplitDivConst(ToSplitExpr(temp), cval, kTruncDiv), 1);
985986
}
986987
}
987-
return std::move(lhs);
988+
return lhs;
988989
}
989990
} else {
990991
// if a >= 0 && a < cval, then result == 0
@@ -1031,7 +1032,7 @@ PrimExpr CanonicalSimplifier::Impl::VisitExpr_(const FloorDivNode* op) {
10311032
SeparateDivisibleParts(psum, cval, &lhs, &extra);
10321033
if (extra->IsZero()) {
10331034
lhs.CopyOnWrite()->DivideBy(cval);
1034-
return std::move(lhs);
1035+
return lhs;
10351036
}
10361037
// continue simplification.
10371038
lhs.CopyOnWrite()->DivideBy(cval);
@@ -1045,7 +1046,8 @@ PrimExpr CanonicalSimplifier::Impl::VisitExpr_(const FloorDivNode* op) {
10451046
lhs.CopyOnWrite()->AddToSelf(SplitDivConst(ToSplitExpr(temp), cval, kFloorDiv), 1);
10461047
}
10471048
}
1048-
return std::move(lhs);
1049+
return lhs;
1050+
10491051
} else {
10501052
// if a >= 0 && a < cval, then result == 0
10511053
auto cbound = analyzer_->const_int_bound(Normalize(a));
@@ -1371,14 +1373,14 @@ PrimExpr CanonicalSimplifier::Impl::VisitExpr_(const CastNode* op) {
13711373
SumExpr se = Downcast<SumExpr>(value);
13721374
if (se->CanPushCastToChildren(op->dtype, analyzer_)) {
13731375
se.CopyOnWrite()->PushCastToChildren(op->dtype);
1374-
return std::move(se);
1376+
return se;
13751377
}
13761378
}
13771379
if (value.as<SplitExprNode>()) {
13781380
SplitExpr se = Downcast<SplitExpr>(value);
13791381
if (se->CanPushCastToChildren(op->dtype, analyzer_)) {
13801382
se.CopyOnWrite()->PushCastToChildren(op->dtype);
1381-
return std::move(se);
1383+
return se;
13821384
}
13831385
}
13841386
return Rewriter::VisitExpr_(op);

src/arith/int_set.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ IntSet EvalSet(Range r, const Map<Var, IntSet>& dom_map) {
10011001
// Simplifying first can give tighter bounds if r->min and r->extent share variables
10021002
PrimExpr sum = r->min + r->extent - 1;
10031003
auto res = m.Eval(IntervalSet(r->min, ana.Simplify(sum)));
1004-
return std::move(res);
1004+
return res;
10051005
}
10061006

10071007
IntSet EvalSet(Range r, const std::unordered_map<const VarNode*, IntSet>& dom_map) {

src/arith/iter_affine_map.cc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ PrimExpr IterMapRewriter::VisitExpr_(const VarNode* op) {
15551555
auto var = GetRef<Var>(op);
15561556
auto it = var_map_.find(var);
15571557
if (it != var_map_.end()) return it->second;
1558-
return std::move(var);
1558+
return var;
15591559
}
15601560

15611561
PrimExpr IterMapRewriter::VisitExpr_(const AddNode* op) {
@@ -1588,7 +1588,7 @@ PrimExpr IterMapRewriter::VisitExpr_(const AddNode* op) {
15881588
} else {
15891589
AddToLhs(ret.CopyOnWrite(), ToIterSumExpr(b), 1);
15901590
}
1591-
return std::move(ret);
1591+
return ret;
15921592
}
15931593

15941594
PrimExpr IterMapRewriter::VisitExpr_(const SubNode* op) {
@@ -1623,7 +1623,7 @@ PrimExpr IterMapRewriter::VisitExpr_(const SubNode* op) {
16231623
} else {
16241624
AddToLhs(ret.CopyOnWrite(), ToIterSumExpr(b), -1);
16251625
}
1626-
return std::move(ret);
1626+
return ret;
16271627
}
16281628

16291629
PrimExpr IterMapRewriter::VisitExpr_(const MulNode* op) {
@@ -1660,12 +1660,13 @@ PrimExpr IterMapRewriter::VisitExpr_(const MulNode* op) {
16601660
if (a->IsInstance<IterSumExprNode>()) {
16611661
IterSumExpr ret = Downcast<IterSumExpr>(std::move(a));
16621662
MulToLhs(ret.CopyOnWrite(), b);
1663-
return std::move(ret);
1663+
return ret;
1664+
16641665
} else {
16651666
ICHECK(a->IsInstance<IterSplitExprNode>());
16661667
IterSplitExpr ret = Downcast<IterSplitExpr>(std::move(a));
16671668
ret.CopyOnWrite()->scale *= b;
1668-
return std::move(ret);
1669+
return ret;
16691670
}
16701671
}
16711672

@@ -1854,7 +1855,8 @@ PrimExpr IterMapRewriter::SplitFloorDivConst(IterSplitExpr lhs, PrimExpr base, P
18541855
if (is_one(rhs)) {
18551856
if (is_zero(base)) {
18561857
// floordiv(x, 1) = x
1857-
return std::move(lhs);
1858+
return lhs;
1859+
18581860
} else {
18591861
// floordiv(x+y, 1) = x+y
18601862
return IterSumExpr({lhs}, base);
@@ -1865,7 +1867,8 @@ PrimExpr IterMapRewriter::SplitFloorDivConst(IterSplitExpr lhs, PrimExpr base, P
18651867
if (CanProveDivisible(lhs->scale, rhs) && is_zero(base)) {
18661868
// floordiv(x*c1*c2, c2) = x*c1, c1=scale/rhs
18671869
lhs.CopyOnWrite()->scale = floordiv(lhs->scale, rhs);
1868-
return std::move(lhs);
1870+
return lhs;
1871+
18691872
} else if (CanProveDivisible(lhs->scale, rhs) && CanProveDivisible(base, rhs)) {
18701873
// floordiv(x*c1*c2 + y*c2, c2) = x*c1 + y, c1=scale/rhs
18711874
lhs.CopyOnWrite()->scale = floordiv(lhs->scale, rhs);
@@ -1929,7 +1932,8 @@ PrimExpr IterMapRewriter::SplitFloorDivConst(IterSplitExpr lhs, PrimExpr base, P
19291932

19301933
auto new_base = analyzer_->Simplify(floordiv(base - left_pad, rhs), 6);
19311934
if (is_zero(new_base)) {
1932-
return std::move(new_split);
1935+
return new_split;
1936+
19331937
} else {
19341938
return IterSumExpr({new_split}, new_base);
19351939
}

src/arith/narrow_predicate_expression.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ class ExpressionNarrower : public tir::ExprMutator {
8383
contains_unknown_expr_ = false;
8484
return Bool(CurrentContext() == Context::Minimize);
8585
} else if (a.same_as(t->a) && b.same_as(t->b)) {
86-
return std::move(t);
86+
return t;
87+
8788
} else {
8889
return T(a, b);
8990
}

src/arith/rewrite_simplify.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,7 @@ PrimExpr RewriteSimplifier::Impl::ApplyRewriteRules(EQ ret) {
17201720
// supported path.
17211721
TVM_TRY_REWRITE_IF(x == x, ctrue, SideEffect(x.Eval()) <= CallEffectKind::kReadState);
17221722
}
1723-
return std::move(ret);
1723+
return ret;
17241724
}
17251725

17261726
PrimExpr RewriteSimplifier::Impl::VisitExpr_(const NENode* op) {
@@ -1981,7 +1981,7 @@ PrimExpr RewriteSimplifier::Impl::ApplyRewriteRules(LT ret) {
19811981
return RecursiveRewrite(floordiv(ret->a, common_factor) < floordiv(ret->b, common_factor));
19821982
}
19831983
}
1984-
return std::move(ret);
1984+
return ret;
19851985
}
19861986

19871987
PrimExpr RewriteSimplifier::Impl::VisitExpr_(const NotNode* op) {
@@ -2009,7 +2009,7 @@ PrimExpr RewriteSimplifier::Impl::ApplyRewriteRules(Not ret) {
20092009
TVM_TRY_REWRITE(!(x != y), x == y);
20102010
TVM_TRY_RECURSIVE_REWRITE(!(x || y), (!x) && (!y));
20112011
TVM_TRY_RECURSIVE_REWRITE(!(x && y), (!x) || (!y));
2012-
return std::move(ret);
2012+
return ret;
20132013
}
20142014

20152015
PrimExpr RewriteSimplifier::Impl::VisitExpr_(const AndNode* op) {

src/relax/ir/transform.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class DataflowBlockMutator : public ExprMutator {
283283
ICHECK(global_scope_vars.empty() && symbolic_vars.empty())
284284
<< "Error: DataflowBlock Pass should not delete any GlobalScope/Symbolic Var.";
285285

286-
return std::move(updated_block);
286+
return updated_block;
287287
}
288288

289289
private:

src/relax/op/op.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ Expr NormalizeCallTIR(const BlockBuilder& ctx, Call call) {
528528
call.CopyOnWrite()->args = new_args;
529529
}
530530

531-
return std::move(call);
531+
return call;
532532
}
533533

534534
void ValidateCallTIR(Call call) {
@@ -750,7 +750,7 @@ Expr NormalizeCallTIRInPlace(const BlockBuilder& ctx, Call call) {
750750
}
751751
}
752752

753-
return std::move(call);
753+
return call;
754754
}
755755

756756
TVM_REGISTER_NODE_TYPE(CallTIRInplaceAttrs);

src/relax/transform/convert_layout.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class LayoutConvertMutator : public ExprMutator {
157157
new_args.push_back(arg);
158158
}
159159

160-
return std::move(new_args);
160+
return new_args;
161161
}
162162

163163
void VisitBinding(const Binding& binding) final {

src/relax/transform/fold_constant.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class ConstantFolder : public ExprMutator {
301301
}
302302
}
303303

304-
return std::move(post_call);
304+
return post_call;
305305
}
306306

307307
Expr VisitExpr_(const VarNode* op) final {

0 commit comments

Comments
 (0)