Global code placement comes in two flavours. The first is loop
invariant code motion (LICM), the second is global common sub
expression elimination (GCSE).
LICM is applied to HIR and LIR, GCSE only to LIR and before
LICM.
Both algorithms run on SSA and use the dominator tree to determine
positions for operations. That's why these operations are called
code placement instead of code motion.
There is no code yet to deal with partial redundancies.
LICM is applied to HIR and LIR, GCSE only to LIR and before LICM.
Both algorithms run on SSA and use the dominator tree to determine positions for operations. That's why these operations are called code placement instead of code motion.
There is no code yet to deal with partial redundancies.