1. 27 Jan, 2020 1 commit
  2. 13 Jan, 2020 1 commit
  3. 28 Nov, 2019 1 commit
  4. 02 Nov, 2019 1 commit
    • Simon Peyton Jones's avatar
      Make CSE delay inlining less · 4a6d3d68
      Simon Peyton Jones authored
      CSE delays inlining a little bit, to avoid losing vital
      specialisations; see Note [Delay inlining after CSE] in CSE.
      But it was being over-enthusiastic.  This patch makes the
      delay only apply to Ids with specialisation rules, which
      avoids unnecessary delay (#17409).
  5. 15 Mar, 2019 1 commit
  6. 05 Sep, 2018 1 commit
    • Simon Peyton Jones's avatar
      Preserve specialisations despite CSE · 3addf72a
      Simon Peyton Jones authored
      Trac #15445 showed that, as a result of CSE, a function with an
      automatically generated specialisation RULE could be inlined
      before the RULE had a chance to fire.
      This patch attaches a NOINLINE[2] activation to the Id, during
      CSE, to stop this happening.
      See Note [Delay inlining after CSE]
      ---- Historical note ---
      This patch is simpler and more direct than an earlier
        commit 2110738b
        Author: Simon Peyton Jones <simonpj@microsoft.com>
        Date:   Mon Jul 30 13:43:56 2018 +0100
        Don't inline functions with RULES too early
      We had to revert this patch because it made GHC itself slower.
      Why? It delayed inlining of /all/ functions with RULES, and that was
      very bad in TcFlatten.flatten_ty_con_app
      * It delayed inlining of liftM
      * That delayed the unravelling of the recursion in some dictionary
      * That delayed some eta expansion, leaving
           flatten_ty_con_app = \x y. let <stuff> in \z. blah
      * That allowed the float-out pass to put sguff between
        the \y and \z.
      * And that permanently stopped eta expasion of the function,
        even once <stuff> was simplified.
      -- End of historical note ---
  7. 05 May, 2018 1 commit
  8. 17 Apr, 2018 1 commit
  9. 10 Apr, 2018 1 commit
    • Joachim Breitner's avatar
      CSE: Walk past join point lambdas (#15002) · ae0cff0a
      Joachim Breitner authored
      As the CSE transformation traverses the syntax tree, it needs to go past
      the lambdas of a join point, and only look for CSE opportunities inside,
      as a join point’s lambdas must be preserved. Simple fix; comes with a
      Note and a test case.
      Thanks to Ryan Scott for an excellently minimized test case, and for
      bisecting GHC.
      Differential Revision: https://phabricator.haskell.org/D4572
  10. 06 Mar, 2018 1 commit
    • niteria's avatar
      Allow top level ticked string literals · 5bc195a2
      niteria authored
      This reverts f5b275a2
      and changes the places that looked for `Lit (MachStr _))`
      to use `exprIsMbTickedLitString_maybe` to unwrap ticks as
      Also updated relevant comments.
      Test Plan:
      I added 3 new tests that previously reproduced.
      GHC HEAD now builds with -g
      Reviewers: simonpj, simonmar, bgamari, hvr, goldfire
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #14779
      Differential Revision: https://phabricator.haskell.org/D4470
  11. 21 Dec, 2017 1 commit
  12. 19 Dec, 2017 1 commit
  13. 17 Oct, 2017 1 commit
  14. 19 Sep, 2017 1 commit
    • Herbert Valerio Riedel's avatar
      compiler: introduce custom "GhcPrelude" Prelude · f63bc730
      Herbert Valerio Riedel authored
      This switches the compiler/ component to get compiled with
      -XNoImplicitPrelude and a `import GhcPrelude` is inserted in all
      This is motivated by the upcoming "Prelude" re-export of
      `Semigroup((<>))` which would cause lots of name clashes in every
      modulewhich imports also `Outputable`
      Reviewers: austin, goldfire, bgamari, alanz, simonmar
      Reviewed By: bgamari
      Subscribers: goldfire, rwbarton, thomie, mpickering, bgamari
      Differential Revision: https://phabricator.haskell.org/D3989
  15. 12 Sep, 2017 1 commit
  16. 18 Aug, 2017 1 commit
  17. 31 Jul, 2017 1 commit
    • Simon Peyton Jones's avatar
      Do a bit more CSE · 3ab342eb
      Simon Peyton Jones authored
      I discovered that in
         let x = MkT y in ....(MKT y |> co)....
      we weren't CSE'ing the (MkT y).  The fix is easy.
  18. 17 May, 2017 1 commit
    • Simon Peyton Jones's avatar
      Handle type-lets better · d6461f96
      Simon Peyton Jones authored
      Core allows non-recursive type-lets, thus
         let a = TYPE ty in ...
      They are substituted away very quickly, but it's convenient for
      some passes to produce them (rather than to have to substitute
      Trac #13708 tried the effect of not running the simplifer at all
      (a rather bizarre thing to do, but still).  That showed that some
      passes crashed because they always treated a let-bounder binder
      as an Id.  This patch adds some easy fixes.
  19. 28 Apr, 2017 1 commit
  20. 02 Apr, 2017 1 commit
  21. 06 Mar, 2017 1 commit
  22. 03 Mar, 2017 1 commit
  23. 01 Mar, 2017 2 commits
  24. 28 Feb, 2017 1 commit
  25. 17 Feb, 2017 1 commit
  26. 04 Feb, 2017 1 commit
  27. 01 Feb, 2017 1 commit
  28. 23 Jan, 2017 1 commit
  29. 20 Jan, 2017 2 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
      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#
      * 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
    • 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],
      Simpler code, does more.  Great.
  30. 05 Jan, 2017 1 commit
    • Simon Peyton Jones's avatar
      Minor refactoring in CSE · c909e6ec
      Simon Peyton Jones authored
      I noticed that CSE.addBinding was always returning one of its own
      inputs, so I refactored to avoid doing so.
      No change in behaviour.
  31. 21 Dec, 2016 1 commit
    • Simon Peyton Jones's avatar
      Move InId/OutId to CoreSyn · 05d233e8
      Simon Peyton Jones authored
      It turned out that many different modules defined the same type
      synonyms (InId, OutId, InType, OutType, etc) for the same purpose.
      This patch is refactoring only: it moves all those definitions to
  32. 12 Dec, 2016 1 commit
    • Simon Peyton Jones's avatar
      Fix a long-standing bug in CSE · d03dd237
      Simon Peyton Jones authored
      I had the environments wrong so that CSE could mis-clone
      an expression, if the uniques just happened to be badly
      arranged.  It's hard to trigger the bug, so I can't make
      a reliable test case.
      Happily the fix is easy.
  33. 25 May, 2016 1 commit
  34. 06 Apr, 2016 1 commit
  35. 24 Mar, 2016 1 commit
    • Simon Peyton Jones's avatar
      Tidy up handling of coercion variables · cb08f8da
      Simon Peyton Jones authored
      * Comments to explain that a CoVar, whose IdInfo is CoVarId,
        is always unlifted (but may be nominal or representational role)
        And TyCoRep.isCoercionType picks out only those unlifted
        types, NOT the lifted versions
      * Introduce Var.NcId for non-co-var Ids
        with predicate isNonCoVarId
      * Add assertions in CoreSubst that the Id env is only
        used for NcIds
      * Fix lurking bug in CSE which extended the
        CoreSubst Id env with a CoVar
      * Fix two bugs in Specialise.spec_call, which wrongly treated
        CoVars like NcIds
          - needed a varToCoreExpr in one place
          - needed extendSubst not extendIdSubst in another
        This was the root cause of Trac #11644
      Minor refactoring
      * Eliminate unused mkDerivedLocalCoVarM, mkUserLocalCoVar
      * Small refactor in mkSysLocalOrCoVar
  36. 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
       * 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.
  37. 21 Apr, 2015 1 commit
  38. 14 Apr, 2015 1 commit
    • Simon Peyton Jones's avatar
      Zap usage info in CSE (Trac #10218) · d261d4cb
      Simon Peyton Jones authored
      Trac #10218 reports a subtle bug that turned out to be:
      - CSE invalidated the usage information computed
        by earlier demand analysis, by increasing sharing
      - that made a single-entry thunk into a multi-entry thunk
      - and with -feager-blackholing, that led to <<loop>>
      The patch fixes it by making the CSE pass zap usage information for
      let-bound identifiers.   It can be restored by -flate-dmd-anal.
      (But making -flate-dmd-anal the default needs some careful work;
      see Trac #7782.)