[論文レビュー] Idempotent Slices with Applications to Code-Size Reduction
この論文は GSA 形で不動点 backward slices を形式化し、音響的な線形時間スライス識別アルゴリズムを提供し、非連続な命令を統合できるスライスベースのコードサイズ削減アプローチ(SBCR)を実証しており、LLVM バイナリで顕著な削減を達成します。
Given a value computed within a program, an idempotent backward slice with respect to this value is a maximal subprogram that computes it. An informal notion of an idempotent slice has previously been used by Guimaraes et al. to transform eager into strict evaluation in the LLVM intermediate representation. However, that algorithm is insufficient to be correctly applied to general control-flow graphs. This paper addresses these omissions by formalizing the notion of idempotent backward slices and presenting a sound and efficient algorithm for extracting them from programs in Gated Static Single Assignment (GSA) form. As an example of their practical use, the paper describes how identifying and extracting idempotent backward slices enables a sparse code-size reduction optimization; that is, one capable of merging non-contiguous sequences of instructions within the control-flow graph of a single function or across functions. Experiments with the LLVM test suite show that, in specific benchmarks, this new algorithm achieves code-size reductions up to -7.24% on programs highly optimized by the -Os sequence of passes from clang 17.
研究の動機と目的
- 一般的な制御フローグラフに対する先行手法のギャップを特定しつつ、不動点 backward slices の概念を形式化する。
- GSA 形のプログラムから不動点 backward slices を抽出する音響的で効率的なアルゴリズムを開発する。
- スライスを概説し統合することでコードサイズ削減の最適化を実現する方法を示す。
- LLVM にスライ slicing アルゴリズムを実装し、LLVM テストスイートで有効性を評価する。
提案手法
- Tu および Padua のゲーティングパスアルゴリズムを用いて SSA を GSA に変換し、明示的なデータ–制御依存関係を得る。
- GSA を走査してループおよび関数を意識した停止条件を用いて不動点 backward slices を識別する。
- 識別されたスライスを guarded インターフェースを持つ単独の関数としてアウトラインし、意味論的な正当性を証明する(Theorem 4.2)。
- 同一性/意味論的に等価なスライス関数を二段階の重複排除(構造的ハッシュと標準的比較)でマージする。
- コストモデルに基づく決定を適用してスライスをアウトライン化するか現状維持するかを判断する(パラメータ I、P、C)。
- SBCR を LLVM テストスイート上で基準手法(FMSA および LLVM IROutliner)と比較評価し、コードサイズの変化に焦点を当てる。

実験結果
リサーチクエスチョン
- RQ1SBCR の理想的なコストモデルのパラメータとは何か。
- RQ2不動点スライスのアウトライン化でどれだけのコードサイズ削減が達成でき、従来研究とどう比較されるか。
- RQ3スライスアウトライン化の実行時およびコンパイルのオーバーヘッドは従来手法と比較してどうか。
- RQ4スライスアウトライン化アルゴリズムの漸近的挙動はどうなるか。
- RQ5SBCR を他のコードサイズ削減手法と組み合わせた場合に累積的な利益はあるか。
主な発見
- 不動点 backward slices は GSA 形から正しく識別でき、ハンモック構造や CSSA 特性を必要としない。
- Backward slicing はプログラムの CFG 辺に対して線形時間で動作する。
- SBCR は -Os 最適化と組み合わせた場合、2007 ベンチマーク全体の geometric mean で .text サイズを最大 7.24% 減少させることができる。
- SBCR は関数の並べ替えによるシーケンス整列や LLVM IROutliner などの従来手法が捉えきれない非連続・跨関数スライスの機会を発見する。
- 提案手法は既存技術と補完的で、特定のベンチマーク(例:AMGmk)で大幅な削減をもたらす。
- 健全性保証が提供される:アウトライン化されたスライスは元の基準値とスライス内のループを含むプログラム意味値を保つ。
![Figure 2 : (a) Program with a slice criterion: the instruction $s=s+1$ . (b) Dense slice, adapted from Blazy et al. [ 3 , Fig. 1] . (c) Program in Static Single-Assignment form. (d) Program in Gated Static Single-Assignment form. (e) Idempotent backward slice with respect to SSA variable $s_{3}$ . (](https://ar5iv.labs.arxiv.org/html/2603.09726/assets/x2.png)
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。