GH-118095: Make BINARY_SUBSCR_GETITEM suitable for tier 2 by markshannon · Pull Request #120793 · python/cpython · GitHub
Skip to content

GH-118095: Make BINARY_SUBSCR_GETITEM suitable for tier 2 - #120793

Merged
brandtbucher merged 11 commits into
python:mainfrom
faster-cpython:binary-subscr-getitem-tier-2
Aug 1, 2024
Merged

GH-118095: Make BINARY_SUBSCR_GETITEM suitable for tier 2#120793
brandtbucher merged 11 commits into
python:mainfrom
faster-cpython:binary-subscr-getitem-tier-2

Conversation

@markshannon

@markshannon markshannon commented Jun 20, 2024

Copy link
Copy Markdown
Member

Makes BINARY_SUBSCR_GETITEM suitable for tier 2, including fix for #118540

@brandtbucher

Copy link
Copy Markdown
Member

@markshannon

Copy link
Copy Markdown
Member Author

@brandtbucher Thanks for the analysis

@markshannon

Copy link
Copy Markdown
Member Author

It looks like we bail out of projection in _PUSH_FRAME if the opcode is FOR_ITER_GEN. We can just do the same for BINARY_SUBSCR_GETITEM for now and consider a more sophisticated approach later.

@markshannon

Copy link
Copy Markdown
Member Author

Well, that was a bug. But not the bug that's causing this to fail.

Comment thread Python/optimizer.c Outdated
@brandtbucher

Copy link
Copy Markdown
Member

This failure seems interesting:

test_combine_stack_space_checks_large_framesize (test.test_capi.test_opt.TestUopsOptimization.test_combine_stack_space_checks_large_framesize) ... python: Python/optimizer.c:952: translate_bytecode_to_trace: Assertion `trace_length < max_length' failed.

@markshannon
markshannon marked this pull request as ready for review June 25, 2024 12:47
@markshannon
markshannon requested a review from brandtbucher June 25, 2024 13:32

@brandtbucher brandtbucher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a shame that we need to fish the method out of the type twice, but otherwise this is a good, straightforward change. Just one question about the other change being smuggled in alongside it:

Comment thread Python/optimizer.c Outdated
@brandtbucher

Copy link
Copy Markdown
Member

I just kicked off JIT benchmarks and stats for you.

Comment thread Python/optimizer.c Outdated
@brandtbucher brandtbucher self-assigned this Aug 1, 2024
@brandtbucher

Copy link
Copy Markdown
Member

@brandtbucher
brandtbucher merged commit df13a18 into python:main Aug 1, 2024
@markshannon
markshannon deleted the binary-subscr-getitem-tier-2 branch August 6, 2024 10:13
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