gh-126835: Move constant subscript folding to CFG (#129568)

Move folding of constant subscription from AST optimizer to CFG.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
Yan Yanchii 2025-02-04 09:10:55 +01:00 committed by GitHub
parent bb5c6875d6
commit 0664c1af9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 138 additions and 31 deletions

View file

@ -65,6 +65,8 @@ PyAPI_FUNC(void) _PyLong_ExactDealloc(PyObject *self);
# error "_PY_NSMALLPOSINTS must be greater than or equal to 257"
#endif
#define _PY_IS_SMALL_INT(val) ((val) >= 0 && (val) < 256 && (val) < _PY_NSMALLPOSINTS)
// Return a reference to the immortal zero singleton.
// The function cannot return NULL.
static inline PyObject* _PyLong_GetZero(void)