junrushao1994 commented on a change in pull request #8943:
URL: https://github.com/apache/tvm/pull/8943#discussion_r704961036



##########
File path: src/tir/schedule/primitive/cache_read_write.cc
##########
@@ -160,6 +160,21 @@ Block MakeCacheStage(const BufferRegion& cache_region, 
CacheStageInfo* info,
   return block;
 }
 
+/*!
+ * \brief Recalculate the `affine_binding` flag of a specifc block
+ * \param block_sref The sref to the specific block
+ */
+bool CalculateAffineFlag(const ScheduleState& self, const StmtSRef& 
block_sref) {

Review comment:
       I don't think so.
   
   Note that the method `CalculateAffineFlag` here does bunch of redundant 
computation, e.g. finding the corresponding BlockRealize given a Block, which 
incurs extra overhead of re-visiting the AST; On the contrary, in compute-at, 
it already memorizes the mapping from Blocks to BlockRealizes, so there is no 
reason to introduce extra overhead.
   
   In summary, I didn't find the method specifically useful when it has 
non-trivial overhead. Instead, `IsAffineBinding` is the one with less burden 
and we should encourage its usage.




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


Reply via email to