[GHC] #6087: Join points need strictness analysis

GHC ghc-devs at haskell.org
Wed Feb 21 06:48:38 UTC 2018


#6087: Join points need strictness analysis
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  infoneeded
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  7.4.1
      Resolution:                    |             Keywords:  JoinPoints
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 We decided to put this on hold at the meeting. Just a small update: the
 case in comment:27 seems to be a limitation with the current demand
 analyser. It sometimes introduces reboxing that can't be eliminated by the
 simplifier. Example:

 {{{
 {-# NOINLINE check #-}
 check :: Int -> Bool
 check !n = True

 f_ :: Int -> Int
 f_ n = if check n then n else n * f_ (n - 1)
 }}}

 even after simplifications we rebox the argument:

 {{{
 Rec {
 -- RHS size: {terms: 17, types: 3, coercions: 0, joins: 0/0}
 $wf_
 $wf_
   = \ ww_s28U ->
       case check (I# ww_s28U) of {
         False ->
           case $wf_ (-# ww_s28U 1#) of ww1_s28Y { __DEFAULT ->
           *# ww_s28U ww1_s28Y
           };
         True -> ww_s28U
       }
 end Rec }
 }}}

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


More information about the ghc-tickets mailing list