Draft: use slots smaller than word as tag for smaller unboxed sums
Saves some space, especially when storing a bunch of unpacked enums.
To clarify: This is beneficial for unboxed sums being used to {-# UNPACK #-}
things into heap objects. This MR doesn't change the calling convention when passing/returning unboxed tuples/sums with smaller-than-word fields.
Merge request reports
Activity
added full-ci label
If we're dealing with a single sum we can reorder fields by hand for optimal packing in the source code.
But I'd like the compiler to optimize data layout with multiple or nested
{-# UNPACK #-}
, where we don't have (or want) as much control over ordering.Edited by Luite StegemanPerhaps if we start to do packing we may want to distinguish between unboxed sums that are passed around directly in registers and unboxed sums that are stored inside heap object (
{-# UNPACK #-}
or otherwise)Edited by Luite Stegeman