@@ -365,13 +365,13 @@ class StorageAllocatorBaseVisitor : public ExprVisitor {
365365};
366366
367367/* !
368- * \brief Set the upper bound of the TIR variables that appear in
368+ * \brief Set the range constraints of the TIR variables that appear in
369369 * the input function signature in the analyzer.
370370 * \param func The function to be analyzed.
371371 * \param ana The analyzer which contains the TIR var upper bounds.
372372 * \param dom_map The domain map of the TIR variables.
373373 */
374- void SetTIRVarUpperBound (Function func, arith::Analyzer* ana,
374+ void SetTIRVarRangeConstraints (Function func, arith::Analyzer* ana,
375375 ffi::Map<tir::Var, arith::IntSet>* dom_map) {
376376 // Use the attribute-annotated TIR var bounds as the TIR var values for
377377 // memory planning.
@@ -406,8 +406,8 @@ void SetTIRVarUpperBound(Function func, arith::Analyzer* ana,
406406
407407 if (it_upper != var_upper_bound_attr.end () || it_lower != var_lower_bound_attr.end ()) {
408408 int64_t lower = (it_lower != var_lower_bound_attr.end ()) ? it_lower->second ->value : 0 ;
409- int64_t upper = (it_upper != var_upper_bound_attr.end ()) ? it_upper-> second -> value
410- : std::numeric_limits<int64_t >::max ();
409+ int64_t upper = (it_upper != var_upper_bound_attr.end ())
410+ ? it_upper-> second -> value : std::numeric_limits<int64_t >::max ();
411411 tvm::Range range =
412412 tvm::Range::FromMinExtent (tvm::IntImm (DataType::Int (64 ), lower),
413413 tvm::IntImm (DataType::Int (64 ), upper - lower + 1 ));
@@ -497,8 +497,8 @@ class StorageAllocatorInit : public StorageAllocatorBaseVisitor {
497497 : ctx_mod_(ctx_mod), analyzer_(analyzer) {}
498498
499499 void VisitExpr_ (const FunctionNode* func) final {
500- // Set the upper bound of TIR variables in the analyzer.
501- SetTIRVarUpperBound (ffi::GetRef<Function>(func), analyzer_, &dom_map_);
500+ // Set the range constraints of TIR variables in the analyzer.
501+ SetTIRVarRangeConstraints (ffi::GetRef<Function>(func), analyzer_, &dom_map_);
502502 // Recurse into the function to get its tokens.
503503 Tokens body_tokens = GetTokens (func->body );
504504 // Discard the tokens used by the function return value, as they are external referenced.
@@ -855,7 +855,7 @@ class StorageAllocationRewriter : public ExprMutator {
855855 plan_dynamic_output_ = static_cast <bool >(
856856 func_->GetAttr <IntImm>(plan_dyn_attr_).value_or (IntImm (DataType::Int (32 ), 0 ))->value );
857857 if (plan_dynamic_output_) {
858- SetTIRVarUpperBound (ffi::GetRef<Function>(func_), &ana_, &dom_map_);
858+ SetTIRVarRangeConstraints (ffi::GetRef<Function>(func_), &ana_, &dom_map_);
859859 }
860860 token2storage_var_.clear ();
861861 Function func = Downcast<Function>(this ->VisitExpr_ (func_));
0 commit comments