Skip to content

gh-148211: decompose _INSERT_1_LOAD_CONST_INLINE(_BORROW) in JIT#148283

Merged
Fidget-Spinner merged 9 commits intopython:mainfrom
NekoAsakura:gh-148211/decompose-insert-1
Apr 9, 2026
Merged

gh-148211: decompose _INSERT_1_LOAD_CONST_INLINE(_BORROW) in JIT#148283
Fidget-Spinner merged 9 commits intopython:mainfrom
NekoAsakura:gh-148211/decompose-insert-1

Conversation

@NekoAsakura
Copy link
Copy Markdown
Contributor

@NekoAsakura NekoAsakura commented Apr 9, 2026

@Fidget-Spinner
Copy link
Copy Markdown
Member

It seems this does not build?

@NekoAsakura
Copy link
Copy Markdown
Contributor Author

Think I've messed up the merge a bit, I'll get it sorted.

@NekoAsakura
Copy link
Copy Markdown
Contributor Author

That should be it. Tests failed with HTTP 504, I'll update branch and give it another go.

@Fidget-Spinner
Copy link
Copy Markdown
Member

Just so you know, JIT development has been very active recently (thanks to you and other contributors!). So i'm going to merge this PR after merging #144963

@Fidget-Spinner
Copy link
Copy Markdown
Member

That means you'll probably have to merge in main again after that, thanks!

@NekoAsakura
Copy link
Copy Markdown
Contributor Author

It's great to see so much activity on JIT lately. Wouldn't have been possible without the reviews from you and other core devs. Cheers🥂 Happy to rebase once that's in.

Copy link
Copy Markdown
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

It looks like every call to optimize_to_bool now passes _LOAD_CONST_INLINE_BORROW as its load_op argument.
So, drop that argument.

Likewise for the op arguments to lookup_attr, so it only needs the prefix and suffix arguments.

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 9, 2026

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Copy link
Copy Markdown
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

Looks good.
One small suggestion.

self.assertNotIn("_LOAD_ATTR_METHOD_NO_DICT", uops)
self.assertNotIn("_INSERT_1_LOAD_CONST_INLINE", uops)
self.assertIn("_INSERT_1_LOAD_CONST_INLINE_BORROW", uops)
self.assertNotIn("_INSERT_1_LOAD_CONST_INLINE_BORROW", uops)
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.

Can you remove this line and the one above.
There is no point in asserting that a non-existent uop isn't present.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right, bit of a brainfart when I wrote that.

@Fidget-Spinner
Copy link
Copy Markdown
Member

You need to regen files after pulling in main.

@NekoAsakura
Copy link
Copy Markdown
Contributor Author

Oops, thanks for the remind.

@Fidget-Spinner
Copy link
Copy Markdown
Member

@markshannon I'm gonna assume that based off your last comment, this PR is fine to merge now. I think it looks good to me.

@Fidget-Spinner Fidget-Spinner merged commit 0f49232 into python:main Apr 9, 2026
86 of 87 checks passed
@Fidget-Spinner
Copy link
Copy Markdown
Member

@NekoAsakura all the _POP_CALL_X_LOAD_CONST_INLINE_BORROW look like an easy win (just POP_TOP, POP_TOP, LOAD_CONST_INLINE_X). Could you work on those next please. Thank you so much!

@NekoAsakura NekoAsakura deleted the gh-148211/decompose-insert-1 branch April 9, 2026 16:47
@NekoAsakura
Copy link
Copy Markdown
Contributor Author

@NekoAsakura all the _POP_CALL_X_LOAD_CONST_INLINE_BORROW look like an easy win (just POP_TOP, POP_TOP, LOAD_CONST_INLINE_X). Could you work on those next please. Thank you so much!

Sure, I was going to leave them open in case anyone fancied having a go, but if nobody's picked them up I'm happy to crack on with it.

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.

3 participants