Skip to content

JS Backend add simple optimizer

doyougnu requested to merge doyougnu/ghc:wip/doyougnu/js/add-opts-pass into master

This MR changes some simple optimizations and is a first step in re-architecting the JS backend pipeline to add the optimizer. In particular it:

  • removes simple peep hole optimizations from GHC.StgToJS.Printer and removes that module
  • adds module GHC.JS.Opt
  • defines the same peep hole opts that were removed only now they are Syntax -> Syntax transformations rather than Syntax -> JS code optimizations
  • hooks the optimizer into code gen

Working Ticket:

Related MRs:

Left before ready:

  • squash with good commit message
  • CI passes
  • Cleanup and docs inGHC.JS.Optimizer

--- Post review

  • remove unsafe ops
  • alter code gen to generate the right code (For instead of While, FuncStat instead of var func..)
  • use CPS style
Edited by doyougnu

Merge request reports