[commit: ghc] master: Create a deterministic version of tyVarsOfType (2325bd4)

git at git.haskell.org git at git.haskell.org
Sat Nov 21 16:15:48 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2325bd4e0fad0e5872556c5a78d1a6a1873e7201/ghc

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

commit 2325bd4e0fad0e5872556c5a78d1a6a1873e7201
Author: Bartosz Nitka <niteria at gmail.com>
Date:   Sat Nov 21 15:57:09 2015 +0100

    Create a deterministic version of tyVarsOfType
    
    I've run into situations where I need deterministic `tyVarsOfType` and
    this implementation achieves that and also brings an algorithmic
    improvement.  Union of two `VarSet`s takes linear time the size of the
    sets and in the worst case we can have `n` unions of sets of sizes
    `(n-1, 1), (n-2, 1)...` making it quadratic.
    
    One reason why we need deterministic `tyVarsOfType` is in `abstractVars`
    in `SetLevels`. When we abstract type variables when floating we want
    them to be abstracted in deterministic order.
    
    Test Plan: harbormaster
    
    Reviewers: simonpj, goldfire, austin, hvr, simonmar, bgamari
    
    Reviewed By: simonmar
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1468
    
    GHC Trac Issues: #4012


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

2325bd4e0fad0e5872556c5a78d1a6a1873e7201
 compiler/basicTypes/IdInfo.hs                      |   6 +-
 compiler/coreSyn/CoreFVs.hs                        | 248 ++++++++++++---------
 compiler/coreSyn/CoreSeq.hs                        |   4 +-
 compiler/coreSyn/CoreSubst.hs                      |  17 +-
 compiler/deSugar/DsCCall.hs                        |   3 +-
 compiler/deSugar/DsExpr.hs                         |   2 +-
 compiler/ghc.cabal.in                              |   1 +
 compiler/ghc.mk                                    |   1 +
 compiler/ghci/ByteCodeGen.hs                       |  50 ++---
 compiler/ghci/ByteCodeInstr.hs                     |   2 +-
 compiler/ghci/RtClosureInspect.hs                  |   2 +-
 compiler/simplCore/FloatIn.hs                      |  33 +--
 compiler/simplCore/SetLevels.hs                    |  36 +--
 compiler/specialise/Rules.hs                       |   8 +-
 compiler/typecheck/TcDeriv.hs                      |   2 +-
 compiler/typecheck/TcErrors.hs                     |   4 +-
 compiler/typecheck/TcHsType.hs                     |   2 +-
 compiler/typecheck/TcType.hs                       |   1 +
 compiler/types/Coercion.hs                         |  53 +++--
 compiler/types/TypeRep.hs                          |  47 +++-
 compiler/types/Unify.hs                            |   2 +-
 compiler/utils/FV.hs                               |  87 ++++++++
 compiler/vectorise/Vectorise/Exp.hs                |  26 ++-
 .../partial-sigs/should_compile/T10403.stderr      |  12 +-
 .../partial-sigs/should_fail/Trac10045.stderr      |   6 +-
 testsuite/tests/perf/should_run/T10359             | Bin 0 -> 2506523 bytes
 testsuite/tests/polykinds/T9222.stderr             |   8 +-
 27 files changed, 421 insertions(+), 242 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 2325bd4e0fad0e5872556c5a78d1a6a1873e7201


More information about the ghc-commits mailing list