Skip to content

Optimize through symbolic tuples in tier 2 optimizer #119477

Closed

Description

@tekknolagi

Feature or enhancement

Proposal:

Currently we can reason about code like a + b if a and b are already known to be ints, but the type information disappears as soon as a and b get stored into memory such as tuples. We should be able to reason about

tup = (a, b)
tup[0] + tup[1]

and have the optimizer "see through" the BUILD_TUPLE instruction.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. changed the title [-]Optimze through symbolic tuples in tier 2 optimizer[/-] [+]Optimize through symbolic tuples in tier 2 optimizer[/+] on May 24, 2024
  2. eendebakpt commented on May 17, 2026

    @eendebakpt
    Contributor

    The optimization was implemented via #128940 and #133003. The issue can be closed.

  3. added
    pendingThe issue will be closed if no feedback is provided
    on May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is providedtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions