diff options
author | Mark Shannon <mark@hotpy.org> | 2024-01-24 12:08:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 12:08:31 (GMT) |
commit | 384429d1c0cf011dcf88d4043e0328de8b063c24 (patch) | |
tree | d3b325f08d9359bce60065b162ddec3572b08662 /Include/internal | |
parent | 1e4f00ebd8db44a031b61eed0803b4c3d731aed7 (diff) | |
download | cpython-384429d1c0cf011dcf88d4043e0328de8b063c24.zip cpython-384429d1c0cf011dcf88d4043e0328de8b063c24.tar.gz cpython-384429d1c0cf011dcf88d4043e0328de8b063c24.tar.bz2 |
GH-113710: Add a tier 2 peephole optimization pass. (GH-114487)
* Convert _LOAD_CONST to inline versions
* Remove PEP 523 checks
Diffstat (limited to 'Include/internal')
-rw-r--r-- | Include/internal/pycore_uop_ids.h | 7 | ||||
-rw-r--r-- | Include/internal/pycore_uop_metadata.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Include/internal/pycore_uop_ids.h b/Include/internal/pycore_uop_ids.h index 8ee90d7..a705658 100644 --- a/Include/internal/pycore_uop_ids.h +++ b/Include/internal/pycore_uop_ids.h @@ -230,9 +230,10 @@ extern "C" { #define _JUMP_TO_TOP 377 #define _SAVE_RETURN_OFFSET 378 #define _CHECK_VALIDITY 379 -#define _LOAD_CONST_INLINE_BORROW 380 -#define _INTERNAL_INCREMENT_OPT_COUNTER 381 -#define MAX_UOP_ID 381 +#define _LOAD_CONST_INLINE 380 +#define _LOAD_CONST_INLINE_BORROW 381 +#define _INTERNAL_INCREMENT_OPT_COUNTER 382 +#define MAX_UOP_ID 382 #ifdef __cplusplus } diff --git a/Include/internal/pycore_uop_metadata.h b/Include/internal/pycore_uop_metadata.h index 9bfb4f4..14d3382 100644 --- a/Include/internal/pycore_uop_metadata.h +++ b/Include/internal/pycore_uop_metadata.h @@ -202,6 +202,7 @@ const uint16_t _PyUop_Flags[MAX_UOP_ID+1] = { [_SAVE_RETURN_OFFSET] = HAS_ARG_FLAG, [_EXIT_TRACE] = HAS_DEOPT_FLAG, [_CHECK_VALIDITY] = HAS_DEOPT_FLAG, + [_LOAD_CONST_INLINE] = 0, [_LOAD_CONST_INLINE_BORROW] = 0, [_INTERNAL_INCREMENT_OPT_COUNTER] = 0, }; @@ -329,6 +330,7 @@ const char *const _PyOpcode_uop_name[MAX_UOP_ID+1] = { [_LOAD_ATTR_WITH_HINT] = "_LOAD_ATTR_WITH_HINT", [_LOAD_BUILD_CLASS] = "_LOAD_BUILD_CLASS", [_LOAD_CONST] = "_LOAD_CONST", + [_LOAD_CONST_INLINE] = "_LOAD_CONST_INLINE", [_LOAD_CONST_INLINE_BORROW] = "_LOAD_CONST_INLINE_BORROW", [_LOAD_DEREF] = "_LOAD_DEREF", [_LOAD_FAST] = "_LOAD_FAST", |