#2463: unsafePerformIO in unused record field affects optimisations
-----------------------------------------+----------------------------------
    Reporter:  claus                     |        Owner:         
        Type:  run-time performance bug  |       Status:  closed 
    Priority:  normal                    |    Milestone:         
   Component:  Compiler                  |      Version:  6.9    
    Severity:  normal                    |   Resolution:  invalid
    Keywords:                            |     Testcase:         
Architecture:  Unknown                   |           Os:  Unknown
-----------------------------------------+----------------------------------
Changes (by claus):

  * status:  new => closed
  * resolution:  => invalid

Comment:

 Going through the output of `-ddump-simpl`, it appears that just
 mentioning `unsafePerformIO` in the slow version instead of `undefined` in
 the fast version is sufficient to prevent a worker/wrapper split for
 `mkQ`.

 Adding an `{-# INLINE mkQ #-}` pragma makes the "slow" version as fast as
 the "fast" one. GHC can't really see that the record field is unused, but
 it can see that `undefined` is a lot smaller than anything else, so this
 is probably not a bug, just unexpected behaviour (I used `undefined` as a
 placeholder, not as a blackhole that would swallow its context; will have
 to use something else next time;-).

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2463#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to