1. 25 Nov, 2016 5 commits
    • Simon Peyton Jones's avatar
      Another major constraint-solver refactoring · 1eec1f21
      Simon Peyton Jones authored
      This patch takes further my refactoring of the constraint
      solver, which I've been doing over the last couple of months
      in consultation with Richard.
      
      It fixes a number of tricky bugs that made the constraint
      solver actually go into a loop, including
      
        Trac #12526
        Trac #12444
        Trac #12538
      
      The main changes are these
      
      * Flatten unification variables (fmvs/fuvs) appear on the LHS
        of a tvar/tyvar equality; thus
                 fmv ~ alpha
        and not
                 alpha ~ fmv
      
        See Note [Put flatten unification variables on the left]
        in TcUnify.  This is implemented by TcUnify.swapOverTyVars.
      
      * Don't reduce a "loopy" CFunEqCan where the fsk appears on
        the LHS:
            F t1 .. tn ~ fsk
        where 'fsk' is free in t1..tn.
        See Note [FunEq occurs-check principle] in TcInteract
      
        This neatly stops some infinite loops that people reported;
        and it allows us to delete some crufty code in reduce_top_fun_eq.
        And it appears to be no loss whatsoever.
      
        As well as fixing loops, ContextStack2 and T5837 both terminate
        when they didn't before.
      
      * Previously we generated "derived shadow" constraints from
        Wanteds, but we could (and sometimes did; Trac #xxxx) repeatedly
        generate a derived shadow from the same Wanted.
      
        A big change in this patch is to have two kinds of Wanteds:
           [WD] behaves like a pair of a Wanted and a Derived
           [W]  behaves like a Wanted only
        See CtFlavour and ShadowInfo in TcRnTypes, and the ctev_nosh
        field of a Wanted.
      
        This turned out to be a lot simpler.  A [WD] gets split into a
        [W] and a [D] in TcSMonad.maybeEmitShaodow.
      
        See TcSMonad Note [The improvement story and derived shadows]
      
      * Rather than have a separate inert_model in the InertCans, I've
        put the derived equalities back into inert_eqs.  We weren't
        gaining anything from a separate field.
      
      * Previously we had a mode for the constraint solver in which it
        would more aggressively solve Derived constraints; it was used
        for simplifying the context of a 'deriving' clause, or a 'default'
        delcaration, for example.
      
        But the complexity wasn't worth it; now I just make proper Wanted
        constraints.  See TcMType.cloneWC
      
      * Don't generate injectivity improvement for Givens; see
        Note [No FunEq improvement for Givens] in TcInteract
      
      * solveSimpleWanteds leaves the insolubles in-place rather than
        returning them.  Simpler.
      
      I also did lots of work on comments, including fixing Trac #12821.
      1eec1f21
    • Simon Peyton Jones's avatar
      Add elemDVarEnv · 0123efde
      Simon Peyton Jones authored
      I need this in a later patch
      0123efde
    • Simon Peyton Jones's avatar
      Comments only in TcType · f04f1188
      Simon Peyton Jones authored
      f04f1188
    • Simon Peyton Jones's avatar
      Fix a bug in mk_superclasses_of · 0476a64e
      Simon Peyton Jones authored
      This bug meant that we were less eager about expanding
      tuple superclasses than we should have been; i.e. we stopped
      too soon.  That's not fatal, beause we expand more superclasses
      later, but it's less efficient.
      0476a64e
    • Simon Peyton Jones's avatar
      Make a panic into an ASSERT · 9a431e51
      Simon Peyton Jones authored
      9a431e51
  2. 24 Nov, 2016 2 commits
  3. 23 Nov, 2016 1 commit
    • Alexander Vershilov's avatar
      Allow to unregister threadWaitReadSTM action. · f4302534
      Alexander Vershilov authored
      Allow to unregister threadWaitReadSTM/threadWaitWriteSTM on
      a non-threaded runtime. Previosly noop action was returned,
      as a result it was not possible to unregister action, unless
      data arrives to Fd or it's closed.
      
      Fixes #12852.
      
      Reviewers: simonmar, hvr, austin, bgamari, trofi
      
      Reviewed By: bgamari, trofi
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2729
      
      GHC Trac Issues: #12852
      f4302534
  4. 22 Nov, 2016 2 commits
  5. 21 Nov, 2016 8 commits
  6. 20 Nov, 2016 1 commit
  7. 18 Nov, 2016 5 commits
    • Matthew Pickering's avatar
      Optimise whole module exports · 4b72f859
      Matthew Pickering authored
      We directly build up the correct AvailInfos rather than generating
      lots of singleton instances and combining them with expensive calls to
      unionLists.
      
      There are two other small changes.
      
      * Pushed the nubAvails call into the explicit export list
        branch as we construct them correctly and uniquely ourselves.
      * fix_faminst only needs to check the first element of the export
        list as we maintain the (yucky) invariant that the parent is the
        first thing in it.
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: simonpj, thomie, niteria
      
      Differential Revision: https://phabricator.haskell.org/D2657
      
      GHC Trac Issues: #12754
      4b72f859
    • Ryan Scott's avatar
      Add Data instance for Const · 3bd1dd4d
      Ryan Scott authored
      Summary:
      Fixes #12438. As discussed on the Haskell libraries mailing list here:
      https://mail.haskell.org/pipermail/libraries/2016-November/027396.html
      
      Reviewers: hvr, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2726
      
      GHC Trac Issues: #12438
      3bd1dd4d
    • Gabor Greif's avatar
      Spelling in comment only · d328abc8
      Gabor Greif authored
      d328abc8
    • Tamar Christina's avatar
      Add missing SMP symbols to RT linker. · 94d1221c
      Tamar Christina authored
      Summary:
      Add some missing symbols that we
      export from the public headers but forgot to include
      in the runtime linker's symbol table.
      
      This is a bit of a unsatifactory patch, since we have a bit of a
      cat and mouse game going. We should find a way to automate this.
      
      But I know of no good solutions at the moment that won't add all
      rts symbols (including those we don't have an extern declaration for.).
      
      So for now, just add the ones reported missing.
      
      Test Plan: inplace/bin/ghc-stage2.exe --interactive
      
      Reviewers: RyanGlScott, austin, erikd, simonmar, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2727
      
      GHC Trac Issues: #12846
      94d1221c
    • Erik de Castro Lopo's avatar
      Switch to LLVM version 3.9 · 9c39e09a
      Erik de Castro Lopo authored
      Test Plan:
      Build and test on x86_64/linux (perf-llvm) and armhf/linux.
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2719
      9c39e09a
  8. 17 Nov, 2016 11 commits
  9. 16 Nov, 2016 5 commits