-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Tier 2 cleanups and tweaks #115534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tier 2 cleanups and tweaks #115534
Conversation
Regarding for (int i = 0; i < 512; i++) {
if (i < 256) {
names = _PyOpcode_OpName;
} else {
names = _PyOpcode_uop_name;
}
if (stats->opcode[i].execution_count) {
fprintf(out, "uops[%s].execution_count : %" PRIu64 "\n", names[i], stats->opcode[i].execution_count);
}
if (stats->opcode[i].miss) {
fprintf(out, "uops[%s].specialization.miss : %" PRIu64 "\n", names[i], stats->opcode[i].miss);
}
} |
I saw that, and didn't immediately know how to rewrite that. Looking again I now know what to do (I had misunderstood what that code does) and I will fix this. |
Reason: The header is in fact needed with --enable-pystats. This reverts commit 182c023.
Fixed. There's one change: when an uop is also a Tier-1 op, the previous version would print the Tier-1 name (without a leading underscore). The new version always prints the Tier-2 name. E.g.
I believe the latter is more correct. |
Yeah, it probably is. This will make the stats before and after this change no longer comparable. That's probably fine -- if we find ourselves needing to do that the update to |
Oh, that's unfortunate. Didn't we just recently have a big stir about unexplained stats changes? Regarding a possible fix, were you thinking of just changing |
I foresee some merge conflicts with gh-114142. I'd rather see that merged first. |
Yes, exactly. Just something to normalize all the uops to have a |
Small merge conflict with #115550. |
@markshannon Could you review this? I intend to merge after your side exits PR lands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One suggestion, otherwise LGTM
* Rename `_testinternalcapi.get_{uop,counter}_optimizer` to `new_*_optimizer` * Use `_PyUOpName()` instead of` _PyOpcode_uop_name[]` * Add `target` to executor iterator items -- `list(ex)` now returns `(opcode, oparg, target, operand)` quadruples * Add executor methods `get_opcode()` and `get_oparg()` to get `vmdata.opcode`, `vmdata.oparg` * Define a helper for printing uops, and unify various places where they are printed * Add a hack to summarize_stats.py to fix legacy uop names (e.g. `POP_TOP` -> `_POP_TOP`) * Define helpers in `test_opt.py` for accessing the set or list of opnames of an executor
* Rename `_testinternalcapi.get_{uop,counter}_optimizer` to `new_*_optimizer` * Use `_PyUOpName()` instead of` _PyOpcode_uop_name[]` * Add `target` to executor iterator items -- `list(ex)` now returns `(opcode, oparg, target, operand)` quadruples * Add executor methods `get_opcode()` and `get_oparg()` to get `vmdata.opcode`, `vmdata.oparg` * Define a helper for printing uops, and unify various places where they are printed * Add a hack to summarize_stats.py to fix legacy uop names (e.g. `POP_TOP` -> `_POP_TOP`) * Define helpers in `test_opt.py` for accessing the set or list of opnames of an executor
* Rename `_testinternalcapi.get_{uop,counter}_optimizer` to `new_*_optimizer` * Use `_PyUOpName()` instead of` _PyOpcode_uop_name[]` * Add `target` to executor iterator items -- `list(ex)` now returns `(opcode, oparg, target, operand)` quadruples * Add executor methods `get_opcode()` and `get_oparg()` to get `vmdata.opcode`, `vmdata.oparg` * Define a helper for printing uops, and unify various places where they are printed * Add a hack to summarize_stats.py to fix legacy uop names (e.g. `POP_TOP` -> `_POP_TOP`) * Define helpers in `test_opt.py` for accessing the set or list of opnames of an executor
_testinternalcapi.get_{uop,counter}_optimizer
tonew_*_optimizer
_PyUOpName()
instead of_PyOpcode_uop_name[]
target
to executor iterator items --list(ex)
now returns(opcode, oparg, target, operand)
quadruplesget_opcode()
andget_oparg()
to getvmdata.opcode
,vmdata.oparg
POP_TOP
->_POP_TOP
)