Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
GH-131798: Narrow types more aggressively in the JIT#134373
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
1a958a8
1cd663f
d097c86
2f8dad9
f483964
101955f
0974ec9
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -523,6 +523,25 @@ optimize_uops( | ||
} | ||
const uint16_t op_without_pop[MAX_UOP_ID] = { | ||
[_POP_TOP] = _NOP, | ||
[_POP_TOP_LOAD_CONST_INLINE] = _LOAD_CONST_INLINE, | ||
[_POP_TOP_LOAD_CONST_INLINE_BORROW] = _LOAD_CONST_INLINE_BORROW, | ||
[_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TOP_LOAD_CONST_INLINE_BORROW, | ||
}; | ||
const uint16_t remove_push[MAX_UOP_ID] = { | ||
[_COPY] = _NOP, | ||
[_LOAD_CONST_INLINE] = _NOP, | ||
[_LOAD_CONST_INLINE_BORROW] = _NOP, | ||
[_LOAD_FAST] = _NOP, | ||
[_LOAD_FAST_BORROW] = _NOP, | ||
[_LOAD_SMALL_INT] = _NOP, | ||
[_POP_TOP_LOAD_CONST_INLINE] = _POP_TOP, | ||
[_POP_TOP_LOAD_CONST_INLINE_BORROW] = _POP_TOP, | ||
[_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TWO, | ||
}; | ||
static int | ||
remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size) | ||
@@ -551,50 +570,23 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size) | ||
buffer[pc].opcode = _NOP; | ||
} | ||
break; | ||
default: | ||
{ | ||
// Cancel out pushes and pops, repeatedly. So: | ||
// _LOAD_FAST + _POP_TWO_LOAD_CONST_INLINE_BORROW + _POP_TOP | ||
// ...becomes: | ||
// _NOP + _POP_TOP + _NOP | ||
while (op_without_pop[opcode]) { | ||
_PyUOpInstruction *last = &buffer[pc - 1]; | ||
while (last->opcode == _NOP) { | ||
last--; | ||
} | ||
if (!remove_push[last->opcode]) { | ||
break; | ||
Comment on lines -568 to -592 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. feels good 🤩 | ||
} | ||
last->opcode = remove_push[last->opcode]; | ||
opcode = buffer[pc].opcode = op_without_pop[opcode]; | ||
} | ||
/* _PUSH_FRAME doesn't escape or error, but it | ||
* does need the IP for the return address */ | ||
bool needs_ip = opcode == _PUSH_FRAME; | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.