tqchen commented on code in PR #19963:
URL: https://github.com/apache/tvm/pull/19963#discussion_r3531085274


##########
src/arith/int_set.cc:
##########
@@ -443,6 +433,13 @@ class IntervalSetEvaluator : public 
ExprFunctor<IntervalSet(const Expr&)> {
   IntervalSet VisitExpr_(const VarNode* op) final {
     Var var = ffi::GetRef<Var>(op);
 
+    auto it = dom_map_.find(var);
+    // Scoped constraints refine explicit relaxation domains.  Variables that
+    // are absent from dom_map_ remain free parameters of the relaxed result.
+    if (it == dom_map_.end()) {
+      return IntervalSet::SinglePoint(var.as_or_throw<PrimExpr>());

Review Comment:
   Thanks for flagging this. In the current TVM IR hierarchy, `tirx::Var` 
derives from the general `Expr`, not from `PrimExpr`; `tirx::PrimVar` is the 
checked primitive view. `IntervalSet::SinglePoint` requires a `PrimExpr`. I 
compiled the suggested substitution directly, and it fails with `cannot convert 
tvm::tirx::Var to tvm::PrimExpr`; restoring the checked cast rebuilds the 
compiler target successfully. Commit `adf8d6a463` intentionally moved `Var` 
from `PrimExpr` to `Expr` and added this exact cast. The cast is therefore 
required here, so I am leaving the source unchanged.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to