RE: [Haskell-cafe] Re: MD5 performance optimizations, and GHC -via-C producing segfaulting binary

2008-05-22 Thread Simon Peyton-Jones
| 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 |

Re: [Haskell-cafe] Re: MD5 performance optimizations, and GHC -via-C producing segfaulting binary

2008-05-22 Thread Isaac Dupree
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'

Re: [Haskell-cafe] Re: MD5 performance optimizations, and GHC -via-C producing segfaulting binary

2008-05-20 Thread 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 by itself made your original

Re: [Haskell-cafe] Re: MD5 performance optimizations, and GHC -via-C producing segfaulting binary

2008-05-20 Thread Don Stewart
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

Re: [Haskell-cafe] Re: MD5 performance optimizations, and GHC -via-C producing segfaulting binary

2008-05-20 Thread Don Stewart
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