jwfromm commented on code in PR #12717: URL: https://github.com/apache/tvm/pull/12717#discussion_r966384283
########## src/tir/schedule/primitive/compute_inline.cc: ########## @@ -571,6 +596,34 @@ class ReverseComputeInliner : public BaseInliner { using BaseInliner::VisitExpr_; using BaseInliner::VisitStmt_; + /*! \brief Generate the predicate after inlining based on the consumer predicate */ + PrimExpr BuildInlinedConsumerPredicate(const BlockRealizeNode* producer_block_realize) { + // Bind the producer block iter domains for simplification + Map<Var, PrimExpr> subst_map; + for (int i = 0, n = producer_block_realize->iter_values.size(); i < n; ++i) { + const IterVar& iter = producer_block_realize->block->iter_vars[i]; + analyzer.Bind(iter->var, Range::FromMinExtent(iter->dom->min, iter->dom->extent)); + subst_map.Set(iter->var, producer_block_realize->iter_values[i]); + } + // Substitute the consumer block iters with the corresponding iters in the producer blocks + PrimExpr predicate = Substituter(this)(consumer_predicate_); + // Simplify the predicate using the producer block iter domains + predicate = analyzer.Simplify(predicate); Review Comment: Just for my understanding, how does this bit work? I'm having a hard time seeing how the domain of consumer_predicate is compared to the producer domain through this substitution. -- 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-unsubscr...@tvm.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org