tqchen commented on a change in pull request #8114:
URL: https://github.com/apache/tvm/pull/8114#discussion_r637927875



##########
File path: src/arith/int_set.cc
##########
@@ -635,6 +636,83 @@ IntSet Union(const Array<IntSet>& sets) {
   return IntervalSet(ana.Simplify(x->min_value), ana.Simplify(x->max_value));
 }
 
+Array<IntSet> UnionRegion(const Array<Array<IntSet>>& nd_int_sets) {
+  if (nd_int_sets.empty()) {
+    return {};
+  }
+  int n = nd_int_sets.size();
+  int ndim = nd_int_sets[0].size();
+  Array<IntSet> result;
+  result.reserve(ndim);
+  for (int i = 0; i < ndim; ++i) {
+    Array<IntSet> candidates;
+    candidates.reserve(n);
+    for (int j = 0; j < n; ++j) {
+      candidates.push_back(nd_int_sets[j][i]);
+    }
+    result.push_back(Union(candidates));
+  }
+  return result;
+}
+
+IntSet UnionLowerBound(const Array<IntSet>& sets) {
+  if (sets.size() == 0) return IntSet::Nothing();
+  if (sets.size() == 1) return sets[0];
+  Analyzer analyzer;
+  bool is_first_interval = true;
+  PrimExpr min_inclusive{nullptr};
+  PrimExpr max_exclusive(nullptr);

Review comment:
       To avoid confusion, it might always easier to compute in max_inclusive 
instead, and the condition instead becomes
   
   ```new_min_inclusive <= max_inclusive + 1```




-- 
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]


Reply via email to