wrongtest-intellif commented on code in PR #14398:
URL: https://github.com/apache/tvm/pull/14398#discussion_r1150034787


##########
src/tir/schedule/primitive/loop_transformation.cc:
##########
@@ -451,6 +451,165 @@ Array<StmtSRef> Split(ScheduleState self, const StmtSRef& 
loop_sref, const Array
   return result_srefs;
 }
 
+class LoopReconstructor : private StmtMutator {
+ public:
+  explicit LoopReconstructor(Block scope_root, std::vector<std::vector<const 
ForNode*>> loops)

Review Comment:
   std::vector<>&



##########
src/tir/schedule/primitive/loop_transformation.cc:
##########
@@ -451,6 +451,165 @@ Array<StmtSRef> Split(ScheduleState self, const StmtSRef& 
loop_sref, const Array
   return result_srefs;
 }
 
+class LoopReconstructor : private StmtMutator {
+ public:
+  explicit LoopReconstructor(Block scope_root, std::vector<std::vector<const 
ForNode*>> loops)
+      : scope_root_(scope_root), loops_(loops) {}
+
+  using StmtMutator::operator();
+
+  /*!
+   * \brief Create the new nest loops induced by the given loops
+   */
+  void MakeNewLoop() {
+    Array<Var> new_loop_vars;
+    Array<PrimExpr> new_loop_extents;
+    Array<Stmt> new_stmts;
+    for (size_t i = 0; i < loops_.size(); i++) {
+      Map<Var, PrimExpr> var_map;
+      for (size_t j = 0; j < loops_[i].size(); j++) {
+        if (i == 0) {
+          std::string suffix = loops_[i][j]->loop_var->name_hint;

Review Comment:
   Here we could use `Var::copy_with_suffix` utility :)



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