1. 02 Jun, 2018 1 commit
    • Ben Gamari's avatar
      vectorise: Put it out of its misery · faee23bb
      Ben Gamari authored
      Poor DPH and its vectoriser have long been languishing; sadly it seems there is
      little chance that the effort will be rekindled. Every few years we discuss
      what to do with this mass of code and at least once we have agreed that it
      should be archived on a branch and removed from `master`. Here we do just that,
      eliminating heaps of dead code in the process.
      
      Here we drop the ParallelArrays extension, the vectoriser, and the `vector` and
      `primitive` submodules.
      
      Test Plan: Validate
      
      Reviewers: simonpj, simonmar, hvr, goldfire, alanz
      
      Reviewed By: simonmar
      
      Subscribers: goldfire, rwbarton, thomie, mpickering, carter
      
      Differential Revision: https://phabricator.haskell.org/D4761
      faee23bb
  2. 30 May, 2018 1 commit
  3. 13 Mar, 2018 1 commit
    • Ryan Scott's avatar
      Drop GHC 8.0 compatibility · 152055a1
      Ryan Scott authored
      GHC 8.4.1 is out, so now GHC's support window only extends
      back to GHC 8.2. This means we can delete gobs of code that were
      only used for GHC 8.0 support. Hooray!
      
      Test Plan: ./validate
      
      Reviewers: bgamari, erikd, dfeuer
      
      Reviewed By: bgamari, dfeuer
      
      Subscribers: alexbiehl, dfeuer, rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4492
      152055a1
  4. 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
      modules.
      
      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
      f63bc730
  5. 18 Jul, 2017 1 commit
    • niteria's avatar
      Make module membership on ModuleGraph faster · b8fec695
      niteria authored
      When loading/reloading with a large number of modules
      (>5000) the cost of linear lookups becomes significant.
      
      The changes here made `:reload` go from 6s to 1s on my
      test case.
      
      The bottlenecks were `needsLinker` in `DriverPipeline` and
      `getModLoop` in `GhcMake`.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, austin, bgamari
      
      Subscribers: thomie, rwbarton
      
      Differential Revision: https://phabricator.haskell.org/D3703
      b8fec695
  6. 22 May, 2017 1 commit
  7. 19 May, 2017 1 commit
  8. 17 Feb, 2017 1 commit
    • Edward Z. Yang's avatar
      Fix a Backpack recompilation avoidance bug when signatures change. · ca543154
      Edward Z. Yang authored
      Summary:
      Recompilation avoidance checks if -this-unit-id has changed by relying
      on the "wanted module" check in readIface ("Something is amiss...").
      Unfortunately, this check didn't check if the instantiation made
      sense, which meant that if you changed the signatures of a Backpack
      package, we'd still treat the old signatures as up-to-date.
      
      The way I fixed this was by having findAndReadIface take in a 'Module'
      representing the /actual/ module we were intending to lookup.  We
      convert this into the 'Module' we expect to see in 'mi_module' and
      now do a more elaborate check that will also verify that instantiations
      make sense.
      
      Along the way, I robustified the logging infrastructure for
      recompilation checking, and folded wrongIfaceModErr (which
      was dead code) into the error message.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, austin
      
      Subscribers: thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3130
      ca543154
  9. 13 Dec, 2016 2 commits
  10. 21 Nov, 2016 1 commit
  11. 08 Oct, 2016 3 commits
  12. 28 Aug, 2016 1 commit
  13. 05 Aug, 2016 1 commit
  14. 22 Jul, 2016 1 commit
    • Simon Marlow's avatar
      Add deepseq dependency and a few NFData instances · c4f3d91b
      Simon Marlow authored
      I needed to rnf a data structure (CompiledByteCode) but we don't have
      any good deepseq infrastructure in the compiler yet.  There are bits and
      pieces, but nothing consistent, so this is a start.
      
      We already had a dependency on deepseq indirectly via other packages
      (e.g. containers).
      
      Includes an update to the haddock submodule, to remove orphan NFData
      instances in there.
      
      Test Plan: validate
      
      Reviewers: austin, bgamari, erikd, hvr
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2418
      c4f3d91b
  15. 30 Jun, 2016 1 commit
    • niteria's avatar
      Delete Ord Unique · fb6e2c7f
      niteria authored
      Ord Unique can be a source of invisible, accidental
      nondeterminism as explained in Note [No Ord for Unique].
      This removes it, leaving a note with rationale.
      
      It's unfortunate that I had to write Ord instances for
      codegen data structures by hand, but I believe that it's a
      right trade-off here.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, austin, bgamari
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2370
      
      GHC Trac Issues: #4012
      fb6e2c7f
  16. 22 Jun, 2016 1 commit
    • niteria's avatar
      Make the Ord Module independent of Unique order (2nd try) · 348f2dbb
      niteria authored
      The `Ord Module` instance currently uses `Unique`s for comparison.
      We don't want to use the `Unique` order because it can introduce
      nondeterminism.
      This switches `Ord ModuleName` and `Ord UnitId` to use lexicographic
      ordering making `Ord Module` deterministic transitively.
      
      I've run `nofib` and it doesn't make a measurable difference.
      
      See also Note [ModuleEnv determinism and performance].
      
      This fixes #12191 - the regression, that the previous version of this
      patch had.
      
      Test Plan:
      ./validate
      run nofib: P112
      
      Reviewers: simonmar, bgamari, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2354
      
      GHC Trac Issues: #4012, #12191
      348f2dbb
  17. 15 Jun, 2016 1 commit
  18. 13 Jun, 2016 2 commits
    • niteria's avatar
      Make the Ord Module independent of Unique order · 0497ee50
      niteria authored
      The `Ord Module` instance currently uses `Unique`s for comparison.
      We don't want to use the `Unique` order because it can introduce nondeterminism.
      This switches `Ord ModuleName` and `Ord UnitId` to use lexicographic ordering
      making `Ord Module` deterministic transitively.
      
      I've run `nofib` and it doesn't make a measurable difference.
      
      See also Note [ModuleEnv determinism and performance].
      
      Test Plan:
      ./validate
      run nofib: P112
      
      Reviewers: simonpj, simonmar, austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2030
      
      GHC Trac Issues: #4012
      0497ee50
    • niteria's avatar
      Kill unused foldModuleEnv · 7de776cf
      niteria authored
      With the current implementation, it's nondeterministic
      because Ord Module is nondeterministic.
      7de776cf
  19. 11 Jun, 2016 1 commit
  20. 06 Jun, 2016 1 commit
    • niteria's avatar
      Use UniqDFM for HomePackageTable · 3042a9d8
      niteria authored
      This isn't strictly necessary for deterministic ABIs.
      The results of eltsHpt are consumed in two ways:
      1) they determine the order of linking
      2) if you track the data flow all the family instances get put in
         FamInstEnvs, so the nondeterministic order is forgotten.
      3) same for VectInfo stuff
      4) same for Annotations
      
      The problem is that I haven't found a nice way to do 2. in
      a local way and 1. is nice to have if we went for deterministic
      object files. Besides these maps are keyed on ModuleNames so they
      should be small relative to other things and the overhead should
      be negligible.
      
      As a bonus we also get more specific names.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, austin, hvr, ezyang, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2300
      
      GHC Trac Issues: #4012
      3042a9d8
  21. 24 May, 2016 1 commit
    • Ryan Scott's avatar
      Remove 'deriving Typeable' statements · 95dfdceb
      Ryan Scott authored
      Summary:
      Deriving `Typeable` has been a no-op since GHC 7.10, and now that we
      require 7.10+ to build GHC, we can remove all the redundant `deriving Typeable`
      statements in GHC.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, austin, hvr, bgamari
      
      Reviewed By: austin, hvr, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2260
      95dfdceb
  22. 01 Feb, 2016 1 commit
    • Edward Z. Yang's avatar
      Simplify ghc-boot database representation with new type class. · 0d601657
      Edward Z. Yang authored
      Previously, we had an 'OriginalModule' type in ghc-boot which
      was basically identical to 'Module', and we had to do a bit of
      gyrating to get it converted into the right form.  This commit
      introduces a new typeclass, 'DbModuleRep' which represents types
      which we know how to serialize to and from the (now renamed) 'DbModule'
      type.
      
      The upshot is that we can just store 'Module's DIRECTLY in
      the 'InstalledPackageInfo', no conversion needed.
      
      I took the opportunity to clean up ghc-pkg to make its use of
      the 'BinaryStringRep' classes more type safe.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1811
      0d601657
  23. 15 Jan, 2016 1 commit
  24. 15 Oct, 2015 1 commit
  25. 22 Sep, 2015 1 commit
    • niteria's avatar
      Make derived names deterministic · d4d34a73
      niteria authored
      The names of auxiliary bindings end up in the interface file, and since uniques
      are nondeterministic, we end up with nondeterministic interface files.
      
      This uses the package and module name in the generated name, so I believe it
      should avoid problems from #7947 and be deterministic as well.
      
      The generated names look like this now:
      
        `$cLrlbmVwI3gpI8G2E6Hg3mO`
      
      and with `-ppr-debug`:
      
        `$c$aeson_70dylHtv1FFGeai1IoxcQr$Data.Aeson.Types.Internal$String`.
      
      Reviewed By: simonmar, austin, ezyang
      
      Differential Revision: https://phabricator.haskell.org/D1133
      
      GHC Trac Issues: #4012
      d4d34a73
  26. 08 Jul, 2015 1 commit
  27. 07 Apr, 2015 1 commit
  28. 31 Mar, 2015 1 commit
    • Herbert Valerio Riedel's avatar
      Drop old integer-gmp-0.5 from GHC source tree · 995e8c1c
      Herbert Valerio Riedel authored
      This completes what c774b28f (#9281)
      started.  `integer-gmp-1.0` was added as an additional
      `libraries/integer-gmp2` folder while retaining the ability to configure
      GHC w/ the old `integer-gmp-0.5` to have a way back, and or the ability
      to easily switch between old/new `integer-gmp` for benchmark/debugging
      purposes.
      
      This commit removes the old `libraries/integer-gmp` folder and moves
      `libraries/integer-gmp2` into its place, while removing any mentions of
      "gmp2" as well as the to support two different `integer-gmp` packages in
      GHC's source-tree.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D769
      995e8c1c
  29. 03 Dec, 2014 1 commit
  30. 02 Dec, 2014 1 commit
  31. 30 Nov, 2014 1 commit
    • Edward Z. Yang's avatar
      Filter instance visibility based on set of visible orphans, fixes #2182. · 4c834fdd
      Edward Z. Yang authored
      Summary:
      Amazingly, the fix for this very old bug is quite simple: when type-checking,
      maintain a set of "visible orphan modules" based on the orphans list of
      modules which we explicitly imported.  When we import an instance and it
      is an orphan, we check if it is in the visible modules set, and if not,
      ignore it.  A little bit of refactoring for when orphan-hood is calculated
      happens so that we always know if an instance is an orphan or not.
      
      For GHCi, we preinitialize the visible modules set based on the list of
      interactive imports which are active.
      
      Future work: Cache the visible orphan modules set for GHCi, rather than
      recomputing it every type-checking round.  (But it's tricky what to do when you
      /remove/ a module: you need a data structure a little more complicated than
      just a set of modules.)
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: new tests and validate
      
      Reviewers: simonpj, austin
      
      Subscribers: thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D488
      
      GHC Trac Issues: #2182
      4c834fdd
  32. 12 Nov, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Implement new integer-gmp2 from scratch (re #9281) · c774b28f
      Herbert Valerio Riedel authored
      This is done as a separate `integer-gmp2` backend library because it
      turned out to become a complete rewrite from scratch.
      
      Due to the different (over)allocation scheme and potentially different
      accounting (via the new `{shrink,resize}MutableByteArray#` primitives),
      some of the nofib benchmarks actually results in increased allocation
      numbers (but not necessarily an increase in runtime!).  I believe the
      allocation numbers could improve if `{resize,shrink}MutableByteArray#`
      could be optimised to reallocate in-place more efficiently.
      
      Here are the more apparent changes in the latest nofib comparision
      between `integer-gmp` and `integer-gmp2`:
      
        ------------------------------------------------------------------
                Program     Size    Allocs   Runtime   Elapsed  TotalMem
        ------------------------------------------------------------------
                    ...
             bernouilli    +1.6%    +15.3%     0.132     0.132      0.0%
                    ...
           cryptarithm1    -2.2%      0.0%     -9.7%     -9.7%      0.0%
                    ...
                  fasta    -0.7%     -0.0%    +10.9%    +10.9%      0.0%
                    ...
                  kahan    +0.6%    +38.9%     0.169     0.169      0.0%
                    ...
                   lcss    -0.7%     -0.0%     -6.4%     -6.4%      0.0%
                    ...
                 mandel    +1.6%    +33.6%     0.049     0.049      0.0%
                    ...
               pidigits    +0.8%     +8.5%     +3.9%     +3.9%      0.0%
                  power    +1.4%    -23.8%    -18.6%    -18.6%    -16.7%
                    ...
              primetest    +1.3%    +50.1%     0.085     0.085      0.0%
                    ...
                    rsa    +1.6%    +53.4%     0.026     0.026      0.0%
                    ...
                    scs    +1.2%     +6.6%     +6.5%     +6.6%    +14.3%
                    ...
                 symalg    +1.0%     +9.5%     0.010     0.010      0.0%
                    ...
              transform    -0.6%     -0.0%     -5.9%     -5.9%      0.0%
                    ...
        ------------------------------------------------------------------
                    Min    -2.3%    -23.8%    -18.6%    -18.6%    -16.7%
                    Max    +1.6%    +53.4%    +10.9%    +10.9%    +14.3%
         Geometric Mean    -0.3%     +1.9%     -0.8%     -0.8%     +0.0%
      
      (see P35 / https://phabricator.haskell.org/P35 for full report)
      
      By default, `INTEGER_LIBRARY=integer-gmp2` is active now, which results
      in the package `integer-gmp-1.0.0.0` being registered in the package db.
      The previous `integer-gmp-0.5.1.0` can be restored by setting
      `INTEGER_LIBRARY=integer-gmp` (but will probably be removed altogether
      for GHC 7.12). In-tree GMP support has been stolen from the old
      `integer-gmp` (while unpatching the custom memory-allocators, as well as
      forcing `-fPIC`)
      
      A minor hack to `ghc-cabal` was necessary in order to support two different
      `integer-gmp` packages (in different folders) with the same package key.
      
      There will be a couple of follow-up commits re-implementing some features
      that were dropped to keep D82 minimal, as well as further
      clean-ups/improvements.
      
      More information can be found via #9281 and
      https://ghc.haskell.org/trac/ghc/wiki/Design/IntegerGmp2
      
      Reviewed By: austin, rwbarton, simonmar
      
      Differential Revision: https://phabricator.haskell.org/D82
      c774b28f
  33. 07 Oct, 2014 1 commit
  34. 29 Aug, 2014 1 commit
    • Duncan Coutts's avatar
      Switch the package id types to use FastString (rather than String) · c72efd7c
      Duncan Coutts authored
      The conversions should now be correct w.r.t Unicode.
      
      Also move a couple instances to avoid orphan instances.
      
      Strictly speaking there's no need for these types to use FastString as
      they do not need the unique feature. They could just use some other
      compact string type, but ghc's internal utils don't have much support
      for such a type, so we just use FastString.
      c72efd7c
  35. 05 Aug, 2014 1 commit
    • Edward Z. Yang's avatar
      Package keys (for linking/type equality) separated from package IDs. · 66218d15
      Edward Z. Yang authored
      This patch set makes us no longer assume that a package key is a human
      readable string, leaving Cabal free to "do whatever it wants" to allocate
      keys; we'll look up the PackageId in the database to display to the user.
      This also means we have a new level of qualifier decisions to make at the
      package level, and rewriting some Safe Haskell error reporting code to DTRT.
      
      Additionally, we adjust the build system to use a new ghc-cabal output
      Make variable PACKAGE_KEY to determine library names and other things,
      rather than concatenating PACKAGE/VERSION as before.
      
      Adds a new `-this-package-key` flag to subsume the old, erroneously named
      `-package-name` flag, and `-package-key` to select packages by package key.
      
      RFC: The md5 hashes are pretty tough on the eye, as far as the file
      system is concerned :(
      
      ToDo: safePkg01 test had its output updated, but the fix is not really right:
      the rest of the dependencies are truncated due to the fact the we're only
      grepping a single line, but ghc-pkg is wrapping its output.
      
      ToDo: In a later commit, update all submodules to stop using -package-name
      and use -this-package-key.  For now, we don't do it to avoid submodule
      explosion.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, carter
      
      Differential Revision: https://phabricator.haskell.org/D80
      66218d15
  36. 21 Jul, 2014 1 commit
    • Edward Z. Yang's avatar
      Rename PackageId to PackageKey, distinguishing it from Cabal's PackageId. · 4bebab25
      Edward Z. Yang authored
      Summary:
      Previously, both Cabal and GHC defined the type PackageId, and we expected
      them to be roughly equivalent (but represented differently).  This refactoring
      separates these two notions.
      
      A package ID is a user-visible identifier; it's the thing you write in a
      Cabal file, e.g. containers-0.9.  The components of this ID are semantically
      meaningful, and decompose into a package name and a package vrsion.
      
      A package key is an opaque identifier used by GHC to generate linking symbols.
      Presently, it just consists of a package name and a package version, but
      pursuant to #9265 we are planning to extend it to record other information.
      Within a single executable, it uniquely identifies a package.  It is *not* an
      InstalledPackageId, as the choice of a package key affects the ABI of a package
      (whereas an InstalledPackageId is computed after compilation.)  Cabal computes
      a package key for the package and passes it to GHC using -package-name (now
      *extremely* misnamed).
      
      As an added bonus, we don't have to worry about shadowing anymore.
      
      As a follow on, we should introduce -current-package-key having the same role as
      -package-name, and deprecate the old flag.  This commit is just renaming.
      
      The haddock submodule needed to be updated.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, carter
      
      Differential Revision: https://phabricator.haskell.org/D79
      
      Conflicts:
      	compiler/main/HscTypes.lhs
      	compiler/main/Packages.lhs
      	utils/haddock
      4bebab25