[GHC] #10316: Move Typeable type-rep generation from use site to definition site

GHC ghc-devs at haskell.org
Thu Apr 16 21:07:37 UTC 2015


#10316: Move Typeable type-rep generation from use site to definition site
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:  7.12.1
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:  Phab:757
-------------------------------------+-------------------------------------
Changes (by simonpj):

 * differential:   => Phab:757


Comment:

 I tried to reduce the per-tycon overheads as far as possible.  For a data
 type
 {{{
 data Foo = Foo1 | Foo2
 }}}
 in module `M`, you get
 {{{
 $moduleM :: Module
 $moduleM = Module "mypackage-2.3"# "M"#

 $tcFoo :: TyCon
 $tcFoo = TyCon xxx yyy "Foo"# $moduleM

 $tcFoo1 :: TyCon
 $tcFoo1 = TyCon xxx yyy "Foo1"# $moduleM

 ..similarly Foo2...
 }}}
 That is, a sharted record for the module, plus a `TyCon` for each type
 constructor and data constructor.  All C strings, all static data, no
 thunks, no code.

 At the moment these definitions are injected at the beginning of the
 optimisation pipeline, but since they are so static they could equally
 well go at the end, and that woudl save fruitless attempts to optimise
 them.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10316#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list