python / python/cpython

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

Đang mở
#148,501 5 bình luận 1 reaction 1 người được giao Xem trên GitHub

@corona10 đang làm issue này rồi.

Từ ngày 13/4/2026.

interpreter-core pending performance topic-JIT type-bug
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.