FrozenGene commented on a change in pull request #6042:
URL: https://github.com/apache/incubator-tvm/pull/6042#discussion_r453483351
##########
File path: src/tir/transforms/unroll_loop.cc
##########
@@ -165,6 +170,12 @@ class LoopUnroller : public StmtExprMutator {
// For loop must have a constant integer extent
CHECK_NE(value, -1) << "loop doesn't have a constant integer extent";
if (value == 0) return Evaluate(0);
+ if (explicit_unroll_max_extent_ > 0 && value > explicit_unroll_max_extent_
&&
+ explicit_unroll_) {
Review comment:
Suggest moving `explicit_unroll_` to the first condition. If it is
`false`, we will trigger short circuit evaluation and will not evaluate other
conditions.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]