is Unlifted Type == Primitive Type?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

is Unlifted Type == Primitive Type?

Csaba Hruska
Hello,

According to GHC Wiki it seems that only primitive types can be unlifted.
Is this true in general? (i.e. no user type can be unlifted)
image.png
Does the Stg to Cmm codegen support compilation for a variable of user defined ADT as unlifted?
i.e. some analysis proved that it is always a constructor and never a thunk.

Thanks,
Csaba


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: is Unlifted Type == Primitive Type?

Richard Eisenberg-5
The recent addition of -XUnliftedNewtypes means that user-defined newtypes (https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0098-unlifted-newtypes.rst) can indeed be unlifted and unboxed. There is also a proposal for more general unlifted data (https://github.com/ghc-proposals/ghc-proposals/pull/265).

If the wiki is out of date, do you think you could update it?

Thanks!
Richard

On Jan 20, 2020, at 9:45 AM, Csaba Hruska <[hidden email]> wrote:

Hello,

According to GHC Wiki it seems that only primitive types can be unlifted.
Is this true in general? (i.e. no user type can be unlifted)
<image.png>
Does the Stg to Cmm codegen support compilation for a variable of user defined ADT as unlifted?
i.e. some analysis proved that it is always a constructor and never a thunk.

Thanks,
Csaba

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: is Unlifted Type == Primitive Type?

Csaba Hruska
I'm also interested if Boxed Unlifted non Primitive types are supported by the codegen?
Sorry, but I'm not confident enough in the topic to update the wiki.


On Mon, Jan 20, 2020 at 10:58 AM Richard Eisenberg <[hidden email]> wrote:
The recent addition of -XUnliftedNewtypes means that user-defined newtypes (https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0098-unlifted-newtypes.rst) can indeed be unlifted and unboxed. There is also a proposal for more general unlifted data (https://github.com/ghc-proposals/ghc-proposals/pull/265).

If the wiki is out of date, do you think you could update it?

Thanks!
Richard

On Jan 20, 2020, at 9:45 AM, Csaba Hruska <[hidden email]> wrote:

Hello,

According to GHC Wiki it seems that only primitive types can be unlifted.
Is this true in general? (i.e. no user type can be unlifted)
<image.png>
Does the Stg to Cmm codegen support compilation for a variable of user defined ADT as unlifted?
i.e. some analysis proved that it is always a constructor and never a thunk.

Thanks,
Csaba

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: is Unlifted Type == Primitive Type?

Sebastian Graf
Hi Csaba,

Yes, boxed unlifted ADTs are supported by code-gen, or at least the fix for codegen to deal with it is [rather simple](https://gitlab.haskell.org/ghc/ghc/commit/fc4e2a03ebb40e2268ec0deb9833ec82bd2d7bee).

Hope that helps.
Sebastian

Am Mo., 20. Jan. 2020 um 11:13 Uhr schrieb Csaba Hruska <[hidden email]>:
I'm also interested if Boxed Unlifted non Primitive types are supported by the codegen?
Sorry, but I'm not confident enough in the topic to update the wiki.


On Mon, Jan 20, 2020 at 10:58 AM Richard Eisenberg <[hidden email]> wrote:
The recent addition of -XUnliftedNewtypes means that user-defined newtypes (https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0098-unlifted-newtypes.rst) can indeed be unlifted and unboxed. There is also a proposal for more general unlifted data (https://github.com/ghc-proposals/ghc-proposals/pull/265).

If the wiki is out of date, do you think you could update it?

Thanks!
Richard

On Jan 20, 2020, at 9:45 AM, Csaba Hruska <[hidden email]> wrote:

Hello,

According to GHC Wiki it seems that only primitive types can be unlifted.
Is this true in general? (i.e. no user type can be unlifted)
<image.png>
Does the Stg to Cmm codegen support compilation for a variable of user defined ADT as unlifted?
i.e. some analysis proved that it is always a constructor and never a thunk.

Thanks,
Csaba

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs