comaniac commented on a change in pull request #9743: URL: https://github.com/apache/tvm/pull/9743#discussion_r769076960
########## File path: src/tir/schedule/primitive/compute_inline.cc ########## @@ -550,17 +567,32 @@ void ComputeInline(ScheduleState self, const StmtSRef& producer_block_sref) { throw OpaqueAccessError(self->mod, scope_root_sref); } // Step 6. Do the real mutation on the AST and the sref tree in the schedule state - self->Replace(scope_root_sref, tgt_stmt, inliner.block_reuse); + return [=]() -> void { self->Replace(scope_root_sref, tgt_stmt, inliner.block_reuse); }; Review comment: ditto ########## File path: src/tir/schedule/primitive/compute_at.cc ########## @@ -501,29 +503,59 @@ void ComputeAtOrReverseComputeAtImpl(ScheduleState self, const StmtSRef& block_s CalculateBlockVarDomain(/*iter_vars=*/block->iter_vars, /*provided_regions=*/std::move(provided_regions), /*required_regions=*/std::move(required_regions), - /*analyzer=*/&analyzer); + /*analyzer=*/analyzer); // Step 6. Create the new scope according to the iteration domain reconstructor.MakeNewLoop(/*insert_position=*/insert_position, /*iter_doms=*/std::move(iter_doms), /*preserve_unit_loops=*/preserve_unit_loops); Block new_scope_root = Downcast<Block>(reconstructor(scope_root)); - // Step 7. Do the actual replacement - self->Replace(scope_root_sref, new_scope_root, {{scope_root, new_scope_root}}); - // Step 8. Update the cached flags - BlockInfo& block_info = self->block_info[block_sref]; - block_info.affine_binding = IsAffineBinding( - /*realize=*/reconstructor.new_block_realize_, - /*loop_var_ranges=*/LoopDomainOfSRefTreePath(GetRef<StmtSRef>(block_sref->parent)), - /*analyzer=*/&analyzer); + return [=]() -> void { Review comment: This style is interesting but I'm not sure if it's intuitive. Would that be better to just have an optional argument like `check_only=false`? ########## File path: src/tir/schedule/primitive/compute_inline.cc ########## @@ -579,7 +611,20 @@ void ReverseComputeInline(ScheduleState self, const StmtSRef& consumer_block_sre throw OpaqueAccessError(self->mod, scope_root_sref); } // Step 7. Do the real mutation on the AST and the sref tree in the schedule state - self->Replace(scope_root_sref, tgt_stmt, inliner.block_reuse); + return [=]() -> void { self->Replace(scope_root_sref, tgt_stmt, inliner.block_reuse); }; Review comment: ditto -- 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