vvchernov commented on code in PR #11358:
URL: https://github.com/apache/tvm/pull/11358#discussion_r890031981


##########
src/runtime/vm/vm.cc:
##########
@@ -521,13 +603,25 @@ int64_t VirtualMachine::LoadScalarInt(Index r) const {
   return result;
 }
 
-void VirtualMachine::RunLoop() {
+Index VirtualMachine::GetResultRegisterIndex() const {
+  Index op_ind = 0;
+  Instruction instr;
+  // TODO(vvchernov): can it be endless loop?
+  do {
+    instr = code_[op_ind++];
+  } while (instr.op == Opcode::Ret);
+
+  return instr.result;
+}
+
+void VirtualMachine::RunLoop(bool set_output_enabled) {
   ICHECK(this->exec_);
   ICHECK(this->code_);
   pc_ = 0;
   Index frame_start = frames_.size();
-  while (true) {
-  main_loop:
+  Index res_reg_index = GetResultRegisterIndex();

Review Comment:
   Hello @mbs-octoml! I've updated my code for tuple results. I get register 
indices from AllocADT instruction and further there is the same action as for 
AllocTensor



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