summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compiler_codegen.py
diff options
context:
space:
mode:
authorYan Yanchii <yyanchiy@gmail.com>2025-03-14 21:23:27 (GMT)
committerGitHub <noreply@github.com>2025-03-14 21:23:27 (GMT)
commit55815a6474c59001f0230e44560341b643268e87 (patch)
treee345de8b575f68d0a06a5bca778f0adf80e415f3 /Lib/test/test_compiler_codegen.py
parent26511993e63265ea5928aabe6af96d89e20f0553 (diff)
downloadcpython-55815a6474c59001f0230e44560341b643268e87.zip
cpython-55815a6474c59001f0230e44560341b643268e87.tar.gz
cpython-55815a6474c59001f0230e44560341b643268e87.tar.bz2
gh-130480: Move duplicate `LOAD_SMALL_INT` optimization from codegen to CFG (#130481)
Diffstat (limited to 'Lib/test/test_compiler_codegen.py')
-rw-r--r--Lib/test/test_compiler_codegen.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/test_compiler_codegen.py b/Lib/test/test_compiler_codegen.py
index cf5e2d9..cc9ecc7 100644
--- a/Lib/test/test_compiler_codegen.py
+++ b/Lib/test/test_compiler_codegen.py
@@ -29,10 +29,10 @@ class IsolatedCodeGenTests(CodegenTestCase):
('LOAD_CONST', 0, 1),
('TO_BOOL', 0, 1),
('POP_JUMP_IF_FALSE', false_lbl := self.Label(), 1),
- ('LOAD_SMALL_INT', 42, 1),
+ ('LOAD_CONST', 1, 1), # 42
('JUMP_NO_INTERRUPT', exit_lbl := self.Label()),
false_lbl,
- ('LOAD_SMALL_INT', 24, 1),
+ ('LOAD_CONST', 2, 1), # 24
exit_lbl,
('POP_TOP', None),
('LOAD_CONST', 1),
@@ -82,7 +82,7 @@ class IsolatedCodeGenTests(CodegenTestCase):
# Function body
('RESUME', 0),
('LOAD_FAST', 0),
- ('LOAD_SMALL_INT', 42),
+ ('LOAD_CONST', 42),
('BINARY_OP', 0),
('RETURN_VALUE', None),
('LOAD_CONST', 0),
@@ -125,23 +125,23 @@ class IsolatedCodeGenTests(CodegenTestCase):
[
('RESUME', 0),
('NOP', None),
- ('LOAD_SMALL_INT', 12),
+ ('LOAD_CONST', 12),
('RETURN_VALUE', None),
('LOAD_CONST', 1),
('RETURN_VALUE', None),
],
[
('RESUME', 0),
- ('LOAD_SMALL_INT', 1),
+ ('LOAD_CONST', 1),
('STORE_FAST', 0),
- ('LOAD_SMALL_INT', 2),
+ ('LOAD_CONST', 2),
('STORE_FAST', 1),
- ('LOAD_SMALL_INT', 3),
+ ('LOAD_CONST', 3),
('STORE_FAST', 2),
- ('LOAD_SMALL_INT', 4),
+ ('LOAD_CONST', 4),
('STORE_FAST', 3),
('NOP', None),
- ('LOAD_SMALL_INT', 42),
+ ('LOAD_CONST', 42),
('RETURN_VALUE', None),
('LOAD_CONST', 0),
('RETURN_VALUE', None),