Ranjit Jhala | 28 Jul 07:04 2012

Simplifying Core using GHC API

Hi all,


can anyone point me to the GHC API functions that I can use to trigger the 
various inlining simplifications? (i.e. to get the inlined CoreExprs that one 
gets with the -ddump-simpl flag?)

Many thanks in advance!,

Ranjit Jhala.

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Ranjit Jhala | 28 Jul 07:06 2012

Re: Simplifying Core using GHC API

ps: I should add I already know how to get from source to CoreExpr e.g. by:


       mod_guts <- coreModule `fmap` (desugarModuleWithLoc =<< typecheckModule =<< parseModule modSummary)

Its the simplification, in particular, inlining steps that I'm after. Thanks! Ranjit.

On Fri, Jul 27, 2012 at 10:04 PM, Ranjit Jhala <jhala <at> cs.ucsd.edu> wrote:
Hi all,

can anyone point me to the GHC API functions that I can use to trigger the 
various inlining simplifications? (i.e. to get the inlined CoreExprs that one 
gets with the -ddump-simpl flag?)

Many thanks in advance!,

Ranjit Jhala.


_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Simon Marlow | 30 Jul 12:22 2012
Picon

Re: Simplifying Core using GHC API

You can use compileToCoreSimplified to get the optimised Core for the 
module, although that includes the other steps.  We ought to have a 
separate API to go from ModGuts to CoreModule, but currently that 
doesn't exist (it's built into compileToCoreSimplified).

Cheers,
	Simon

On 28/07/2012 06:06, Ranjit Jhala wrote:
> ps: I should add I already know how to get from source to CoreExpr e.g. by:
>
>         mod_guts <- coreModule `fmap` (desugarModuleWithLoc =<<
> typecheckModule =<< parseModule modSummary)
>
> Its the simplification, in particular, inlining steps that I'm after.
> Thanks! Ranjit.
>
> On Fri, Jul 27, 2012 at 10:04 PM, Ranjit Jhala <jhala <at> cs.ucsd.edu
> <mailto:jhala <at> cs.ucsd.edu>> wrote:
>
>     Hi all,
>
>     can anyone point me to the GHC API functions that I can use to
>     trigger the
>     various inlining simplifications? (i.e. to get the inlined CoreExprs
>     that one
>     gets with the -ddump-simpl flag?)
>
>     Many thanks in advance!,
>
>     Ranjit Jhala.
>
>
>
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users <at> haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>

Gmane