summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorYan Yanchii <yyanchiy@gmail.com>2024-12-23 21:17:47 (GMT)
committerGitHub <noreply@github.com>2024-12-23 21:17:47 (GMT)
commit30efede33ca1fe32debbae93cc40b0e7e0b133b3 (patch)
treefd2cc45d05999f85d3caf638659e9a80589e3da2 /Python
parentd61542b5ff1fe64705e5ce1bcc53048f14098dba (diff)
downloadcpython-30efede33ca1fe32debbae93cc40b0e7e0b133b3.zip
cpython-30efede33ca1fe32debbae93cc40b0e7e0b133b3.tar.gz
cpython-30efede33ca1fe32debbae93cc40b0e7e0b133b3.tar.bz2
gh-128195: Add `_REPLACE_WITH_TRUE` to the tier2 optimizer (GH-128203)
Add `_REPLACE_WITH_TRUE` to the tier2 optimizer
Diffstat (limited to 'Python')
-rw-r--r--Python/optimizer_bytecodes.c4
-rw-r--r--Python/optimizer_cases.c.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c
index e60c0d3..a14d119 100644
--- a/Python/optimizer_bytecodes.c
+++ b/Python/optimizer_bytecodes.c
@@ -899,6 +899,10 @@ dummy_func(void) {
(void)version;
}
+ op(_REPLACE_WITH_TRUE, (value -- res)) {
+ res = sym_new_const(ctx, Py_True);
+ }
+
// END BYTECODES //
}
diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h
index b46079e..0fcf5e1 100644
--- a/Python/optimizer_cases.c.h
+++ b/Python/optimizer_cases.c.h
@@ -211,7 +211,7 @@
case _REPLACE_WITH_TRUE: {
_Py_UopsSymbol *res;
- res = sym_new_not_null(ctx);
+ res = sym_new_const(ctx, Py_True);
stack_pointer[-1] = res;
break;
}