RE: Stealing ideas from the latest GCC release

2012-03-23 Thread Simon Peyton-Jones
: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell- | users-boun...@haskell.org] On Behalf Of John Meacham | Sent: 22 March 2012 23:16 | To: Johan Tibell | Cc: glasgow-haskell-users | Subject: Re: Stealing ideas from the latest GCC release | | I support a form of this in jhc

Re: Stealing ideas from the latest GCC release

2012-03-23 Thread wren ng thornton
On 3/22/12 5:09 PM, Johan Tibell wrote: It'd be nice if we could get foo to specialize on its input arguments, without having to mark all of fooWith as INLINE. +1 million. I don't recall how many times I've wanted this optimization, even if it has to be specified manually. Unfortunately, I

Stealing ideas from the latest GCC release

2012-03-22 Thread Johan Tibell
Hi all, While looking at the GCC 4.7 [1] release notes I saw something that's perhaps worth stealing. Taken from the release notes: The inter-procedural constant propagation pass has been rewritten. It now performs generic function specialization. For example when compiling the

Re: Stealing ideas from the latest GCC release

2012-03-22 Thread Jan-Willem Maessen
On Thu, Mar 22, 2012 at 5:09 PM, Johan Tibell johan.tib...@gmail.comwrote: Hi all, While looking at the GCC 4.7 [1] release notes I saw something that's perhaps worth stealing. Taken from the release notes: The inter-procedural constant propagation pass has been rewritten. It now

Re: Stealing ideas from the latest GCC release

2012-03-22 Thread John Meacham
I support a form of this in jhc by allowing specialization of values, not just types. It is actually the same mechanism as type specialization since that is just value specialization where the value being specialized on is the type parameter. foo :: Bool - Int {-# SPECIALIZE foo True :: Int #-}

Re: Stealing ideas from the latest GCC release

2012-03-22 Thread Johan Tibell
On Thu, Mar 22, 2012 at 3:52 PM, Jan-Willem Maessen jmaes...@alum.mit.edu wrote: Wait, I thought this is essentially what constructor specialization does?  I suppose we might then keep around the old body.  Or will these behave differently in the presence of, say, different constant Int