| I'm confused. GHC of course unboxes strict fields of primitive data types.
|
| {-# OPTIONS -O2 -fvia-C -optc-O2 -funbox-strict-fields #-}
|
| ... but only when you give -funbox-strict-fields, as there, or UNPACK.
| The point is that it never loses sharing to unbox a strict Int field
|
Simon Peyton-Jones wrote:
| [1] I'm not sure if this is true... if it has to rebox the Int, you get
| another copy floating around, not the original, right?
Correct. If you have
data T = MkT {-# UNPACK #-} !Int
then given
case x of { MkT y - h y }
then GHC must re-box the 'y'
Hello Andrew,
Tuesday, May 20, 2008, 11:05:52 PM, you wrote:
-funbox-strict-fields.
I did try that, but it didn't seem to make any difference for me. [Maybe
it may be that ghc just not recompiled program when you supplied this
switch. as i wrote, this switch by itself made your original
bulat.ziganshin:
Hello Andrew,
Tuesday, May 20, 2008, 11:05:52 PM, you wrote:
-funbox-strict-fields.
I did try that, but it didn't seem to make any difference for me. [Maybe
it may be that ghc just not recompiled program when you supplied this
switch. as i wrote, this switch
isaacdupree:
Don Stewart wrote:
I'm confused. GHC of course unboxes strict fields of
primitive data types.
{-# OPTIONS -O2 -fvia-C -optc-O2 -funbox-strict-fields
#-}
... but only when you give -funbox-strict-fields, as there,
or UNPACK. The point is that it never loses