1. 02 Apr, 2018 1 commit
    • Simon Peyton Jones's avatar
      Allow unpacking of single-data-con GADTs · 9187d5fb
      Simon Peyton Jones authored
      Trac #14978 pointed out that single-constructor GADTs should be
      unpackable without trouble.
      
      Acutally I realise that even existentials should be unpackable
      too, but that's a bit more work, so it's not part of this patch.
      
      See Note [Unpacking GADTs and existentials] in MkId.
      9187d5fb
  2. 02 Jan, 2018 1 commit
  3. 12 Sep, 2017 1 commit
    • David Feuer's avatar
      Add a test for #14140 · 0ebc8dc3
      David Feuer authored
      This issue seems to have been fixed by
      193664d4 (Re-engineer caseRules
      to add tagToEnum/dataToTag) but I don't think anyone realized
      that.
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14140
      
      Differential Revision: https://phabricator.haskell.org/D3934
      0ebc8dc3
  4. 13 May, 2017 2 commits
  5. 07 Apr, 2017 1 commit
    • Simon Peyton Jones's avatar
      Do Note [Improving seq] always · f0d98fc6
      Simon Peyton Jones authored
      This patch fixes Trac #13468, and at the same time makes the
      code simpler and more uniform.  In particular, I've eliminated
      the awkward conflict between the old built-in rule for seq
      (which elimianted a cast), and the desire to make case scrutinse
      a data type by doing type-family reduction (which adds a cast).
      
      Nice.
      f0d98fc6
  6. 13 Mar, 2017 1 commit
  7. 06 Mar, 2017 1 commit
  8. 03 Mar, 2017 1 commit
  9. 28 Feb, 2017 1 commit
    • Simon Peyton Jones's avatar
      The Early Inline Patch · 2effe18a
      Simon Peyton Jones authored
      This very small patch switches on sm_inline even in the InitialPhase
      (aka "gentle" phase).   There is no reason not to... and the results
      are astonishing.
      
      I think the peformance of GHC itself improves by about 5%; and some
      programs get much smaller, quicker.  Result: across the board
      irmprovements in
      compile time performance.  Here are the changes in perf/compiler;
      the numbers are decreases in compiler bytes-allocated:
      
        3%   T5837
        7%   parsing001
        9%   T12234
        35%  T9020
        9%   T3064
        13%  T9961
        20%  T13056
        5%   T9872d
        5%   T9872c
        5%   T9872b
        7%   T9872a
        5%   T783
        35%  T12227
        20%  T1969
      
      Plus in perf/should_run
      
        5%   lazy-bs-alloc
      
      It wasn't as easy as it sounds: I did a raft of preparatory work in
      earlier patches.  But it's great!
      
      Reviewers: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3203
      2effe18a
  10. 26 Feb, 2017 1 commit
  11. 24 Feb, 2017 1 commit
    • Simon Peyton Jones's avatar
      Make exprIsConApp_maybe work better for literals strings · a6e13d50
      Simon Peyton Jones authored
      There are two things here
      
      * Use exprIsLiteral_maybe to "look through" a variable bound
        to a literal string.
      
      * Add CONLIKE to the NOINLINE pragma for unpackCString# and
        unpackCStringUtf8#
      
      See Trac #13317, Trac #10844, and
      Note [exprIsConApp_maybe on literal strings] in CoreSubst
      
      I did a nofib run and got essentially zero change except for one
      2.2% improvement in allocation for 'pretty'.
      a6e13d50
  12. 01 Feb, 2017 1 commit
  13. 20 Jan, 2017 3 commits
    • takano-akio's avatar
      Allow top-level string literals in Core (#8472) · d49b2bb2
      takano-akio authored
      This commits relaxes the invariants of the Core syntax so that a
      top-level variable can be bound to a primitive string literal of type
      Addr#.
      
      This commit:
      
      * Relaxes the invatiants of the Core, and allows top-level bindings whose
        type is Addr# as long as their RHS is either a primitive string literal or
        another variable.
      
      * Allows the simplifier and the full-laziness transformer to float out
        primitive string literals to the top leve.
      
      * Introduces the new StgGenTopBinding type to accomodate top-level Addr#
        bindings.
      
      * Introduces a new type of labels in the object code, with the suffix "_bytes",
        for exported top-level Addr# bindings.
      
      * Makes some built-in rules more robust. This was necessary to keep them
        functional after the above changes.
      
      This is a continuation of D2554.
      
      Rebasing notes:
      This had two slightly suspicious performance regressions:
      
      * T12425: bytes allocated regressed by roughly 5%
      * T4029: bytes allocated regressed by a bit over 1%
      * T13035: bytes allocated regressed by a bit over 5%
      
      These deserve additional investigation.
      
      Rebased by: bgamari.
      
      Test Plan: ./validate --slow
      
      Reviewers: goldfire, trofi, simonmar, simonpj, austin, hvr, bgamari
      
      Reviewed By: trofi, simonpj, bgamari
      
      Subscribers: trofi, simonpj, gridaphobe, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2605
      
      GHC Trac Issues: #8472
      d49b2bb2
    • Simon Peyton Jones's avatar
      Simplify and improve CSE · b78fa759
      Simon Peyton Jones authored
      Trac #13156 showed a lost opportunity for CSE. I found that it was
      easy to fix, and it had the nice side effect of rendering a previous
      nasty case, described in Note [Corner case for case expressions],
      unnecessary.
      
      Simpler code, does more.  Great.
      b78fa759
    • Simon Peyton Jones's avatar
      Fix a nasty bug in exprIsExpandable · 9be18ea4
      Simon Peyton Jones authored
      This bug has been lurking for ages: Trac #13155
      
      The important semantic change is to ensure that exprIsExpandable
      returns False for primop calls.  Previously exprIsExpandable used
      exprIsCheap' which always used primOpIsCheap.
      
      I took the opportunity to combine the code for exprIsCheap' (two
      variants: exprIsCheap and exprIsExpandable) with that for
      exprIsWorkFree.  Result is simpler, tighter, easier to understand.
      And correct (at least wrt this bug)!
      9be18ea4
  14. 27 Dec, 2016 1 commit
    • Ben Gamari's avatar
      testsuite: Fix T13025 · 88f5add0
      Ben Gamari authored
      It relied on `wc`, which produces slightly different format on OS X and Linux.
      Instead use `grep -c` which appears to be supported on both platforms and
      produces consistent output.
      88f5add0
  15. 23 Dec, 2016 3 commits
    • Sylvain Henry's avatar
      Fix test for T12877 · 1b06231e
      Sylvain Henry authored
      Summary: See https://phabricator.haskell.org/rGHCd3b546b1a605
      
      Reviewers: nomeata, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2883
      1b06231e
    • Simon Peyton Jones's avatar
      Push coercions in exprIsConApp_maybe · b4c3a668
      Simon Peyton Jones authored
      Trac #13025 showed up the fact that exprIsConApp_maybe isn't
      clever enough: it didn't push coercions through applicatins, and that
      meant we weren't getting as much superclass selection as we should.
      
      It's easy to fix, happily.
      
      See Note [Push coercions in exprIsConApp_maybe]
      b4c3a668
    • Simon Peyton Jones's avatar
      Float unboxed expressions by boxing · 432f952e
      Simon Peyton Jones authored
      This patch makes GHC's floating more robust, by allowing it
      to float unboxed expressions of at least some common types.
      
      See Note [Floating MFEs of unlifted type] in SetLevels.
      
      This was all provoked by Trac #12603
      
      In working this through I also made a number of other corner-case
      changes in SetLevels:
      
      * Previously we inconsistently use exprIsBottom (which checks for
        bottom) instead of exprBotStrictness_maybe (which checks for
        bottoming functions).  As well as being inconsistent it was
        simply less good.
      
        See Note [Bottoming floats]
      
      * I fixed a case where were were unprofitably floating an
        expression because we thought it escaped a value lambda
        (see Note [Escaping a value lambda]).  The relevant code is
             float_me = (dest_lvl `ltMajLvl` (le_ctxt_lvl env)
                        && not float_is_lam)   -- NEW
      
      * I made lvlFloatRhs work properly in the case where abs_vars
        is non-empty.  It wasn't wrong before, but it did some stupid
        extra floating.
      432f952e
  16. 21 Dec, 2016 1 commit
  17. 13 Dec, 2016 1 commit
  18. 12 Dec, 2016 1 commit
    • Simon Peyton Jones's avatar
      Float unboxed expressions by boxing · bc3d37da
      Simon Peyton Jones authored
      This patch makes GHC's floating more robust, by allowing it
      to float unboxed expressions of at least some common types.
      
      See Note [Floating MFEs of unlifted type] in SetLevels.
      
      This was all provoked by Trac #12603
      bc3d37da
  19. 05 Sep, 2016 1 commit
  20. 22 Apr, 2016 1 commit
  21. 17 Dec, 2015 1 commit
    • Ben Gamari's avatar
      TcTypeable: Don't use bogus fingerprints when suppress-uniques is enabled · 786d528e
      Ben Gamari authored
      Previously the Typeable implementation would intentionally create TyCon
      representations with bogus fingerprints to avoid fingerprints (which may
      change often) from leaking into test output. As pointed out by Richard
      in #10376 this is very bad as simply enabling a debug flag,
      `-dsuppress-uniques`, completely breaks the soundness of `Typeable`!
      
      This patch removes this behavior and replaces it with logic in the
      testsuite driver to filter out spurious changes due to Typeable
      representations.
      
      Test Plan: Validate
      
      Reviewers: austin, simonpj, goldfire
      
      Reviewed By: goldfire
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1629
      
      GHC Trac Issues: #10376
      786d528e
  22. 11 Dec, 2015 1 commit
    • eir@cis.upenn.edu's avatar
      Add kind equalities to GHC. · 67465497
      eir@cis.upenn.edu authored
      This implements the ideas originally put forward in
      "System FC with Explicit Kind Equality" (ICFP'13).
      
      There are several noteworthy changes with this patch:
       * We now have casts in types. These change the kind
         of a type. See new constructor `CastTy`.
      
       * All types and all constructors can be promoted.
         This includes GADT constructors. GADT pattern matches
         take place in type family equations. In Core,
         types can now be applied to coercions via the
         `CoercionTy` constructor.
      
       * Coercions can now be heterogeneous, relating types
         of different kinds. A coercion proving `t1 :: k1 ~ t2 :: k2`
         proves both that `t1` and `t2` are the same and also that
         `k1` and `k2` are the same.
      
       * The `Coercion` type has been significantly enhanced.
         The documentation in `docs/core-spec/core-spec.pdf` reflects
         the new reality.
      
       * The type of `*` is now `*`. No more `BOX`.
      
       * Users can write explicit kind variables in their code,
         anywhere they can write type variables. For backward compatibility,
         automatic inference of kind-variable binding is still permitted.
      
       * The new extension `TypeInType` turns on the new user-facing
         features.
      
       * Type families and synonyms are now promoted to kinds. This causes
         trouble with parsing `*`, leading to the somewhat awkward new
         `HsAppsTy` constructor for `HsType`. This is dispatched with in
         the renamer, where the kind `*` can be told apart from a
         type-level multiplication operator. Without `-XTypeInType` the
         old behavior persists. With `-XTypeInType`, you need to import
         `Data.Kind` to get `*`, also known as `Type`.
      
       * The kind-checking algorithms in TcHsType have been significantly
         rewritten to allow for enhanced kinds.
      
       * The new features are still quite experimental and may be in flux.
      
       * TODO: Several open tickets: #11195, #11196, #11197, #11198, #11203.
      
       * TODO: Update user manual.
      
      Tickets addressed: #9017, #9173, #7961, #10524, #8566, #11142.
      Updates Haddock submodule.
      67465497
  23. 04 Dec, 2015 1 commit
    • Simon Peyton Jones's avatar
      Case-of-empty-alts is trivial (Trac #11155) · 1c9fd3f1
      Simon Peyton Jones authored
      As you'll see from Trac #11155, the code generator was confused
      by a binding let x = y in ....   Why did that happen? Because of
      a (case y of {}) expression on the RHS.
      
      The right thing is just to expand what a "trivial" expression is.
      
      See Note [Empty case is trivial] in CoreUtils.
      1c9fd3f1
  24. 23 Sep, 2015 1 commit
  25. 21 Jul, 2015 1 commit
    • Simon Peyton Jones's avatar
      Add NOINLINE for hs-boot functions · efa7b3a4
      Simon Peyton Jones authored
      This fixes Trac #10083.
      
      The key change is in TcBinds.tcValBinds, where we construct
      the prag_fn.  With this patch we add a NOINLINE pragma for
      any functions that were exported by the hs-boot file for this
      module.
      
      See Note [Inlining and hs-boot files], and #10083, for details.
      
      The commit touches several other files becuase I also changed the
      representation of the "pragma function" from a function TcPragFun
      to an environment, TcPragEnv. This makes it easer to extend
      during construction.
      efa7b3a4
  26. 07 Apr, 2015 1 commit
  27. 03 Mar, 2015 1 commit
    • thomie's avatar
      Pretty-print # on unboxed literals in core · 89458eba
      thomie authored
      Summary:
      Ticket #10104 dealt with showing the '#'s on types with unboxed fields. This
      commit pretty prints the '#'s on unboxed literals in core output.
      
      Test Plan: simplCore/should_compile/T8274
      
      Reviewers: jstolarek, simonpj, austin
      
      Reviewed By: simonpj, austin
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D678
      
      GHC Trac Issues: #8274
      89458eba
  28. 19 Aug, 2014 1 commit
  29. 10 Aug, 2014 1 commit
  30. 07 Aug, 2014 1 commit
  31. 13 Mar, 2014 1 commit
    • Simon Peyton Jones's avatar
      Test Trac #8832 · ea6dcef1
      Simon Peyton Jones authored
      The test is a bit crude; -ddump-simpl | grep '#'.
      
      I'm concerned that the -ddump-simpl output may differ on 32 and 64-bit
      platforms.  So far I've only put in output for 64-bit platforms.
      ea6dcef1
  32. 12 Nov, 2013 1 commit
  33. 18 Sep, 2013 2 commits
  34. 04 Sep, 2013 1 commit