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:
Mark Shannon 2025-03-26 15:21:35 +00:00 committed by GitHub
parent b9ca438daa
commit 1b8bb1ed0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 344 additions and 399 deletions

View file

@ -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("}")