gh-130704: Strength reduce LOAD_FAST{_LOAD_FAST} (#130708)
Optimize `LOAD_FAST` opcodes into faster versions that load borrowed references onto the operand stack when we can prove that the lifetime of the local outlives the lifetime of the temporary that is loaded onto the stack.
This commit is contained in:
@@ -573,6 +573,7 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
|
||||
if (last->opcode == _LOAD_CONST_INLINE ||
|
||||
last->opcode == _LOAD_CONST_INLINE_BORROW ||
|
||||
last->opcode == _LOAD_FAST ||
|
||||
last->opcode == _LOAD_FAST_BORROW ||
|
||||
last->opcode == _COPY
|
||||
) {
|
||||
last->opcode = _NOP;
|
||||
|
||||
Reference in New Issue
Block a user