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:
mpage 2025-04-01 10:18:42 -07:00 committed by GitHub
parent e9556e1004
commit 053c285f6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 1282 additions and 345 deletions

View file

@ -86,6 +86,10 @@ dummy_func(void) {
value = GETLOCAL(oparg);
}
op(_LOAD_FAST_BORROW, (-- value)) {
value = GETLOCAL(oparg);
}
op(_LOAD_FAST_AND_CLEAR, (-- value)) {
value = GETLOCAL(oparg);
JitOptSymbol *temp = sym_new_null(ctx);