waffle

Module backend

Source
Expand description

Backend: IR to Wasm.

Modules§

  • Localification: a simple form of register allocation that picks locations for SSA values in Wasm locals.
  • Reducification: turning a potentially irreducible CFG into a reducible CFG. We perform context-sensitive code duplication to “peel off” the parts of loops that are reached by side-entrances, branching back to the main loop as soon as control passes through the loop header again.
  • Stackify implementation to produce structured control flow from an arbitrary CFG.
  • Treeification: placing some values “under” others if only used once, to generate more AST-like Wasm code.

Structs§

Functions§