ピープホール最適化とは?
ピープホール最適化は、隣接する命令の短い並びを見て、認識できる非効率なパターンをより高速なものへ書き換える局所的な変換です。典型的な例には、冗長なロードの除去、ジャンプへのジャンプの畳み込み、2の累乗による乗算のシフトへの置き換えがあります。プログラム全体ではなく、その小さなウィンドウ上で機能します。
なぜ重要か
多くの小さな非効率は先行するパスを生き延び、一度に数命令をパターンマッチすることで最も容易に捕捉できます。ピープホールパスは、最終的なコード出力の直前にそれらを安価に整理します。
関連ガイド
What Is Strength Reduction?Strength reduction replaces expensive operations with cheaper equivalent ones, such as turning a multiplicati…
What Is Instruction Scheduling?Instruction scheduling reorders machine instructions to keep the CPU pipeline busy and hide latencies, withou…
What Is Common Subexpression Elimination?Common subexpression elimination removes redundant computations by reusing a previously computed result inste…