Convert more uops to leave their inputs on the stack to be cleaned up by `_POP_TOP`
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Feature or enhancement
Proposal:
This is a follow up to https://github.com/python/cpython/issues/134584
We have, in the JIT, optimizations to eliminate many _POP_TOP operations. To take advantage of that we have converted many uops to leave their operands on the stack and added subsequent _POP_TOPs to remove them.
See https://github.com/python/cpython/issues/134584 for many examples of how to do this and why it works.
However, there are still a few uops yet to do. These are:
- LIST_EXTEND
- DICT_UPDATE @Sacul0457
- SET_UPDATE @Sacul0457
- DICT_MERGE @NekoAsakura
- CALL_INTRINSIC_1 @Sacul0457
- CALL_INTRINSIC_2 @KevinH15291
In addition, POP_ITER, END_FOR and END_SEND can be implemented as macro ops, using POP_TOP to gain the benefit of the the POP_TOP optimization.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Linked PRs
- gh-145964
- gh-145979
- gh-146170
- gh-146177
- gh-146185
- gh-146190
- gh-146262
- gh-146329
- gh-146383
- gh-148227
- gh-148477
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、説明されている変換パターンについて follow-up issue 134584 を読み、残っている uops として列挙されている LIST_EXTEND、DICT_UPDATE、SET_UPDATE、DICT_MERGE、CALL_INTRINSIC_1、CALL_INTRINSIC_2 を確認してください。さらに、POP_ITER、END_FOR、END_SEND がどのように表現されているかも調べてください。完了とは、これらの操作が提案されたスタッククリーンアップのアプローチを使用することを意味しますが、リンクされている PR から、その作業がすでに進行中であることが分かります。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- compilers, performance
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100