tweag / pirouette

Language-generic workbench for building static analysis
MIT License
47 stars 2 forks source link

Implement a more efficient version of `mapM expandDefs` #31

Closed VictorCMiraldo closed 3 years ago

VictorCMiraldo commented 3 years ago

In #24 , we reorganized the processDecls function into separate parts. Yet, we lost a good optimization of the older processDecls: it would inline definitions in a much smarter way. We would like to eventually implement that again as a whole-program transformation in Pirouette.Transformation.

The core idea is to start inlining functions in their dependency order, memoize the results, then use them for further inlinings. Look at the old processDecls linked above for inspiration.