Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,13 @@ def RETURN_VALUE(self, instr: Instruction):
len(self.stack) == 1
), f"Stack must have one element, but get {len(self.stack)} elements."
ret_val = self.stack.pop()
return self.compile_return(ret_val)

def RETURN_CONST(self, instr: Instruction):
ret_const = self._co_consts[instr.arg]
return self.compile_return(ret_const)

def compile_return(self, ret_val):
compile_fn = self._graph.get_compiled_fn(ret_val)
if compile_fn.graph_size() < ENV_MIN_GRAPH_SIZE.get():
self.new_code = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ def RETURN_VALUE(self, instr: Instruction):
self.return_value = self.stack.pop()
return Stop(state="Return")

def RETURN_CONST(self, instr: Instruction):
self.return_value = self._co_consts[instr.arg]
return Stop(state="Return")

def _break_graph_when_if(self, result, instr: Instruction):
"""
Helper method to raise a BreakGraphError when breaking the graph in a jump operation.
Expand Down
7 changes: 0 additions & 7 deletions test/sot/skip_files_py312
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@
./test_guard_user_defined_fn.py
./test_inplace_api.py
./test_min_graph_size.py
./test_output_restoration.py
./test_side_effects.py
./test_simulate_initialize.py
./test_sir_rollback.py
./test_sot_cost_model.py
./test_sot_export.py
./test_sot_resnet.py
./test_sot_resnet50_backward.py
./test_specialization.py
./test_str_format.py
./test_builtin_bool.py