ANSHUMAN87 commented on a change in pull request #6238:
URL: https://github.com/apache/incubator-tvm/pull/6238#discussion_r476254492
##########
File path: src/tir/transforms/hoist_if_then_else.cc
##########
@@ -147,26 +197,23 @@ class HoistCandidateSelector final : public
StmtExprVisitor {
if (CheckValidIf()) {
// Check corresponding for loop
- bool match_found = false;
- size_t match_for_loop_pos = 0;
+ int match_for_loop_pos = -1;
for (auto var : if_var_list_) {
- for (size_t i = 0; i < ordered_for_list_.size() - 1; ++i) {
- if (ordered_for_list_[i] == var_for_map_[var]) {
+ for (int i = 0; i < static_cast<int>(ordered_list_.size()); ++i) {
Review comment:
Thanks for the suggestion! I totally agree with you. However as it is
not a bottleneck as you mentioned. Let us keep it.
----------------------------------------------------------------
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]