[GHC] #15226: GHC doesn't know that seq# produces something in WHNF

GHC ghc-devs at haskell.org
Wed Jun 6 21:35:43 UTC 2018


#15226: GHC doesn't know that seq# produces something in WHNF
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  (none)
            Type:  bug               |               Status:  merge
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4796
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 Replying to [comment:7 simonpj]:
 > > We should (I believe) rewrite
 >
 > Yes -- this is a variant of the case binder-swap in `OccurAnal`.  See
 `Note [Binder swap]` in `OccurAnal`.  This is the place to do it.

 I eventually found that, but I'm not at all sure how to deal with
 coercions in that context. We could, for example, have something like

 {{{#!hs
 case seq# x a `cast` ... of
   (# s', x' #) -> ...
 }}}

 in which case we have to work out how to rejigger all the coercions. I
 don't know enough about that machinery yet. In the current `OccurAnal`
 code, the coercion in the scrutinee is always on a variable, but here it's
 on a pair containing the variable, so I'm not going to be able to code
 monkey it.

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


More information about the ghc-tickets mailing list