Poor quality stencils produced with Homebrew clang version 22.1.2 on Apple Silicon
未关闭
@corona10 已经在做这个了。
开始于 2026年4月13日。
interpreter-core
pending
performance
topic-JIT
type-bug
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 35.9k
- PR 合并指标
- PR 指标待抓取
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
评估
这个 Issue 还没有评估数据。