mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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:
parent
bb5c6875d6
commit
0664c1af9b
6 changed files with 138 additions and 31 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue