summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
diff options
context:
space:
mode:
authorJeff Glass <glass.jeffrey@gmail.com>2024-04-16 13:27:18 (GMT)
committerGitHub <noreply@github.com>2024-04-16 13:27:18 (GMT)
commitacf69e09c66f8473399fabab36b81f56496528a6 (patch)
treecdf6f3ae8acc8a84115ff051525f779176aae665 /Python/specialize.c
parentc053d52edd1e05ccc339e380b705749a3240d645 (diff)
downloadcpython-acf69e09c66f8473399fabab36b81f56496528a6.zip
cpython-acf69e09c66f8473399fabab36b81f56496528a6.tar.gz
cpython-acf69e09c66f8473399fabab36b81f56496528a6.tar.bz2
gh-115178: Add Counts of UOp Pairs to pystats (GH-115181)
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index 0b4b199..5e14bb5 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -11,6 +11,7 @@
#include "pycore_object.h"
#include "pycore_opcode_metadata.h" // _PyOpcode_Caches
#include "pycore_uop_metadata.h" // _PyOpcode_uop_name
+#include "pycore_uop_ids.h" // MAX_UOP_ID
#include "pycore_opcode_utils.h" // RESUME_AT_FUNC_START
#include "pycore_pylifecycle.h" // _PyOS_URandomNonblock()
#include "pycore_runtime.h" // _Py_ID()
@@ -269,6 +270,14 @@ print_optimization_stats(FILE *out, OptimizationStats *stats)
}
}
+ for (int i = 1; i <= MAX_UOP_ID; i++){
+ for (int j = 1; j <= MAX_UOP_ID; j++) {
+ if (stats->opcode[i].pair_count[j]) {
+ fprintf(out, "uop[%s].pair_count[%s] : %" PRIu64 "\n",
+ _PyOpcode_uop_name[i], _PyOpcode_uop_name[j], stats->opcode[i].pair_count[j]);
+ }
+ }
+ }
for (int i = 0; i < MAX_UOP_ID; i++) {
if (stats->error_in_opcode[i]) {
fprintf(