KEMBAR78
gh-120722: Propogate instruction location in optimization of LOAD_CONST + RETURN_VALUE with RETURN_CONST by blhsing · Pull Request #120723 · python/cpython · GitHub
Skip to content

Conversation

@blhsing
Copy link
Contributor

@blhsing blhsing commented Jun 19, 2024

Currently a lambda function returning a constant value gets its pair of LOAD_CONST and RETURN_VALUE instructions optimized by the compiler into a RETURN_CONST instruction without the original location propagated.

This PR fixes the issue by propogating the location information for this optimization.

@JelleZijlstra
Copy link
Member

JelleZijlstra commented Jun 19, 2024

I think #120724 is a more general solution (sorry for submitting that PR after this one was already open; I was writing tests when this PR appeared).

@blhsing
Copy link
Contributor Author

blhsing commented Jun 19, 2024

Closing my PR in favor of @JelleZijlstra's PR #120724.

@blhsing blhsing closed this Jun 19, 2024
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