comaniac commented on a change in pull request #8170:
URL: https://github.com/apache/tvm/pull/8170#discussion_r643427302
##########
File path: src/tir/schedule/analysis.h
##########
@@ -41,8 +41,51 @@ void VerifySRefTree(const ScheduleState& self);
*/
void VerifyCachedFlags(const ScheduleState& self);
-/******** Binding ********/
+/******** Scope ********/
+/*!
+ * \brief Get the sref to the scope root block, exclusive
+ * \param sref The block or loop sref to be retrieved
+ * \return The sref to the scope root block. NullOpt if `sref` is the root
block of the IR
+ */
+Optional<StmtSRef> GetScopeRoot(const StmtSRef& sref);
+
+/*!
+ * \brief Checks if scope the specified sref is in is a stage-pipeline and
return it
Review comment:
Actually both are fine to me as long as it is consistent. For example,
the above `GetScopeRoot` has "Get the sref...". It should be "Gets the sref"
then.
##########
File path: src/tir/schedule/utils.h
##########
@@ -114,6 +116,33 @@ inline bool CanRelaxStorageUndereThread(const
runtime::StorageScope& storage_sco
return static_cast<int>(storage_scope.rank) <=
static_cast<int>(thread_scope.rank);
}
+/******** SeqStmt ********/
+
+/*!
+ * \brief Remove a specific Stmt from a SeqStmt. If a SeqStmt contains a
BlockRealize,
+ * whose block is the Stmt to be removed, then remove that BlockRealize too.
+ * \param seq The SeqStmt to be removed from
+ * \param to_remove The Stmt to be removed
+ * \return The removal result
+ */
+inline Stmt SeqStmtRemove(const SeqStmt& seq, const Stmt& to_remove) {
Review comment:
Sounds good.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]