[GHC] #8598: IO hack in demand analyzer gets in the way of CPR

GHC ghc-devs at haskell.org
Fri Dec 6 11:41:07 UTC 2013


#8598: IO hack in demand analyzer gets in the way of CPR
-------------------------------------+------------------------------------
        Reporter:  nomeata           |            Owner:
            Type:  task              |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.6.3
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by nomeata):

 A shower later I believe I have a quite decent solution:

 Currently, the CPR lattice has these elements:
 {{{
     NoCPR
    /     \
 ReProd  RetSum
    \     /
     BotCPR
 }}}

 where `BotCPR` not only tells us that there is not going to be a result,
 but also that the function is ''diverging'' (and hence puts a hyperstrict
 demand on free variables). For the hypothesised „clean exit of the IO
 function“ we need something in between:
 {{{
     NoCPR
    /     \
 ReProd  RetSum
    \     /
    ExitCPR
       |
    BotCPR
 }}}

 `ExitCPR` behaves like `BotCPR` when with regard to `lub`ing it with
 another result (i.e. whatever the other things knows about the result
 stays there), but has a `<L,A>` demand on free variables.

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


More information about the ghc-tickets mailing list