[GHC] #11731: Simplifier: Inlining trivial let can lose sharing

GHC ghc-devs at haskell.org
Thu Mar 31 08:47:33 UTC 2016


#11731: Simplifier: Inlining trivial let can lose sharing
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:
            Type:  bug               |               Status:  patch
        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):  Phab:D2064
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Let's be careful to distinguish three kinds of `IdInfo`, all pinned on an
 `Id`:

 * `demandInfo`: says how the `Id` is used (demanded) by its scope.
 * `strictnessInfo`: describes the demand transformer for the `Id`; it
 tnansforms a demand on the `Id` to a demand on its arguments and free
 variables.
 * `oneShotInfo`: for lambda-bound `Id`s only, says whether the function is
 called at most once.  (It says nothing about how the `Id` is used in the
 body of the lambda.)

 I think we have decided (#11770) that
 * only the demand analyser sets `demandInfo` and `strictnessInfo`
 * only the occurrence analyser sets `oneShotInfo`.

 The `demandInfo` on an `Id` includes `1*` usage info, which is fragile so
 perhaps we should erase it.

 The `strictnessInfo` on an `Id` also contains `1*` usage info, e.g about
 the function arguments.  That too is fragile to transformations of the
 function body, so perhaps we should erase it too.

 I've just realised that a convenient place to erase it might be the
 worker/wrapper pass.  So then we'd have

 * the demand analyser sets `demandInfo` and `strictnessInfo`
 * the worker-wrapper pass erases 1* info from `demandInfo` and
 `strictnessInfo`
 * the occurrence analyser sets `oneShotInfo`

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


More information about the ghc-tickets mailing list