Skip to content

gh-159493: insert super instructions after borrow analysis in compiler - #160032

Open
kumaraditya303 wants to merge 3 commits into
python:mainfrom
kumaraditya303:compiler-bug
Open

kumaraditya303 wants to merge 3 commits into
python:mainfrom
kumaraditya303:compiler-bug

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Oct 21, 2026
@kumaraditya303 kumaraditya303 removed the type-feature A feature request or enhancement label Oct 21, 2026
@eendebakpt

Copy link
Copy Markdown
Contributor

Moving the super instructions after the borrow analysis indeed seems like the right thing to do. I gathered some numbers of opcodes generated:

Opcode main PR #160032 borrow branch PR + borrow
STORE_FAST_LOAD_FAST 1,959 66 0 0
STORE_FAST_LOAD_FAST_BORROW 0 0 1,780 1,975
STORE_FAST_STORE_FAST 9,970 11,888 9,970 11,888
LOAD_FAST_LOAD_FAST 994 907 994 907
LOAD_FAST_BORROW_LOAD_FAST_BORROW 42,434 45,615 42,624 45,421
LOAD_FAST (strong) 20,589 20,671 20,655 20,737
LOAD_FAST_BORROW 539,494 535,117 539,227 533,530
STORE_FAST 153,407 151,464 153,586 149,555
all instructions 5,099,985 5,096,866 5,099,974 5,095,151

(borrow branch is main...eendebakpt:cpython:store-fast-load-fast-borrow)

The number of remaining STORE_FAST_LOAD_FAST is very low with this PR. Can you convert it to a STORE_FAST_LOAD_FAST_BORROW? (either this PR or a followup)

Comment thread Python/flowgraph.c Outdated
@kumaraditya303

Copy link
Copy Markdown
Contributor Author

Can you convert it to a STORE_FAST_LOAD_FAST_BORROW? (either this PR or a followup)

I think to do that in a followup.

@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Oct 21, 2026
@kumaraditya303 kumaraditya303 removed the type-feature A feature request or enhancement label Oct 21, 2026
Comment thread Misc/NEWS.d/next/Core_and_Builtins/2026-10-21-14-00-00.gh-issue-159493.sfLf1b.rst Outdated
Comment thread Misc/NEWS.d/next/Core_and_Builtins/2026-10-21-14-00-00.gh-issue-159493.sfLf1b.rst Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants