compiler: enable generic cmm optimizations in wasm backend NCG
This MR enables the generic cmm optimizations in other NCGs to be run in the wasm backend as well. These simple optimizations do catch some corner cases not handled by the pre-NCG cmm pipeline and helps generating smaller code a bit. The main reason why they weren't run for wasm previously was cyclic dependency: cmmToCmm
was defined in GHC.CmmToAsm
, but the wasm backend NCG was defined in other modules that were imported by GHC.CmmToAsm
itself. But this can be detangled by moving it to a standalone module, and hence this MR.