FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

The code generated by the JIT for loading 16 bit and 32 bit constants is inefficient. · Issue #140683 · python/cpython · GitHub

Repository navigation

The code generated by the JIT for loading 16 bit and 32 bit constants is inefficient. #140683

Closed

Description

This affects both x86-64 and AArch64.

Most guard micro-ops are checking against 16 or 32 bit version numbers, so this is an important use case.

The code we generate is too large and, on AArch64, performs extra memory accesses.

Constant x86-64 now x86-64 ideal AArch64 now AArch64 ideal
16 bit 1 10 byte instruction 1 5 byte instruction 2 instructions + 1 memory load 1 instruction
32 bit 1 10 byte instruction 1 5 byte instruction 2 instructions + 1 memory load 2 instructions

Linked PRs

Activity

  1. brandtbucher commented on Oct 27, 2025

    Member

    Is the plan to handle this in the textual assembly transformation step? Or by relaxing the relocations at runtime?

  2. markshannon commented on Oct 28, 2025

    MemberAuthor

    I think this needs to handled all the way through the tools chain, including the code generator to avoid Clang generating the load instructions. Or it might be possible to fix that with different compiler flags. I'll need to experiment. Have you given this any thought?

  3. added a commit that references this issue on Dec 11, 2025
  4. added a commit that references this issue on Dec 12, 2025
  5. sergey-miryanov commented on May 4, 2026

    Contributor

    Completed via #142511

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

    3.15bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetopic-JIT

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL