René's URL Explorer Experiment


Title: gh-116291: Tier 2 - True function inlining redux by Fidget-Spinner · Pull Request #116290 · python/cpython · GitHub

Open Graph Title: gh-116291: Tier 2 - True function inlining redux by Fidget-Spinner · Pull Request #116290 · python/cpython

X Title: gh-116291: Tier 2 - True function inlining redux by Fidget-Spinner · Pull Request #116290 · python/cpython

Description: This PR adds true function inlining to CPython's tier 2 optimizer. It's a reduced form without frame reconstruction. See design discussion here faster-cpython/ideas#653. This passes the entire CPython test suite. All topmost frame call bodies consisting of purely pure ops are inlined. E.g. def foo(a, b): return a + b (only if type propagation works for the above properly) If we really want to boost this, we should do loop peeling to remove as many guards as possible just so we can inline stuff. I also forgot to add @gvanrossum as co-author, so I will add him before I merge Issue: gh-116291

Open Graph Description: This PR adds true function inlining to CPython's tier 2 optimizer. It's a reduced form without frame reconstruction. See design discussion here faster-cpython/ideas#653. This passes the ent...

X Description: This PR adds true function inlining to CPython's tier 2 optimizer. It's a reduced form without frame reconstruction. See design discussion here faster-cpython/ideas#653. This passes...

