Common subexpression elimination (source code)

= Common subexpression elimination
{wiki}

= CSE
{c}
{synonym}

A transformation that computes a repeated <program expression> once and reuses its saved result when the value is known not to have changed. A repeated load can be reused only when intervening stores, calls or other changes cannot alter the relevant location. <Alias analysis> helps establish that fact. Maximal address sharing can be counterproductive if <instruction selection> could otherwise fold an address <addition> into <register-offset addressing>.