Stealing ideas from the latest GCC release

Simon Peyton-Jones simonpj at microsoft.com
Fri Mar 23 09:07:48 CET 2012


Good for JHC!  Indeed; see http://hackage.haskell.org/trac/ghc/ticket/5059

There are two big questions:
* When to specialise (a supercompiler specialises on everything)
* How to make sure that the arguments are not inlined too early (see the ticket)

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org [mailto:glasgow-haskell-
| users-bounces at 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 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 #-}
| (I think this is the current syntax, I changed it a couple times in jhc's
| history)
| 
| will create a
| 
| foo_True :: Int
| foo_True = inline foo True
| 
| and a
| 
| {-# RULE foo True = foo_True #-}
| 
|    John
| 
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users





More information about the Glasgow-haskell-users mailing list