Opengraph URL: https://github.com/python/cpython/pull/116290

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9be1f817-d1da-9bf2-2e2b-7e2f2594bc63
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB0A2:305E50:3DFF1B5:5820CEF:6A56AF68
html-safe-nonceced4f096b575530e201d611673616c94c4a68402a134b85963193417f9251f63
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEEyOjMwNUU1MDozREZGMUI1OjU4MjBDRUY6NkE1NkFGNjgiLCJ2aXNpdG9yX2lkIjoiMzkzNDc2MDQ2MzgyMTYxNDk1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9c640a5c66dc87110dfd93dd839187fb0c81a5d867ecb446a8012e5544763ff6
hovercard-subject-tagpull_request:1753564017
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/116290/files
twitter:imagehttps://avatars.githubusercontent.com/u/28750310?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/28750310?s=400&v=4
og:image:altThis PR adds true function inlining to CPython's tier 2 optimizer. It's a reduced form without frame reconstruction. See design discussion here faster-cpython/ideas#653. This passes the ent...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonedf99b7164e1d961b639cf5d3cbd6b5ba673edc67bd7e47cdc4746b96099e11ae
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec29ba03b1896083dbe1084f6cd1c5367d8a0d67c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/116290/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F116290%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F116290%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/116290/files
Reloadhttps://github.com/python/cpython/pull/116290/files
Reloadhttps://github.com/python/cpython/pull/116290/files
Please reload this pagehttps://github.com/python/cpython/pull/116290/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/116290/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
Fidget-Spinnerhttps://github.com/Fidget-Spinner
python:mainhttps://github.com/python/cpython/tree/main
Fidget-Spinner:tier2_inliner_reduxhttps://github.com/Fidget-Spinner/cpython/tree/tier2_inliner_redux
Conversation 58 https://github.com/python/cpython/pull/116290
Commits 30 https://github.com/python/cpython/pull/116290/commits
Checks 0 https://github.com/python/cpython/pull/116290/checks
Files changed https://github.com/python/cpython/pull/116290/files
Please reload this pagehttps://github.com/python/cpython/pull/116290/files
gh-116291: Tier 2 - True function inlining redux https://github.com/python/cpython/pull/116290/files#top
Show all changes 30 commits https://github.com/python/cpython/pull/116290/files
0114bb7 Add frame support functions Fidget-Spinner Feb 20, 2024 https://github.com/python/cpython/pull/116290/commits/0114bb7d75b451fb5d1c94a2fa691050ec2295f3
d210b5d Abstract interp analysis done Fidget-Spinner Feb 20, 2024 https://github.com/python/cpython/pull/116290/commits/d210b5db0fb277e57906462c4639ec1b2349e3d5
f165138 Add frame inlining heuristics Fidget-Spinner Feb 20, 2024 https://github.com/python/cpython/pull/116290/commits/f16513823ac2de33d9e8e53ef81d36d7ff84642c
7551b65 inlining decision pass Fidget-Spinner Feb 21, 2024 https://github.com/python/cpython/pull/116290/commits/7551b651e1ffae8b9cdd4bb4121e1cf4507acd9c
683927d add inline markers Fidget-Spinner Feb 21, 2024 https://github.com/python/cpython/pull/116290/commits/683927d7b35ab649bff25fdbca952290a55705a3
4100b61 more analysis work Fidget-Spinner Feb 21, 2024 https://github.com/python/cpython/pull/116290/commits/4100b613347215156ba636a536c6abda5b22782a
11262ea propagate non inlineable Fidget-Spinner Feb 21, 2024 https://github.com/python/cpython/pull/116290/commits/11262eae9dafc526e761f34808398b8872a0da02
e4a68e3 Merge remote-tracking branch 'upstream/main' into tier2_inliner Fidget-Spinner Feb 21, 2024 https://github.com/python/cpython/pull/116290/commits/e4a68e378b483e4670cf43913cb169086c92683c
7856988 rewrite loads/store, remove replicates for load and store Fidget-Spinner Feb 21, 2024 https://github.com/python/cpython/pull/116290/commits/7856988b014d9b8cbbb0b27e7bc70bc46eb595c9
7b69a62 frame reconstruction Fidget-Spinner Feb 21, 2024 https://github.com/python/cpython/pull/116290/commits/7b69a6274598a1a2d6b706f796c33517353769b9
e1ee2ad fix a bunch of bugs in the abstract interp Fidget-Spinner Feb 21, 2024 https://github.com/python/cpython/pull/116290/commits/e1ee2ad076541e1e983a4c056fc93d3a7c5cf568
7a12a7b Simplify Fidget-Spinner Mar 3, 2024 https://github.com/python/cpython/pull/116290/commits/7a12a7b4ed20a5b5f03893451454a3b8a7df2001
1791803 Merge remote-tracking branch 'upstream/main' into tier2_inliner_redux Fidget-Spinner Mar 3, 2024 https://github.com/python/cpython/pull/116290/commits/17918037c46b95811cbe34f3e905978f9e46ce2b
9734d90 Fix main merge problems Fidget-Spinner Mar 3, 2024 https://github.com/python/cpython/pull/116290/commits/9734d90d16cc486b6a605db32b438a3123a13e53
f0274cb fix methods Fidget-Spinner Mar 3, 2024 https://github.com/python/cpython/pull/116290/commits/f0274cbffb22fb50695363dec3a99efb17c3f688
2eff546 cleanup more Fidget-Spinner Mar 3, 2024 https://github.com/python/cpython/pull/116290/commits/2eff54631de7a72b1bae28a54ff4ae1601eae505
1322578 make tests pass Fidget-Spinner Mar 3, 2024 https://github.com/python/cpython/pull/116290/commits/132257892bcaf6f46db76e4c9c8c9dc1ca7e6117
16efbe0 📜🤖 Added by blurb_it. blurb-it[bot] Mar 3, 2024 https://github.com/python/cpython/pull/116290/commits/16efbe00c6adb60cb1cec45c60d5fc8f63b3734c
2e65b86 remove false check Fidget-Spinner Mar 3, 2024 https://github.com/python/cpython/pull/116290/commits/2e65b86a62adabd0b8c8458e0480cceb85719ce4
f74c315 Merge branch 'tier2_inliner_redux' of github.com:Fidget-Spinner/cpyth… Fidget-Spinner Mar 3, 2024 https://github.com/python/cpython/pull/116290/commits/f74c315d705685ca5491089a1aa7efc35805502a
df20f69 Merge remote-tracking branch 'upstream/main' into tier2_inliner_redux Fidget-Spinner Mar 3, 2024 https://github.com/python/cpython/pull/116290/commits/df20f69b5a8855207c3481c11ecd9e6986ef1488
24b127f fix failing tests Fidget-Spinner Mar 4, 2024 https://github.com/python/cpython/pull/116290/commits/24b127fdaafa7b58a1c6c2170748dc4ae2a208e9
b04215f Merge remote-tracking branch 'upstream/main' into tier2_inliner_redux Fidget-Spinner Mar 4, 2024 https://github.com/python/cpython/pull/116290/commits/b04215f0c1790742f71d39c7503f84c9a8250c82
e84eeed Implement _GROW_TIER2_FRAME without adding tier2_extra_size gvanrossum Mar 5, 2024 https://github.com/python/cpython/pull/116290/commits/e84eeed8dbe6eca001c674c826d381ec24fcc200
dad9100 Merge commit '23db9c62272' into kenjin_tier2_inliner_redux gvanrossum Mar 6, 2024 https://github.com/python/cpython/pull/116290/commits/dad9100a7bb13b75712ff3dd22f4dfeabc89b8d1
c7ad988 Replace _PUSH_FRAME_INLINEABLE body with assert(0) since it can never… gvanrossum Mar 6, 2024 https://github.com/python/cpython/pull/116290/commits/c7ad9880a5148698eea8be043cc6b1d2bc43dcb5
2f9539b Don't ever decrement datastack_top! gvanrossum Mar 6, 2024 https://github.com/python/cpython/pull/116290/commits/2f9539bfa88f23f06e876901919562a17a34c829
29217e0 Remove commented-out comment and assert gvanrossum Mar 6, 2024 https://github.com/python/cpython/pull/116290/commits/29217e0103812b0f43bae2650e6b2bd82ee67794
73a0cd2 Merge remote-tracking branch 'upstream/main' into tier2_inliner_redux Fidget-Spinner Mar 6, 2024 https://github.com/python/cpython/pull/116290/commits/73a0cd2750e72cc422d9553cc9ddce80ba90d21f
8820429 Add extern decl for real_localsplus_idx(). gvanrossum Mar 7, 2024 https://github.com/python/cpython/pull/116290/commits/8820429dbaeb7ed3dbbda4ffd299ac8bcffe2ee1
Clear filters https://github.com/python/cpython/pull/116290/files
Please reload this pagehttps://github.com/python/cpython/pull/116290/files
Please reload this pagehttps://github.com/python/cpython/pull/116290/files
pycore_optimizer.h https://github.com/python/cpython/pull/116290/files#diff-04d62d99f4a2b418ae2fd0eecece5b153dee4ac843c706a8de03c45a2d65efcc
pycore_uop_ids.h https://github.com/python/cpython/pull/116290/files#diff-2a420e4d0d58009249c0f73f7c822167b053bd51cb213b20179bd2aebfc66ff9
pycore_uop_metadata.h https://github.com/python/cpython/pull/116290/files#diff-55e65a72fa31e9b746e03076d2c74b716c0c1171663f36960b2339fcbfae9bab
test_opt.py https://github.com/python/cpython/pull/116290/files#diff-67b5bd915e37f77df79907865982648172c27d3b96fbb072b30a73c6a2735439
test_generated_cases.py https://github.com/python/cpython/pull/116290/files#diff-9168c63f7de36279d370ea7d6403f554f48e6da75e82b6b70b5a207a11848750
2024-03-03-20-37-10.gh-issue-116291.W1Z7Oy.rst https://github.com/python/cpython/pull/116290/files#diff-ecec96141dff5d756ba50b2138c4388cc4e37244f433a6738a8abcbf146171b6
bytecodes.c https://github.com/python/cpython/pull/116290/files#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
ceval.c https://github.com/python/cpython/pull/116290/files#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59de
executor_cases.c.h https://github.com/python/cpython/pull/116290/files#diff-a1c3430c42a66c16e6d2e154491a6da993b187b27c628545a12a02c7b2a06b81
optimizer_analysis.c https://github.com/python/cpython/pull/116290/files#diff-eac5ab7e741b8b825a24d31a5bf844e86086431fb698cfcabe1277b68c375ca2
optimizer_bytecodes.c https://github.com/python/cpython/pull/116290/files#diff-e5bd2b14b0b10f0f47786e26306d689ed1361c3dc3b11dcc3ea52b8a2422ff64
optimizer_cases.c.h https://github.com/python/cpython/pull/116290/files#diff-ed4567b3e67709ec57bf4df91ef058cfcbe00d7da11cd2a75e38241fa1ca99d2
optimizer_symbols.c https://github.com/python/cpython/pull/116290/files#diff-b28c00f0aab70992e604ed7c3e9cb4ca39779f33d5ff2c7777de5a044422f095
optimizer_generator.py https://github.com/python/cpython/pull/116290/files#diff-0e6b93be57fb09a403b522dd1babfec9a9ed626d868a4fec6a42a6942c55dc23
Include/internal/pycore_optimizer.hhttps://github.com/python/cpython/pull/116290/files#diff-04d62d99f4a2b418ae2fd0eecece5b153dee4ac843c706a8de03c45a2d65efcc
View file https://github.com/Fidget-Spinner/cpython/blob/8820429dbaeb7ed3dbbda4ffd299ac8bcffe2ee1/Include/internal/pycore_optimizer.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/116290/{{ revealButtonHref }}
https://github.com/python/cpython/pull/116290/files#diff-04d62d99f4a2b418ae2fd0eecece5b153dee4ac843c706a8de03c45a2d65efcc
https://github.com/python/cpython/pull/116290/files#diff-04d62d99f4a2b418ae2fd0eecece5b153dee4ac843c706a8de03c45a2d65efcc
https://github.com/python/cpython/pull/116290/files#diff-04d62d99f4a2b418ae2fd0eecece5b153dee4ac843c706a8de03c45a2d65efcc
https://github.com/python/cpython/pull/116290/files#diff-04d62d99f4a2b418ae2fd0eecece5b153dee4ac843c706a8de03c45a2d65efcc
Include/internal/pycore_uop_ids.hhttps://github.com/python/cpython/pull/116290/files#diff-2a420e4d0d58009249c0f73f7c822167b053bd51cb213b20179bd2aebfc66ff9
View file https://github.com/Fidget-Spinner/cpython/blob/8820429dbaeb7ed3dbbda4ffd299ac8bcffe2ee1/Include/internal/pycore_uop_ids.h
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/116290/files
Include/internal/pycore_uop_metadata.hhttps://github.com/python/cpython/pull/116290/files#diff-55e65a72fa31e9b746e03076d2c74b716c0c1171663f36960b2339fcbfae9bab
View file https://github.com/Fidget-Spinner/cpython/blob/8820429dbaeb7ed3dbbda4ffd299ac8bcffe2ee1/Include/internal/pycore_uop_metadata.h
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/116290/files
Please reload this pagehttps://github.com/python/cpython/pull/116290/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.