[GHC] #11710: Fusion of a simple listArray call is very fragile

GHC ghc-devs at haskell.org
Tue Mar 15 11:54:20 UTC 2016


#11710: Fusion of a simple listArray call is very fragile
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.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):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 And here's a quick quiz for those playing along at home:

 How much unrolling would you expect to happen in this case?
 {{{#!hs
 arr :: Array Int Int
 arr = listArray (0,10) [ 1,1,1,-1,1,1,1,1,1,1 ]
 }}}

 **Answer**: The first four elements will be unrolled; the remaining will
 be constructed by recursive pattern matching against a CAF `[Int]`

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


More information about the ghc-tickets mailing list