Description
It eliminates equivalent blocks in a SSA function. The equivalence criteria requires blocks to have no arguments or statements and transfer via Raise, Return, or Goto of a single global variable.
Implementation
common-block.sig common-block.funDetails and Notes
-
Rewrites
L_X () raise (global_Y)
toL_X () L_Y' ()
and addsL_Y' () raise (global_Y)
to the SSA function. -
Rewrites
L_X () return (global_Y)
toL_X () L_Y' ()
and addsL_Y' () return (global_Y)
to the SSA function. -
Rewrites
L_X () L_Z (global_Y)
toL_X () L_Y' ()
and addsL_Y' () L_Z (global_Y)
to the SSA function.
The Shrink pass rewrites all uses of L_X to L_Y' and drops L_X.
For example, all uncaught Overflow exceptions in a SSA function share the same raising block.