Common Subexpression Elimination とは?
common subexpression elimination は、同じ入力で同じ式が複数回計算されることを検出し、後続の計算を最初の結果への参照で置き換える最適化です。コンパイラは値を再利用する前に、使用の間でオペランドが変化していないことを証明します。これにより、同一の算術や address 計算の繰り返しを避けられます。
なぜ重要か
繰り返しの作業を除去すると、特にループや address 計算で実行される命令数が減ります。精度のために SSA 形式の上で実行されることが多い、定番の最適化です。
関連ガイド
What Is Loop-Invariant Code Motion?Loop-invariant code motion hoists computations whose result does not change across iterations out of a loop s…
What Is Strength Reduction?Strength reduction replaces expensive operations with cheaper equivalent ones, such as turning a multiplicati…
What Is Static Single Assignment?Static single assignment is an intermediate form where each variable is assigned exactly once, simplifying ma…