https://github.com/python/cpython/commit/30efede33ca1fe32debbae93cc40b0e7e0b133b3
commit: 30efede33ca1fe32debbae93cc40b0e7e0b133b3
branch: main
author: Yan Yanchii <[email protected]>
committer: Fidget-Spinner <[email protected]>
date: 2024-12-24T05:17:47+08:00
summary:

gh-128195: Add `_REPLACE_WITH_TRUE` to the tier2 optimizer (GH-128203)

Add `_REPLACE_WITH_TRUE` to the tier2 optimizer

files:
M Python/optimizer_bytecodes.c
M Python/optimizer_cases.c.h

diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c
index e60c0d38425bfe..a14d119b7a1dec 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 b46079ec8a1992..0fcf5e18ed5808 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;
         }

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to