1. 19 Aug, 2019 1 commit
  2. 18 Aug, 2019 1 commit
    • Sylvain Henry's avatar
      Faster exactLog2 · ac73c1b1
      Sylvain Henry authored
      Make `exactLog2` faster (use `countLeadingZeros` and Int32 bit-ops).
      
      On my Core i7-9700k Criterion reports ~50% speedup (from 16 to 8ns).
      ac73c1b1
  3. 14 Aug, 2019 1 commit
    • Andreas Klebinger's avatar
      Rework the Binary Integer instance. · a38104b4
      Andreas Klebinger authored
      We used to serialise large integers as strings. Now they are serialized
      as a list of Bytes.
      
      This changes the size for a Integer in the higher 64bit range from 77 to
      9 bytes when written to disk.
      
      The impact on the general case is small (<1% for interface files) as we
      don't use many Integers. But for code that uses many this should be a
      nice benefit.
      a38104b4
  4. 13 Aug, 2019 1 commit
  5. 19 Jul, 2019 1 commit
  6. 17 Jul, 2019 1 commit
    • John Ericson's avatar
      Create {Int,Word}32Rep · 0a9b77b8
      John Ericson authored
      This prepares the way for making Int32# and Word32# the actual size they
      claim to be.
      
      Updates binary submodule for (de)serializing the new runtime reps.
      0a9b77b8
  7. 14 Jul, 2019 1 commit
    • John Ericson's avatar
      Expunge #ifdef and #ifndef from the codebase · d7c6c471
      John Ericson authored
      These are unexploded minds as far as the linter is concerned. I don't
      want to hit in my MRs by mistake!
      
      I did this with `sed`, and then rolled back some changes in the docs,
      config.guess, and the linter itself.
      d7c6c471
  8. 11 Jul, 2019 1 commit
  9. 20 Jun, 2019 2 commits
  10. 16 Jun, 2019 1 commit
  11. 14 Jun, 2019 1 commit
  12. 12 Jun, 2019 1 commit
  13. 11 Jun, 2019 1 commit
    • Alp Mestanogullari's avatar
      Refine the GHCI macro into HAVE[_{INTERNAL, EXTERNAL}]_INTERPRETER · 39f50bff
      Alp Mestanogullari authored
      As discussed in #16331, the GHCI macro, defined through 'ghci' flags
      in ghc.cabal.in, ghc-bin.cabal.in and ghci.cabal.in, is supposed to indicate
      whether GHC is built with support for an internal interpreter, that runs in
      the same process. It is however overloaded in a few places to mean
      "there is an interpreter available", regardless of whether it's an internal
      or external interpreter.
      
      For the sake of clarity and with the hope of more easily being able to
      build stage 1 GHCs with external interpreter support, this patch splits
      the previous GHCI macro into 3 different ones:
      
      - HAVE_INTERNAL_INTERPRETER: GHC is built with an internal interpreter
      - HAVE_EXTERNAL_INTERPRETER: GHC is built with support for external interpreters
      - HAVE_INTERPRETER: HAVE_INTERNAL_INTERPRETER || HAVE_EXTERNAL_INTERPRETER
      39f50bff
  14. 07 Jun, 2019 1 commit
    • Sebastian Graf's avatar
      TmOracle: Replace negative term equalities by refutable PmAltCons · e963beb5
      Sebastian Graf authored
      The `PmExprEq` business was a huge hack and was at the same time vastly
      too powerful and not powerful enough to encode negative term equalities,
      i.e. facts of the form "forall y. x ≁ Just y".
      
      This patch introduces the concept of 'refutable shapes': What matters
      for the pattern match checker is being able to encode knowledge of the
      kind "x can no longer be the literal 5". We encode this knowledge in a
      `PmRefutEnv`, mapping a set of newly introduced `PmAltCon`s (which are
      just `PmLit`s at the moment) to each variable denoting above
      inequalities.
      
      So, say we have `x ≁ 42 ∈ refuts` in the term oracle context and
      try to solve an equality like `x ~ 42`. The entry in the refutable
      environment will immediately lead to a contradiction.
      
      This machinery renders the whole `PmExprEq` and `ComplexEq` business
      unnecessary, getting rid of a lot of (mostly dead) code.
      
      See the Note [Refutable shapes] in TmOracle for a place to start.
      
      Metric Decrease:
          T11195
      e963beb5
  15. 29 May, 2019 3 commits
    • John Ericson's avatar
      Break up `Settings` into smaller structs · ace2e335
      John Ericson authored
      As far as I can tell, the fields within `Settings` aren't *intrinsicly*
      related. They just happen to be initialized the same way (in particular
      prior to the rest of `DynFlags`), and that is why they are grouped
      together.
      
      Within `Settings`, however, there are groups of settings that clearly do
      share something in common, regardless of how they anything is
      initialized.
      
      In the spirit of GHC being a library, where the end cosumer may choose
      to initialize this configuration in arbitrary ways, I made some new data
      types for thoses groups internal to `Settings`, and used them to define
      `Settings` instead. Hopefully this is a baby step towards a general
      decoupling of the stateful and stateless parts of GHC.
      ace2e335
    • Daniel Gröber (dxld)'s avatar
      Add hPutStringBuffer utility · cc0d05a7
      Daniel Gröber (dxld) authored
      cc0d05a7
    • Krzysztof Gogolewski's avatar
      Fix missing unboxed tuple RuntimeReps (#16565) · 69b16331
      Krzysztof Gogolewski authored
      Unboxed tuples and sums take extra RuntimeRep arguments,
      which must be manually passed in a few places.
      This was not done in deSugar/Check.
      
      This error was hidden because zipping functions in TyCoRep
      ignored lists with mismatching length. This is now fixed;
      the lengths are now checked by calling zipEqual.
      
      As suggested in #16565, I moved checking for isTyVar and
      isCoVar to zipTyEnv and zipCoEnv.
      69b16331
  16. 27 May, 2019 1 commit
  17. 24 May, 2019 1 commit
    • Michael Sloan's avatar
      Add PlainPanic for throwing exceptions without depending on pprint · d9dfbde3
      Michael Sloan authored
      This commit splits out a subset of GhcException which do not depend on
      pretty printing (SDoc), as a new datatype called
      PlainGhcException. These exceptions can be caught as GhcException,
      because 'fromException' will convert them.
      
      The motivation for this change is that that the Panic module
      transitively depends on many modules, primarily due to pretty printing
      code.  It's on the order of about 130 modules.  This large set of
      dependencies has a few implications:
      
      1. To avoid cycles / use of boot files, these dependencies cannot
      throw GhcException.
      
      2. There are some utility modules that use UnboxedTuples and also use
      `panic`. This means that when loading GHC into GHCi, about 130
      additional modules would need to be compiled instead of
      interpreted. Splitting the non-pprint exception throwing into a new
      module resolves this issue. See #13101
      d9dfbde3
  18. 08 May, 2019 1 commit
  19. 18 Apr, 2019 1 commit
  20. 09 Apr, 2019 2 commits
    • Artem Pyanykh's avatar
      bd2de4f0
    • Artem Pyanykh's avatar
      codegen: fix memset unroll for small bytearrays, add 64-bit sets · af4cea7f
      Artem Pyanykh authored
      Fixes #16052
      
      When the offset in `setByteArray#` is statically known, we can provide
      better alignment guarantees then just 1 byte.
      
      Also, memset can now do 64-bit wide sets.
      
      The current memset intrinsic is not optimal however and can be
      improved for the case when we know that we deal with
      
      (baseAddress at known alignment) + offset
      
      For instance, on 64-bit
      
      `setByteArray# s 1# 23# 0#`
      
      given that bytearray is 8 bytes aligned could be unrolled into
      `movb, movw, movl, movq, movq`; but currently it is
      `movb x23` since alignment of 1 is all we can embed into MO_Memset op.
      af4cea7f
  21. 01 Apr, 2019 1 commit
  22. 25 Mar, 2019 1 commit
    • Takenobu Tani's avatar
      Update Wiki URLs to point to GitLab · 3769e3a8
      Takenobu Tani authored
      This moves all URL references to Trac Wiki to their corresponding
      GitLab counterparts.
      
      This substitution is classified as follows:
      
      1. Automated substitution using sed with Ben's mapping rule [1]
          Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...
          New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...
      
      2. Manual substitution for URLs containing `#` index
          Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz
          New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz
      
      3. Manual substitution for strings starting with `Commentary`
          Old: Commentary/XxxYyy...
          New: commentary/xxx-yyy...
      
      See also !539
      
      [1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
      3769e3a8
  23. 20 Mar, 2019 1 commit
  24. 16 Mar, 2019 1 commit
  25. 15 Mar, 2019 1 commit
  26. 09 Mar, 2019 2 commits
  27. 04 Mar, 2019 1 commit
  28. 24 Feb, 2019 1 commit
  29. 22 Feb, 2019 1 commit
  30. 20 Feb, 2019 1 commit
  31. 15 Feb, 2019 1 commit
    • Alec Theriault's avatar
      Properly escape character literals in Haddocks · 173d0cee
      Alec Theriault authored
      Character literals in Haddock should not be written as plain `'\n'` since
      single quotes are for linking identifiers. Besides, since we want the
      character literal to be monospaced, we really should use `@\'\\n\'@`.
      
      [skip ci]
      173d0cee
  32. 14 Feb, 2019 1 commit
    • Simon Peyton Jones's avatar
      Make a smart mkAppTyM · 68278382
      Simon Peyton Jones authored
      This patch finally delivers on Trac #15952.  Specifically
      
      * Completely remove Note [The tcType invariant], along with
        its complicated consequences (IT1-IT6).
      
      * Replace Note [The well-kinded type invariant] with:
      
            Note [The Purely Kinded Type Invariant (PKTI)]
      
      * Instead, establish the (PKTI) in TcHsType.tcInferApps,
        by using a new function mkAppTyM when building a type
        application.  See Note [mkAppTyM].
      
      * As a result we can remove the delicate mkNakedXX functions
        entirely.  Specifically, mkNakedCastTy retained lots of
        extremly delicate Refl coercions which just cluttered
        everything up, and(worse) were very vulnerable to being
        silently eliminated by (say) substTy. This led to a
        succession of bug reports.
      
      The result is noticeably simpler to explain, simpler
      to code, and Richard and I are much more confident that
      it is correct.
      
      It does not actually fix any bugs, but it brings us closer.
      E.g. I hoped it'd fix #15918 and #15799, but it doesn't quite
      do so.  However, it makes it much easier to fix.
      
      I also did a raft of other minor refactorings:
      
      * Use tcTypeKind consistently in the type checker
      
      * Rename tcInstTyBinders to tcInvisibleTyBinders,
        and refactor it a bit
      
      * Refactor tcEqType, pickyEqType, tcEqTypeVis
        Simpler, probably more efficient.
      
      * Make zonkTcType zonk TcTyCons, at least if they have
        any free unification variables -- see zonk_tc_tycon
        in TcMType.zonkTcTypeMapper.
      
        Not zonking these TcTyCons was actually a bug before.
      
      * Simplify try_to_reduce_no_cache in TcFlatten (a lot)
      
      * Combine checkExpectedKind and checkExpectedKindX.
        And then combine the invisible-binder instantation code
        Much simpler now.
      
      * Fix a little bug in TcMType.skolemiseQuantifiedTyVar.
        I'm not sure how I came across this originally.
      
      * Fix a little bug in TyCoRep.isUnliftedRuntimeRep
        (the ASSERT was over-zealous).  Again I'm not certain
        how I encountered this.
      
      * Add a missing solveLocalEqualities in
        TcHsType.tcHsPartialSigType.
        I came across this when trying to get level numbers
        right.
      68278382
  33. 09 Feb, 2019 2 commits
    • Andreas Klebinger's avatar
      Improve snocView implementation. · f4d8e907
      Andreas Klebinger authored
      The new implementation isn't tailrecursive and instead
      builds up the initial part of the list as it goes.
      
      This improves allocation numbers as we don't build up an intermediate
      list just to reverse it later.
      
      This is slightly slower for lists of size <= 3. But in benchmarks
      significantly faster for any list above 5 elements, assuming the
      majority of the resulting list will be evaluated.
      f4d8e907
    • Andreas Klebinger's avatar
      Replace a few uses of snocView with last/lastMaybe. · 9170daa8
      Andreas Klebinger authored
      These never used the first part of the result from snocView.
      Hence replacing them with last[Maybe] is both clearer and
      gives better performance.
      9170daa8
  34. 31 Jan, 2019 1 commit