python / python/cpython

Poor quality stencils produced with Homebrew clang version 22.1.2 on Apple Silicon

Ouverte
#148,501 5 commentaires 1 réaction 1 personne assignée Voir sur GitHub

@corona10 y travaille déjà.

Depuis le 13/4/2026.

interpreter-core pending performance topic-JIT type-bug
Langage dominant
Python
Étoiles
77.2k
Forks
35.9k
Métriques de merge des PR
Métriques de PR en attente

Description

While working on https://github.com/python/cpython/pull/148217, I found that the _fixup_constants optimizer in Tools/jit/_optimizers.py fails to convert adrp+ldr to movz when the two instructions are split by a label.

Example: _LOAD_FAST_r01

// Before (8 instructions):
adrp    x8, __JIT_OPARG_16@GOTPAGE
ldr     x8, [x8, __JIT_OPARG_16@GOTPAGEOFF]
add     x8, x21, w8, uxth #3
ldr     x24, [x8, #0x50]
tbnz    w24, #0x0, ...
ldr     w8, [x24]
add     w8, w8, #0x1
str     w8, [x24]

// After (7 instructions):
movz    x8, #0x0
add     x8, x21, w8, uxth #3
ldr     x24, [x8, #0x50]
tbnz    w24, #0x0, ...
ldr     w8, [x24]
add     w8, w8, #0x1
str     w8, [x24]

Example: _LOAD_FAST_BORROW_r01

// Before (5 instructions):
adrp    x8, __JIT_OPARG_16@GOTPAGE
ldr     x8, [x8, __JIT_OPARG_16@GOTPAGEOFF]
add     x8, x21, w8, uxth #3
ldr     x8, [x8, #0x50]
orr     x24, x8, #0x1

// After (4 instructions):
movz    x8, #0x0
add     x8, x21, w8, uxth #3
ldr     x8, [x8, #0x50]
orr     x24, x8, #0x1
Linked PRs
  • gh-148436
  • gh-157040

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.