[GHC] #12370: Implement LetUp in DmdAnal (or document why we do not do it)

GHC ghc-devs at haskell.org
Wed Jul 6 21:16:00 UTC 2016


#12370: Implement LetUp in DmdAnal (or document why we do not do it)
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by nomeata):

 I have an implementation now, and I think it does what it should.
 Performance measurements, though, indicate no significant changes
 whatsoever:
 https://perf.haskell.org/ghc/#revision/04ded5e3c0bcc359f4b46958b5942b8230af1b28

 The programs get consistently smaller by 0.02%.

 The test suite goes through with the exception of a single test:
 {{{
 Actual stderr output differs from expected:
 --- ./simplCore/should_compile/spec-inline.run/spec-
 inline.stderr.normalised    2016-07-06 18:06:21.855289459 +0200
 +++ ./simplCore/should_compile/spec-inline.run/spec-
 inline.comp.stderr.normalised       2016-07-06 18:06:21.855289459 +0200
 @@ -43,7 +43,7 @@
  -- RHS size: {terms: 55, types: 9, coercions: 0}
  Roman.foo_$s$wgo [Occ=LoopBreaker]
    :: GHC.Prim.Int# -> GHC.Prim.Int# -> GHC.Prim.Int#
 -[GblId, Arity=2, Caf=NoCafRefs, Str=<L,U><S,U>]
 +[GblId, Arity=2, Caf=NoCafRefs, Str=<S,U><S,U>]
  Roman.foo_$s$wgo =
    / (sc :: GHC.Prim.Int#) (sc1 :: GHC.Prim.Int#) ->
      let {
 *** unexpected failure for spec-inline(optasm)
 }}}
 And this “better” signature does not matter, as the argument is unlifted
 anyways.

 I will separately measure if this increases the number of thunks
 determined to be one-shot. But even if it did, it does not matter much, as
 shown by nofib.

 The code change (changeset:04ded5e3c0bcc359f4b46958b5942b8230af1b28/ghc)
 is relatively small and brings it closer to the paper. Is it worth getting
 that in shape for master, or should we not bother?

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


More information about the ghc-tickets mailing list