junrushao1994 commented on a change in pull request #9041:
URL: https://github.com/apache/tvm/pull/9041#discussion_r713522208
##########
File path: src/tir/schedule/primitive/loop_transformation.cc
##########
@@ -482,7 +482,7 @@ StmtSRef Fuse(ScheduleState self, const Array<StmtSRef>&
loop_srefs) {
Array<PrimExpr> substitute_value;
substitute_value.resize(loops.size());
PrimExpr tot = fused_var;
- for (int i = static_cast<int>(loops.size()) - 1; i >= 0; i--) {
+ for (int i = loops.size() - 1; i >= 0; i--) {
Review comment:
No we should keep with `static_cast` instead. As a principle, `size_t`
is all evil and should be avoided unless we have good reasons. In our
particular case, if `loops.size()` is 0, underflow of `size_t` it may cause
tremendous trouble. Even if by reading around we might have the assumption that
`loops.size() > 0`, it is still not as convenient as just casting to signed
integers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]