mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
GH-131729: Code-gen better liveness analysis (GH-131732)
* Rename 'defined' attribute to 'in_local' to more accurately reflect how it is used * Make death of variables explicit even for array variables. * Convert in_memory from boolean to stack offset * Don't apply liveness analysis to optimizer generated code * Fix RETURN_VALUE in optimizer
This commit is contained in:
parent
b9ca438daa
commit
1b8bb1ed0c
12 changed files with 344 additions and 399 deletions
|
|
@ -157,6 +157,7 @@ def write_uop(uop: Uop, emitter: Emitter, stack: Stack) -> Stack:
|
|||
emitter.emit(f"{type}{cache.name} = ({cast})CURRENT_OPERAND{idx}();\n")
|
||||
idx += 1
|
||||
storage = emitter.emit_tokens(uop, storage, None)
|
||||
storage.flush(emitter.out)
|
||||
except StackError as ex:
|
||||
raise analysis_error(ex.args[0], uop.body[0]) from None
|
||||
return storage.stack
|
||||
|
|
@ -196,7 +197,6 @@ def generate_tier2(
|
|||
stack = write_uop(uop, emitter, stack)
|
||||
out.start_line()
|
||||
if not uop.properties.always_exits:
|
||||
stack.flush(out)
|
||||
out.emit("break;\n")
|
||||
out.start_line()
|
||||
out.emit("}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue