Permalink
Switch branches/tags
Commits on Jun 23, 2017
  1. Hoopl: remove dependency on Hoopl package

    This copies the subset of Hoopl's functionality needed by GHC to
    `cmm/Hoopl` and removes the dependency on the Hoopl package.
    
    The main motivation for this change is the confusing/noisy interface
    between GHC and Hoopl:
    - Hoopl has `Label` which is GHC's `BlockId` but different than
      GHC's `CLabel`
    - Hoopl has `Unique` which is different than GHC's `Unique`
    - Hoopl has `Unique{Map,Set}` which are different than GHC's
      `Uniq{FM,Set}`
    - GHC has its own specialized copy of `Dataflow`, so `cmm/Hoopl` is
      needed just to filter the exposed functions (filter out some of the
      Hoopl's and add the GHC ones)
    With this change, we'll be able to simplify this significantly.
    It'll also be much easier to do invasive changes (Hoopl is a public
    package on Hackage with users that depend on the current behavior)
    
    This should introduce no changes in functionality - it merely
    copies the relevant code.
    
    Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
    
    Test Plan: ./validate
    
    Reviewers: austin, bgamari, simonmar
    
    Reviewed By: bgamari, simonmar
    
    Subscribers: simonpj, kavon, rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3616
    michalt committed with bgamari Jun 23, 2017
  2. Use actual universal tvs in check for naughty record selectors

    The naughty record selector check means to limit selectors which would
    lead to existential tyvars escaping their scope. With record pattern
    synonyms, there are situations where universal tyvars don't appear in
    the result type, for example:
    
    ```
    pattern ReadP :: Read a => a -> String
    pattern ReadP{readp} <- (read -> readp)
    ```
    
    This is a similar issue to #11224 where we assumed that we can decide
    which variables are universal and which are existential by the syntactic
    check of seeing which appear in the result type. The fix is to use
    `univ_tvs` from `conLikeFullSig` rather than the previous approximation.
    But we must also remember to apply `EqSpec`s so we use the free
    variables from `inst_tys` which is precisely `univ_tvs` with `EqSpecs`
    applied.
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3649
    mpickering committed with bgamari Jun 23, 2017
  3. Fix pretty-printing of zero-argument lambda expressions

    Using Template Haskell, one can construct lambda expressions with no
    arguments. The pretty-printer isn't aware of this fact, however. This
    changes that.
    
    Test Plan: make test TEST=T13856
    
    Reviewers: bgamari, austin, goldfire
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #13856
    
    Differential Revision: https://phabricator.haskell.org/D3664
    RyanGlScott committed with bgamari Jun 23, 2017
  4. Add fixity declaration for Data.List.NonEmpty.!!

    We have `infixl 9 !!` for `Data.List.!!`, but not for
    `Data.List.NonEmpty.!!`. We ought to.
    
    Test Plan: Read it
    
    Reviewers: bgamari, austin, hvr
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3666
    RyanGlScott committed with bgamari Jun 23, 2017
  5. testsuite: Fix cabal01 test

    The other-modules field listed things that weren't in fact modules,
    causing this test to fail. See Cabal #4567.
    
    Test Plan: Validate
    
    Reviewers: hvr, austin
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3665
    bgamari committed with bgamari Jun 23, 2017
  6. compiler: Eliminate pprTrace in SPT entry addition codepath

    Test Plan: Load program with StaticPointers into GHCi, ensure no
    tracing output makes it in.
    
    Reviewers: austin
    
    Subscribers: rwbarton, thomie, RyanGlScott
    
    GHC Trac Issues: #12356
    
    Differential Revision: https://phabricator.haskell.org/D3663
    bgamari committed with bgamari Jun 23, 2017
Commits on Jun 22, 2017
  1. UNREG: use __builtin___clear_cache where available

    Noticed when was building UNREG ghc with -optc{-Wall,-Werror}:
    
      rts/sm/Storage.c:1359:3: error:
         error: implicit declaration of function '__clear_cache'
           [-Werror=implicit-function-declaration]
           __clear_cache((void*)begin, (void*)end);
           ^~~~~~~~~~~~~
           |
      1359 |   __clear_cache((void*)begin, (void*)end);
           |   ^
    
    Left direct '__clear_cache' usage gcc toolchain before 4.4.
    
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
    trofi committed Jun 21, 2017
  2. Fix typo

    5outh committed Jun 22, 2017
Commits on Jun 21, 2017
  1. Revert "rts: Suppress unused gcc_clear_cache warning"

    This reverts commit d1d3e98.
    bgamari committed Jun 21, 2017
  2. Revert "UNREG: use __builtin___clear_cache where available"

    This reverts commit 6dd1257.
    
    Change fails vaildation:
      rts/sm/Storage.c:1351:20: error:
         error: ‘gcc_clear_cache’ defined but not used [-Werror=unused-function]
         STATIC_INLINE void gcc_clear_cache(void * begin, void * end)
    trofi committed Jun 21, 2017
  3. change filtering of variables in extract_hs_tv_bndrs (fixes #13782)

    Reviewers: austin, bgamari, goldfire
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #13782
    
    Differential Revision: https://phabricator.haskell.org/D3641
    carlostome committed with bgamari Jun 20, 2017
  4. Show only the number of modules in ghci

    Reviewers: bgamari, austin, simonmar
    
    Reviewed By: bgamari
    
    Subscribers: mpickering, rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3651
    bitonic committed with bgamari Jun 20, 2017
  5. base: Export Fingerprint accessors from Type.Reflection.Unsafe

    Reviewers: dfeuer, austin, hvr
    
    Reviewed By: dfeuer
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3660
    bgamari committed with bgamari Jun 20, 2017
  6. UNREG: use __builtin___clear_cache where available

    Noticed when was building UNREG ghc with -optc{-Wall,-Werror}:
    
      rts/sm/Storage.c:1359:3: error:
         error: implicit declaration of function '__clear_cache'
           [-Werror=implicit-function-declaration]
           __clear_cache((void*)begin, (void*)end);
           ^~~~~~~~~~~~~
           |
      1359 |   __clear_cache((void*)begin, (void*)end);
           |   ^
    
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
    trofi committed Jun 21, 2017
Commits on Jun 20, 2017
  1. Fix note reference [ci skip]

    ggreif committed Jun 20, 2017
Commits on Jun 19, 2017
  1. Improve comments on AbsBinds

    See Trac #13827.
    simonpj committed Jun 19, 2017
  2. cmm/CmmLayoutStack: avoid generating unnecessary reloads

    This tries to be more precise when generating reloads of local
    registers in proc points. Previously we'd reload all local registers
    that were live. But we used liveness information that assumed local
    registers survive native calls. For the purpose of reloading registers
    this is an overapproximation and might lead to generating huge amounts
    of unnecessary reloads (in case there's another proc point before the
    register is used).
    
    This change takes the approach of moving the generation of reloads to
    a second pass over the Cmm, which allows to recompute the liveness and
    can use the knowledge that local registers do *not* survive calls.
    This leads to generating only useful reloads. For an extreme example
    where this helps a lot please see T3294. This should also fix #7198
    
    Finally, this re-introduces the code to do Cmm rewriting using in
    `Dataflow` module (with the difference that we know operate on a whole
    block at a time).
    
    Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
    
    Reviewers: austin, bgamari, simonmar
    
    Reviewed By: simonmar
    
    Subscribers: kavon, rwbarton, thomie
    
    GHC Trac Issues: #7198
    
    Differential Revision: https://phabricator.haskell.org/D3586
    michalt committed with bgamari Jun 18, 2017
  3. configure: Look for objdump on OpenBSD and AIX

    deriveConstants requires objdump for both of these operating systems, in
    addition to Windows. See #13812.
    
    Test Plan: Validate on OpenBSD and AIX
    
    Reviewers: hvr, austin
    
    Reviewed By: hvr
    
    Subscribers: rwbarton, thomie, erikd
    
    GHC Trac Issues: #13812
    
    Differential Revision: https://phabricator.haskell.org/D3638
    bgamari committed with bgamari Jun 18, 2017
  4. Add test cases for #13821

    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #13821
    
    Differential Revision: https://phabricator.haskell.org/D3642
    duog committed with bgamari Jun 18, 2017
  5. Don't expose fingerprints from Type.Reflection

    The `Fingerprint` type is not exported from any "public"
    module. It therefore seems quite strange that `Type.Reflection`
    exports functions for extracting fingerprints. Remove those
    exports. If fingerprints are eventually considered public,
    this can be reconsidered.
    
    Reviewers: austin, hvr, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3643
    treeowl committed with bgamari Jun 18, 2017
  6. Fix GCC 7 warning in the RTS

    Test Plan: validate
    
    Reviewers: austin, bgamari, erikd, simonmar
    
    Reviewed By: bgamari, simonmar
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3648
    hsyl20 committed with bgamari Jun 18, 2017
  7. Add T9630

    This is not the most precise test, unfortunately, but it does
    demonstrate a modest improvement in compiler residency as a
    result of the specializer don't-loop patch. A rather less
    realistic variation on this has somewhat more dramatic effects.
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3656
    treeowl committed with bgamari Jun 18, 2017
  8. Add fixity declaration for :~~:

    We have one for `(:~:)`, but not for `(:~~:)`! Let's fix this
    oversight.
    
    Reviewers: bgamari, austin, hvr
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3657
    RyanGlScott committed with bgamari Jun 18, 2017
  9. testsuite: Add testcase for #13822

    Reviewers: austin
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #13822
    
    Differential Revision: https://phabricator.haskell.org/D3655
    bgamari committed with bgamari Jun 18, 2017
Commits on Jun 18, 2017
  1. rts: Ensure that new capability count is > 0

    The Haskell wrapper already checks this but we should also check it in the RTS
    to catch non-Haskell callers. See #13832.
    bgamari committed Jun 16, 2017
  2. Look through type synonyms in existential contexts when deriving Functor

    Summary:
    This amounts to using `exactTyCoVarsOfType` instead of
    `tyCoVarsOfType` in the right place. I also fixed a similar issue for
    `-XDatatypeContexts` while I was in town (but couldn't be bothered to add a
    test for it).
    
    Test Plan: make test TEST=T13813
    
    Reviewers: austin, bgamari, simonpj
    
    Reviewed By: simonpj
    
    Subscribers: simonpj, rwbarton, thomie
    
    GHC Trac Issues: #13813
    
    Differential Revision: https://phabricator.haskell.org/D3635
    RyanGlScott committed Jun 18, 2017
  3. Fix out-of-date comments in TyCoRep

    s/tyVarsOfType/tyCoFVsOfType/g
    RyanGlScott committed Jun 18, 2017
Commits on Jun 17, 2017
  1. Remove the Windows GCC driver.

    Summary:
    This patch drops the GCC driver and instead moves
    the only remaining path that we need to keep for
    backwards compatibility to the settings file.
    
    It also generalizes the code that expands `$TopDir`
    so it can expand it within any location in the string
    and also changes it so `$TopDir` is expanded only
    after the words call because `$TopDir` can contains
    spaces which would be horribly broken.
    
    Test Plan: ./validate
    
    Reviewers: austin, hvr, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, erikd
    
    GHC Trac Issues: #13709
    
    Differential Revision: https://phabricator.haskell.org/D3592
    Mistuke committed Jun 17, 2017
Commits on Jun 16, 2017
  1. Provide way to build using existing C compiler on Windows.

    Summary:
    There are various distros that build GHC using their own C compilers
    such as MSYS2. Currently they have to patch the build scripts everytime.
    
    This patch provides the configure argument `--enable-distro-toolchain`
    which allows one to build using any C compiler on the path.
    
    This is also useful for testing new versions of GCC.
    
    Test Plan:
    ./configure --enable-distro-toolchain && make - && make THREADS=9 test
    ./validate
    
    Reviewers: austin, hvr, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, erikd, #ghc_windows_task_force
    
    GHC Trac Issues: #13792
    
    Differential Revision: https://phabricator.haskell.org/D3637
    Mistuke committed Jun 11, 2017
  2. Fix the treatment of 'closed' definitions

    The IdBindingInfo field of ATcId serves two purposes
    
    - to control generalisation when we have -XMonoLocalBinds
    - to check for floatability when dealing with (static e)
    
    These are related, but not the same, and they'd becomme confused.
    Trac #13804 showed this up via an example like this:
    
      f periph = let sr :: forall a. [a] -> [a]
                     sr = if periph then reverse else id
    
                     sr2 = sr
                     -- The question: is sr2 generalised?
                     -- It should be, because sr has a type sig
                     -- even though it has periph free
                 in
                 (sr2 [True], sr2 "c")
    
    Here sr2 should be generalised, despite the free var 'periph'
    in 'sr' because 'sr' has a closed type signature.
    
    I documented all this very carefully this time, in TcRnTypes:
      Note [Meaning of IdBindingInfo]
      Note [Bindings with closed types: ClosedTypeId]
    simonpj committed Jun 16, 2017