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



##########
File path: src/tir/schedule/analysis.h
##########
@@ -232,6 +261,55 @@ BlockRealize 
CheckGetSingleChildBlockRealizeOnSRefTree(const ScheduleState& self
  */
 BlockRealize GetBlockRealize(const ScheduleState& self, const StmtSRef& 
block_sref);
 
+/******** Producer-consumer relation ********/
+
+/*!
+ * \brief Get the producer blocks to the given block under the given scope
+ * \param block_sref The block whose producers are to be retrieved
+ * \param scope The block scope where the given block is in
+ * \return The producer blocks of the specified block
+ */
+Array<StmtSRef> GetProducers(const StmtSRef& block_sref, const BlockScope& 
scope);
+
+/*!
+ * \brief Get the consumer blocks to the given block under the given scope
+ * \param block_sref The block whose consumers are to be retrieved
+ * \param scope The block scope where the given block is in
+ * \return The consumer blocks of the specified block
+ */
+Array<StmtSRef> GetConsumers(const StmtSRef& block_sref, const BlockScope& 
scope);
+
+/*!
+ * \brief A solution to split a ordered list of subtrees into two parts,
+ * where producers are on the LHS and consumers are on the RHS.
+ * For example, subtree[0, 3) are on the LHS, and subtree[3, 6) are on the RHS.
+ */
+struct ProducerConsumerSplit {

Review comment:
       I intentionally did this because actually cache-read/write can be 
refactored into using this method.




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