How inline pragma works
Ömer Sinan Ağacan
omeragacan at gmail.com
Tue Nov 10 21:33:22 UTC 2015
I don't know the whole story, but here are some pointers to get you started:
- Internally, inlined code is called "unfolding". You can see the definition in
CoreSyn.
- CoreUnfold module has important functions to decide whether to inline or not.
- Actual work of replacing identifiers with their definitions is done in
Simplify and probably in some other places.
I believe if you start grepping for functions in CoreUnfold you can find all
the places that inlining is done. It may be just the simplifier, I'm not sure.
(see SimplUtils.preInlineUnconditionally and
SimplUtils.postInlineUnconditionally)
When you figure the details it'd be great if you could give us a hand in #10766
:)
2015-11-10 15:57 GMT-05:00 Эдгар Жаворонков <edzhavoronkov at gmail.com>:
> And can you tell me, where can i find a source code in GHC to see, how this
> pragma is handeled?
>
> ---
> С уважением,
> Жаворонков Эдгар
>
> Best regards,
> Edgar A. Zhavoronkov
>
> 2015-11-10 17:48 GMT+03:00 Ömer Sinan Ağacan <omeragacan at gmail.com>:
>>
>> There's this section in GHC user manual:
>>
>> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/pragmas.html#inline-noinline-pragma
>>
>> But see also: https://ghc.haskell.org/trac/ghc/ticket/10766
>>
>> 2015-11-10 5:16 GMT-05:00 Эдгар Жаворонков <edzhavoronkov at gmail.com>:
>> > Hello everyone!
>> >
>> > Where can i read about how does INLINE pragma in compiler works?
>> >
>> >
>> > ---
>> > С уважением,
>> > Жаворонков Эдгар
>> >
>> > Best regards,
>> > Edgar A. Zhavoronkov
>> >
>> > _______________________________________________
>> > ghc-devs mailing list
>> > ghc-devs at haskell.org
>> > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>> >
>
>
More information about the ghc-devs
mailing list