FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-131798: Narrow types more aggressively in the JIT by brandtbucher · Pull Request #134373 · python/cpython · GitHub

Repository navigation

GH-131798: Narrow types more aggressively in the JIT - #134373

Merged
brandtbucher merged 7 commits into
python:mainfrom
brandtbucher:check-attr-class
May 20, 2025
Merged

brandtbucher merged 7 commits into
python:mainfrom
brandtbucher:check-attr-class

Conversation

brandtbucher commented May 20, 2025 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

When setting the type version, we should also set the type (if possible). We can use this to narrow unknown classes to constants in uops like _CHECK_ATTR_CLASS.

(Also, fix a couple of cases where we were incorrectly detecting contradictions when updating some symbols.)

brandtbucher requested a review from tomasr8 May 20, 2025 18:14
brandtbucher self-assigned this May 20, 2025
brandtbucher added performance Performance or resource usage interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-JIT labels May 20, 2025
Comment on lines -568 to -592
case _POP_TOP_LOAD_CONST_INLINE:
case _POP_TOP_LOAD_CONST_INLINE_BORROW:
last->opcode = _NOP;
goto optimize_pop_top_again;
case _COPY:
case _LOAD_CONST_INLINE:
case _LOAD_CONST_INLINE_BORROW:
case _LOAD_FAST:
case _LOAD_FAST_BORROW:
case _LOAD_SMALL_INT:
last->opcode = _NOP;
if (opcode == _POP_TOP) {
opcode = buffer[pc].opcode = _NOP;
}
else if (opcode == _POP_TOP_LOAD_CONST_INLINE) {
opcode = buffer[pc].opcode = _LOAD_CONST_INLINE;
}
else if (opcode == _POP_TOP_LOAD_CONST_INLINE_BORROW) {
opcode = buffer[pc].opcode = _LOAD_CONST_INLINE_BORROW;
}
else {
assert(opcode == _POP_TWO_LOAD_CONST_INLINE_BORROW);
opcode = buffer[pc].opcode = _POP_TOP_LOAD_CONST_INLINE_BORROW;
goto optimize_pop_top_again;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

feels good 🤩

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage topic-JIT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL