You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/01/18 13:07:00 UTC

[GitHub] [tvm] MasterJH5574 commented on a change in pull request #9958: [Fix] Fix flaky test of #9952

MasterJH5574 commented on a change in pull request #9958:
URL: https://github.com/apache/tvm/pull/9958#discussion_r786740740



##########
File path: src/tir/transforms/ir_utils.cc
##########
@@ -278,7 +280,12 @@ Map<Var, Range> ConditionalBoundsContext::GetVarBoundsFromCondition() {
         }
       });
       if (is_simple && !cand_vars.empty()) {
-        for (const Var& var : cand_vars) var_set.insert(var);
+        for (const Var& var : cand_vars) {
+          if (!var_set.count(var)) {
+            vars.push_back(var);
+            var_set.insert(var);
+          }
+        }

Review comment:
       Personally I recommend using `std::find(vars.begin(), vars.end(), var) != vars.end()` instead of using a `var_set` for looking up, because usually we don't have few variables and the map doesn't bring performance improvement :-)




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org