[GHC] #13339: Arbitrarily large expressions built out of cheap primops are not floated out

GHC ghc-devs at haskell.org
Sat Feb 25 18:59:57 UTC 2017


#13339: Arbitrarily large expressions built out of cheap primops are not floated
out
-------------------------------------+-------------------------------------
           Reporter:  rwbarton       |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 While investigating #13338 I was tripped up by the fact that GHC won't
 float out even a large expression like the product in
 {{{#!hs
 \i# -> magic# (x# *# 2# *# 2# *# 2# *# 2# *# 2# *# 2# *# 2# *# 2# -# i#)
 }}}
 The test involved here is `exprIsCheap`. The fact that `*#` is a cheap
 primop makes `exprIsCheap` think the whole expression is cheap; but
 clearly there must come some point where it would be better to float out
 the expression.

 Perhaps `exprIsCheap` should work more like `exprIsDupable`, and take the
 size of the expression into account. See related comments on
 `primOpIsCheap`, though this ticket is about saving runtime work, not code
 size.

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


More information about the ghc-tickets mailing list