vvchernov commented on code in PR #11358:
URL: https://github.com/apache/tvm/pull/11358#discussion_r876618145
##########
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:
As we can see from RunLoop design, and my tests with multiple outputs showed
the same, only one ObjectRef (e.g. ADT) is return as result. It means we need
only one index. Nevertheless tests are in progress to check possible issues.
I'm not sure that current implementation is ready to merge.
@tmoreau89 what do you think there are any deadlines for this feature?
--
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]