]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-130704: Strength reduce `LOAD_FAST{_LOAD_FAST}` (#130708)
authormpage <mpage@meta.com>
Tue, 1 Apr 2025 17:18:42 +0000 (10:18 -0700)
committerGitHub <noreply@github.com>
Tue, 1 Apr 2025 17:18:42 +0000 (10:18 -0700)
commit053c285f6b41f92fbdd1d4ff0c959cceefacd7cd
treec30af215989dca6fdd8f8ebb74396f29abdca308
parente9556e100452ed5a92fcf0e333ab75b0da29cf5b
gh-130704: Strength reduce `LOAD_FAST{_LOAD_FAST}` (#130708)

Optimize `LOAD_FAST` opcodes into faster versions that load borrowed references onto the operand stack when we can prove that the lifetime of the local outlives the lifetime of the temporary that is loaded onto the stack.
35 files changed:
Doc/library/dis.rst
Include/internal/pycore_frame.h
Include/internal/pycore_opcode_metadata.h
Include/internal/pycore_stackref.h
Include/internal/pycore_uop_ids.h
Include/internal/pycore_uop_metadata.h
Include/opcode_ids.h
Lib/_opcode_metadata.py
Lib/dis.py
Lib/test/test_capi/test_opt.py
Lib/test/test_ctypes/test_memfunctions.py
Lib/test/test_ctypes/test_refcounts.py
Lib/test/test_ctypes/test_stringptr.py
Lib/test/test_dis.py
Lib/test/test_frame.py
Lib/test/test_generators.py
Lib/test/test_importlib/test_abc.py
Lib/test/test_peepholer.py
Lib/test/test_sys.py
Lib/test/test_traceback.py
Misc/NEWS.d/next/Core_and_Builtins/2025-02-28-11-29-35.gh-issue-130704.7RDVLE.rst [new file with mode: 0644]
Objects/floatobject.c
Objects/frameobject.c
Programs/test_frozenmain.h
Python/bytecodes.c
Python/executor_cases.c.h
Python/flowgraph.c
Python/gc.c
Python/generated_cases.c.h
Python/opcode_targets.h
Python/optimizer_analysis.c
Python/optimizer_bytecodes.c
Python/optimizer_cases.c.h
Tools/cases_generator/analyzer.py
Tools/cases_generator/opcode_metadata_generator.py