Skip to content
Open
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
4 changes: 2 additions & 2 deletions Lib/test/test_peepholer.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@
for func in (f, g):
with self.subTest(func=func.__name__):
self.assertNotInBytecode(func, 'STORE_FAST_LOAD_FAST')
self.assertInBytecode(func, 'LOAD_FAST_BORROW', 'shared')

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='g')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 864 RESUME 0 865 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) 866 JUMP_BACKWARD 5 (to L1) 865 L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE

Check failure on line 871 in Lib/test/test_peepholer.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_store_fast_load_fast_borrow (test.test_peepholer.TestMarkingVariablesAsUnKnown.test_store_fast_load_fast_borrow) (func='f')

AssertionError: (LOAD_FAST_BORROW,'shared') not found in bytecode: 861 RESUME 0 862 LOAD_GLOBAL 1 (range + NULL) LOAD_FAST_BORROW 1 (n) CALL 1 GET_ITER 0 L1: FOR_ITER 3 (to L2) STORE_FAST 2 (i) JUMP_BACKWARD 5 (to L1) L2: END_FOR POP_ITER LOAD_COMMON_CONSTANT 7 (None) RETURN_VALUE
self.assertEqual([i.opname for i in dis.get_instructions(f)],
[i.opname for i in dis.get_instructions(g)])

Expand Down Expand Up @@ -2712,8 +2712,8 @@
]
expected = [
("LOAD_FAST", 0, 1),
("LOAD_FAST_BORROW", 1, 2),
("POP_TOP", None, 3),
("NOP", None, 2),
("NOP", None, 3),
]
self.check(insts, expected)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Now, :opcode:`LOAD_FAST`; :opcode:`POP_TOP`, and :opcode:`LOAD_FAST_BORROW`;
:opcode:`POP_TOP` pairs become :opcode:`NOPs <NOP>`.
18 changes: 13 additions & 5 deletions Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,9 @@ remove_redundant_nops_and_pairs(basicblock *entryblock)
else if (prev_opcode == COPY && prev_oparg == 1) {
is_redundant_pair = true;
}
else if (prev_opcode == LOAD_FAST) {
is_redundant_pair = true;
}
}
if (is_redundant_pair) {
INSTR_SET_OP0(prev_instr, NOP);
Expand Down Expand Up @@ -2669,9 +2672,14 @@ remove_redundant_nops_and_jumps(cfg_builder *g)
Code trasnformations that reduce code size initially fill the gaps with
NOPs. Later those NOPs are removed.
*/

static int
add_checks_for_loads_of_uninitialized_variables(basicblock *entryblock,
int nlocals, int nparams);

static int
optimize_cfg(cfg_builder *g, PyObject *consts, PyObject *const_cache,
_Py_hashtable_t *consts_index, int firstlineno)
_Py_hashtable_t *consts_index, int firstlineno, int nlocals, int nparams)
{
assert(PyDict_CheckExact(const_cache));
RETURN_IF_ERROR(check_cfg(g));
Expand All @@ -2682,6 +2690,9 @@ optimize_cfg(cfg_builder *g, PyObject *consts, PyObject *const_cache,
for (basicblock *b = g->g_entryblock; b != NULL; b = b->b_next) {
RETURN_IF_ERROR(optimize_basic_block(const_cache, b, consts, consts_index));
}
RETURN_IF_ERROR(
add_checks_for_loads_of_uninitialized_variables(
g->g_entryblock, nlocals, nparams));
RETURN_IF_ERROR(remove_redundant_nops_and_pairs(g->g_entryblock));
RETURN_IF_ERROR(remove_unreachable(g->g_entryblock));
RETURN_IF_ERROR(remove_redundant_nops_and_jumps(g));
Expand Down Expand Up @@ -3830,16 +3841,13 @@ _PyCfg_OptimizeCodeUnit(cfg_builder *g, PyObject *consts, PyObject *const_cache,
}
}

int ret = optimize_cfg(g, consts, const_cache, consts_index, firstlineno);
int ret = optimize_cfg(g, consts, const_cache, consts_index, firstlineno, nlocals, nparams);

_Py_hashtable_destroy(consts_index);

RETURN_IF_ERROR(ret);

RETURN_IF_ERROR(remove_unused_consts(g->g_entryblock, consts));
RETURN_IF_ERROR(
add_checks_for_loads_of_uninitialized_variables(
g->g_entryblock, nlocals, nparams));
RETURN_IF_ERROR(push_cold_blocks_to_end(g));
RETURN_IF_ERROR(resolve_line_numbers(g, firstlineno));
// temporarily remove assert. See https://github.com/python/cpython/issues/125845
Expand Down
Loading