1414#include "pycore_object.h"
1515#include "pycore_opcode_metadata.h" // _PyOpcode_Caches
1616#include "pycore_uop_metadata.h" // _PyOpcode_uop_name
17- #include "pycore_uop_ids.h" // MAX_UOP_ID
17+ #include "pycore_uop_ids.h" // MAX_UOP_REGS_ID
1818#include "pycore_opcode_utils.h" // RESUME_AT_FUNC_START
1919#include "pycore_pylifecycle.h" // _PyOS_URandomNonblock()
2020#include "pycore_runtime.h" // _Py_ID()
@@ -34,7 +34,7 @@ static PyStats _Py_stats_struct = { .gc_stats = _py_gc_stats };
3434PyStats * _Py_stats = NULL ;
3535
3636#if PYSTATS_MAX_UOP_ID < MAX_UOP_REGS_ID
37- #error "Not enough space allocated for pystats. Increase PYSTATS_MAX_UOP_ID to at least MAX_UOP_ID "
37+ #error "Not enough space allocated for pystats. Increase PYSTATS_MAX_UOP_ID to at least MAX_UOP_REGS_ID "
3838#endif
3939
4040#define ADD_STAT_TO_DICT (res , field ) \
@@ -277,7 +277,7 @@ print_optimization_stats(FILE *out, OptimizationStats *stats)
277277 stats -> optimizer_failure_reason_no_memory );
278278 fprintf (out , "Optimizer remove globals builtins changed: %" PRIu64 "\n" , stats -> remove_globals_builtins_changed );
279279 fprintf (out , "Optimizer remove globals incorrect keys: %" PRIu64 "\n" , stats -> remove_globals_incorrect_keys );
280- for (int i = 0 ; i <= MAX_UOP_ID ; i ++ ) {
280+ for (int i = 0 ; i <= MAX_UOP_REGS_ID ; i ++ ) {
281281 if (stats -> opcode [i ].execution_count ) {
282282 fprintf (out , "uops[%s].execution_count : %" PRIu64 "\n" , _PyUOpName (i ), stats -> opcode [i ].execution_count );
283283 }
@@ -296,15 +296,15 @@ print_optimization_stats(FILE *out, OptimizationStats *stats)
296296 }
297297 }
298298
299- for (int i = 1 ; i <= MAX_UOP_ID ; i ++ ){
300- for (int j = 1 ; j <= MAX_UOP_ID ; j ++ ) {
299+ for (int i = 1 ; i <= MAX_UOP_REGS_ID ; i ++ ){
300+ for (int j = 1 ; j <= MAX_UOP_REGS_ID ; j ++ ) {
301301 if (stats -> opcode [i ].pair_count [j ]) {
302302 fprintf (out , "uop[%s].pair_count[%s] : %" PRIu64 "\n" ,
303303 _PyOpcode_uop_name [i ], _PyOpcode_uop_name [j ], stats -> opcode [i ].pair_count [j ]);
304304 }
305305 }
306306 }
307- for (int i = 0 ; i < MAX_UOP_ID ; i ++ ) {
307+ for (int i = 0 ; i < MAX_UOP_REGS_ID ; i ++ ) {
308308 if (stats -> error_in_opcode [i ]) {
309309 fprintf (
310310 out ,
0 commit comments