[GHC] #10148: Optimization causes repeated computation

GHC ghc-devs at haskell.org
Mon Mar 9 21:45:27 UTC 2015


#10148: Optimization causes repeated computation
-------------------------------------+-------------------------------------
        Reporter:  akio              |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1-rc1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by akio):

 Thank you for looking at this!

 Replying to [comment:1 nomeata]:
 > Here is a cue: Removing the `!` on `t` in `mkMachine` removes *all*
 trace output. So it seems that (possibly as a result of minimizing the
 code), `t` and hence `array_adjust` is not actually used. This (function
 strict in an argument, but argument is unused) might make GHC be a bit too
 liberal in what it does with the code.

 Yes, this is indeed a result of minimizing the code. I'll attach a version
 of the test program that does not rely solely on the bangs. In this
 version, if I remove the bangs in `mkMachine` (on both `m` and `t`), the
 amount of trace output grows exponentially (not quadratically) when
 compiled with `-O1`.

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


More information about the ghc-tickets mailing list