pure-c / purec

C backend for PureScript
232 stars 8 forks source link

Inline common values #24

Closed felixSchl closed 5 years ago

felixSchl commented 5 years ago

Implement something akin to:

https://github.com/purescript/purescript/blob/a8e0911222f46411776978a13866eb097175162c/src/Language/PureScript/CoreImp/Optimizer/Inliner.hs#L83-L107

We could further modify the AST to unbox values based on the operation being taken (thus erasing the intermediate purs_any_t altogether for e.g. addition etc.).

felixSchl commented 5 years ago

The issue was mistitled and was referring to the inlineCommonValues pass, which has been implemented, thus closing. Opening a new issue dedicated to inlineCommonOperators which is a bit more involved.