JS Backend add simple optimizer
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 thanSyntax -> JS code
optimizations - hooks the optimizer into code gen
Working Ticket:
Related MRs:
- MR !10142 (closed)
- MR !10000
Left before ready:
-
squash with good commit message -
CI passes -
Cleanup and docs in GHC.JS.Optimizer
--- Post review
-
remove unsafe ops -
alter code gen to generate the right code ( For
instead ofWhile
,FuncStat
instead ofvar func..
) -
use CPS style
Edited by jeffrey young