Closed LightAndLight closed 5 years ago
Moving InlineEval
and InlineApply
to the top of the list would be a quick fix :)
It might help in some cases, but I think some more sophisticated method is needed to deal with mutual recursive functions. I've seen cases where some manual function cloning did help. It would worth to read the Secrets of the Glasgow Haskell Compiler inliner paper for some inspiration.
Changed in 4260c5ae565345dc1346bab16518d418e5a6baff
defaultOptimizations
looks like this:but if I make sure that
InlineEval
is run first:then my generated code improves. Urban's thesis says that inlining eval and apply are the first simplifications that need to be applied. Maybe this explains the behaviour?
Here is the relevant GRIN code:
"Inline Eval Late":
"Eval inline early":