[GHC] #14625: Casts get in the way of calculating unfolding discount

GHC ghc-devs at haskell.org
Tue Jan 2 11:39:09 UTC 2018


#14625: Casts get in the way of calculating unfolding discount
-------------------------------------+-------------------------------------
           Reporter:  mpickering     |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):  Phab:D4279     |         Wiki Page:
-------------------------------------+-------------------------------------
 The dictionary argument discount was not being applied for code such as
 rec_sel (dict_arg 'cast' cobox).

 For example, adding lots of type equality constraints increases the size
 of `foo` so that it will no longer be inlined into `foo1` (if
 specialisation is turned off).

 {{{

 {-# LANGUAGE GADTs #-}
 module Small where

 foo :: (Num a, a ~ b, a ~ b, a ~ b, a ~ b, a ~ b)  => a -> b
 foo x = x + x

 foo1 :: Int -> Int
 foo1 x = foo x
 }}}

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


More information about the ghc-tickets mailing list