Skip to content

Unify branches and deopts in the tier 2 IR. #111848

Closed

Description

@markshannon

The basic premise of optimizing traces is that most branches are highly biased.
So we use DEOPT_IF to branch in the uncommon case.
However in the optimizer we may want to move work to exit branches, which needs jumps.
Unifying branches and jumps also simplifies the tier 2 interpreter and the JIT compiler.

So, let's merge jumps and branches, as follows:

  • Convert most, if not all jumps in the tier 2 code to DEOPT_IFs in bytecodes.c
  • Convert deopts into jumps internally to allow work like SET_IP to be sunk into exit branches.

See also #111610

Linked PRs

Activity

  1. added a commit that references this issue on Nov 8, 2023
  2. brandtbucher commented on Nov 8, 2023

    @brandtbucher
    Member

    Yes please! :)

  3. added 2 commits that reference this issue on Nov 14, 2023
  4. added a commit that references this issue on Nov 20, 2023
  5. gvanrossum commented on Nov 20, 2023

    @gvanrossum
    Member

    Do you expect more to happen here? It looks complete. :-)

  6. added 4 commits that reference this issue on Feb 11, 2024
  7. added 4 commits that reference this issue on Sep 2, 2024
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

    interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions