[commit: ghc] master: StgLint overhaul (7f389a5)

git at git.haskell.org git at git.haskell.org
Sun Feb 18 17:00:33 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/7f389a580f42a105623853adad15ab3323b41ed5/ghc

>---------------------------------------------------------------

commit 7f389a580f42a105623853adad15ab3323b41ed5
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Sun Feb 18 11:12:53 2018 -0500

    StgLint overhaul
    
    - Remove all type checks
    - Check two STG invariants (no unboxed let bindings, variables defined
      before used) and post-unarisation invariants.
    
    See the module header and #14787.
    
    This version validates with `-dstg-lint` added to `GhcStage2HcOpts` and
    `GhcLibHcOpts` and `EXTRA_HC_OPTS`.
    
    Unarise changes:
    
    - `unariseConArgBinder` and `unariseFunArgBinder` functions were almost
      the same; only difference was when unarising fun args we keep void
      args while in con args we drop them. A new function `unariseArgBinder`
      added with a `Bool` argument for whether we're unarising a con arg.
      `unariseConArgBinder` and `unariseFunArgBinder` are now defined as
    
          unariseConArgBinder = unarsieArgBinder True  -- data con
          unariseFunArgBinder = unariseArgBinder False -- not data con
    
    - A bug in `unariseConArgBinder` and `unariseFunArgBinder` (which are
      just calls to `unariseArgBinder` now) that invalidated the
      post-unarise invariants when the argument has single type rep (i.e.
      `length (typePrimRep x) == 1`) fixed. This isn't a correctness issue
      (it's fine not to unarise if a variable is already represented as
      single value), but it triggers StgLint.
    
    Test Plan:
    - Pass testsuite with `-dstg-lint` [done]
    - Boot stage2 (including libraries) with `-dstg-lint` [done]
    
    Reviewers: simonpj, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: duog, rwbarton, thomie, carter
    
    GHC Trac Issues: #14787
    
    Differential Revision: https://phabricator.haskell.org/D4404


>---------------------------------------------------------------

7f389a580f42a105623853adad15ab3323b41ed5
 compiler/simplStg/SimplStg.hs   |  12 +-
 compiler/simplStg/UnariseStg.hs |  60 ++++--
 compiler/stgSyn/StgLint.hs      | 459 +++++++++++++---------------------------
 compiler/stgSyn/StgSyn.hs       |   1 +
 docs/users_guide/debugging.rst  |   2 +-
 5 files changed, 196 insertions(+), 338 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 7f389a580f42a105623853adad15ab3323b41ed5


More information about the ghc-commits mailing list