1. 04 Jan, 2020 1 commit
  2. 02 Dec, 2019 1 commit
  3. 08 Dec, 2018 1 commit
  4. 17 Nov, 2018 1 commit
    • Andreas Klebinger's avatar
      NCG: New code layout algorithm. · 912fd2b6
      Andreas Klebinger authored
      Summary:
      This patch implements a new code layout algorithm.
      It has been tested for x86 and is disabled on other platforms.
      
      Performance varies slightly be CPU/Machine but in general seems to be better
      by around 2%.
      Nofib shows only small differences of about +/- ~0.5% overall depending on
      flags/machine performance in other benchmarks improved significantly.
      
      Other benchmarks includes at least the benchmarks of: aeson, vector, megaparsec, attoparsec,
      containers, text and xeno.
      
      While the magnitude of gains differed three different CPUs where tested with
      all getting faster although to differing degrees. I tested: Sandy Bridge(Xeon), Haswell,
      Skylake
      
      * Library benchmark results summarized:
        * containers: ~1.5% faster
        * aeson: ~2% faster
        * megaparsec: ~2-5% faster
        * xml library benchmarks: 0.2%-1.1% faster
        * vector-benchmarks: 1-4% faster
        * text: 5.5% faster
      
      On average GHC compile times go down, as GHC compiled with the new layout
      is faster than the overhead introduced by using the new layout algorithm,
      
      Things this patch does:
      
      * Move code responsilbe for block layout in it's own module.
      * Move the NcgImpl Class into the NCGMonad module.
      * Extract a control flow graph from the input cmm.
      * Update this cfg to keep it in sync with changes during
        asm codegen. This has been tested on x64 but should work on x86.
        Other platforms still use the old codelayout.
      * Assign weights to the edges in the CFG based on type and limited static
        analysis which are then used for block layout.
      * Once we have the final code layout eliminate some redundant jumps.
      
        In particular turn a sequences of:
            jne .foo
            jmp .bar
          foo:
        into
            je bar
          foo:
            ..
      
      Test Plan: ci
      
      Reviewers: bgamari, jmct, jrtc27, simonmar, simonpj, RyanGlScott
      
      Reviewed By: RyanGlScott
      
      Subscribers: RyanGlScott, trommler, jmct, carter, thomie, rwbarton
      
      GHC Trac Issues: #15124
      
      Differential Revision: https://phabricator.haskell.org/D4726
      912fd2b6
  5. 13 May, 2018 1 commit
    • David Feuer's avatar
      Remove unused things from utils/Digraph · cdbe00fe
      David Feuer authored
      `utils/Digraph` had a bunch of code that wasn't actually being used,
      much of which wasn't documented at all, some of which was clearly
      ill-considered, and some of which was documented as being inefficient.
      
      Remove all unused code from that module except for the obvious and
      innocuous `emptyG`.
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4676
      cdbe00fe
  6. 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
  7. 07 Sep, 2017 1 commit
  8. 11 May, 2017 1 commit
  9. 05 Apr, 2017 1 commit
  10. 09 Jan, 2017 1 commit
  11. 28 Nov, 2016 1 commit
  12. 23 Jun, 2016 1 commit
    • niteria's avatar
      Provide Uniquable version of SCC · 35d1564c
      niteria authored
      We want to remove the `Ord Unique` instance because there's
      no way to implement it in deterministic way and it's too
      easy to use by accident.
      
      We sometimes compute SCC for datatypes whose Ord instance
      is implemented in terms of Unique. The Ord constraint on
      SCC is just an artifact of some internal data structures.
      We can have an alternative implementation with a data
      structure that uses Uniquable instead.
      
      This does exactly that and I'm pleased that I didn't have
      to introduce any duplication to do that.
      
      Test Plan:
      ./validate
      I looked at performance tests and it's a tiny bit better.
      
      Reviewers: bgamari, simonmar, ezyang, austin, goldfire
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2359
      
      GHC Trac Issues: #4012
      35d1564c
  13. 11 May, 2016 1 commit
    • niteria's avatar
      Document SCC determinism · 3edbd091
      niteria authored
      I've documented the guarantees that stronglyConnCompFromEdgedVertices
      provides and commented on the call sites to explain why they are
      OK from determinism standpoint. I've changed the functions to
      nonDetUFM versions, so that it's explicit they could introduce
      nondeterminism.  I haven't defined container (VarSet, NameSet)
      specific versions, so that we have less functions to worry about.
      
      Test Plan: this is mostly just documentation,
      it should have no runtime effect
      
      Reviewers: bgamari, simonmar, austin, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2194
      
      GHC Trac Issues: #4012
      3edbd091
  14. 17 Nov, 2015 1 commit
  15. 22 Oct, 2015 1 commit
    • niteria's avatar
      Make stronglyConnCompFromEdgedVertices deterministic · 9cb192ce
      niteria authored
      This makes it so the result of computing SCC's depends on the order
      the nodes were passed to it, but not on the order on the user provided
      key type.
      The key type is usually `Unique` which is known to be nondeterministic.
      
      Test Plan:
      `text` and `aeson` become deterministic after this
      ./validate
      
      Compare compile time for `text`:
      ```
      $ cabal get text && cd text* && cabal sandbox init && cabal install
      --dependencies-only && time cabal build
      real    0m59.459s
      user    0m57.862s
      sys     0m1.185s
      $ cabal clean && time cabal build
      real    1m0.037s
      user    0m58.350s
      sys     0m1.199s
      $ cabal clean && time cabal build
      real    0m57.634s
      user    0m56.118s
      sys     0m1.202s
      $ cabal get text && cd text* && cabal sandbox init && cabal install
      --dependencies-only && time cabal build
      real    0m59.867s
      user    0m58.176s
      sys     0m1.188s
      $ cabal clean && time cabal build
      real    1m0.157s
      user    0m58.622s
      sys     0m1.177s
      $ cabal clean && time cabal build
      real    1m0.950s
      user    0m59.397s
      sys     0m1.083s
      ```
      
      Reviewers: ezyang, simonmar, austin, bgamari
      
      Reviewed By: simonmar, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1268
      
      GHC Trac Issues: #4012
      9cb192ce
  16. 21 Sep, 2015 1 commit
  17. 09 Mar, 2015 3 commits
  18. 03 Dec, 2014 1 commit
  19. 20 Jul, 2014 1 commit
  20. 06 Jun, 2014 1 commit
  21. 15 May, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Add LANGUAGE pragmas to compiler/ source files · 23892440
      Herbert Valerio Riedel authored
      In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been
      reorganized, while following the convention, to
      
      - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before
        any `{-# OPTIONS_GHC #-}`-lines.
      
      - Moreover, if the list of language extensions fit into a single
        `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one
        line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each
        individual language extension. In both cases, try to keep the
        enumeration alphabetically ordered.
        (The latter layout is preferable as it's more diff-friendly)
      
      While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma
      occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
      23892440
  22. 01 Oct, 2013 1 commit
  23. 23 Sep, 2013 1 commit
    • Simon Marlow's avatar
      Discard unreachable code in the register allocator (#7574) · f5879acd
      Simon Marlow authored
      The problem with unreachable code is that it might refer to undefined
      registers.  This happens accidentally: a block can be orphaned by an
      optimisation, for example when the result of a comparsion becomes
      known.
      
      The register allocator panics when it finds an undefined register,
      because they shouldn't occur in generated code.  So we need to also
      discard unreachable code to prevent this panic being triggered by
      optimisations.
      
      The register alloator already does a strongly-connected component
      analysis, so it ought to be easy to make it discard unreachable code
      as part of that traversal.  It turns out that we need a different
      variant of the scc algorithm to do that (see Digraph), however the new
      variant also generates slightly better code by putting the blocks
      within a loop in a better order for register allocation.
      f5879acd
  24. 22 Jun, 2012 1 commit
    • Ian Lynagh's avatar
      Remove some uses of sortLe · 0043f07a
      Ian Lynagh authored
      Technically the behaviour of sortWith has changed, as it used
          x `le` y = get_key x < get_key y
      (note "<" rather than "<="), but I assume that that was just a mistake.
      0043f07a
  25. 13 Jun, 2012 1 commit
    • Ian Lynagh's avatar
      Remove PlatformOutputable · d06edb8e
      Ian Lynagh authored
      We can now get the Platform from the DynFlags inside an SDoc, so we
      no longer need to pass the Platform in.
      d06edb8e
  26. 28 Mar, 2012 1 commit
    • Simon Peyton Jones's avatar
      Remove Show instance for Forest · 4ecfc7ff
      Simon Peyton Jones authored
      A Forest is just a list, and we have a Show instance for
      lists already.  We don't need a special Show instance for
      Forests.  If we change our minds we can add a newtype,
      but I don't think it's worth it.
      
      Fixes Trac #5960
      4ecfc7ff
  27. 04 Nov, 2011 1 commit
  28. 25 Aug, 2011 1 commit
  29. 22 Jul, 2011 1 commit
    • Simon Peyton Jones's avatar
      Implement a findCycle function in Digraph, · e8590218
      Simon Peyton Jones authored
      and use it to report module loops nicely
      
      This fixes Trac #5307. Now we get
      
          Module imports form a cycle:
                   module `M8' (.\M8.hs)
                  imports `M1' (M1.hs)
            which imports `M9' (.\M9.hs-boot)
            which imports `M8' (.\M8.hs)
      
      And the algorithm is linear time.
      e8590218
  30. 15 Jul, 2011 1 commit
    • Ian Lynagh's avatar
      More work towards cross-compilation · f07af788
      Ian Lynagh authored
      There's now a variant of the Outputable class that knows what
      platform we're targetting:
      
      class PlatformOutputable a where
          pprPlatform :: Platform -> a -> SDoc
          pprPlatformPrec :: Platform -> Rational -> a -> SDoc
      
      and various instances have had to be converted to use that class,
      and we pass Platform around accordingly.
      f07af788
  31. 15 Dec, 2010 1 commit
  32. 13 Sep, 2010 1 commit
  33. 07 Aug, 2008 1 commit
  34. 31 Jul, 2008 1 commit
  35. 29 Mar, 2008 1 commit
  36. 26 Jan, 2008 1 commit
  37. 17 Jan, 2008 1 commit
    • Isaac Dupree's avatar
      lots of portability changes (#1405) · 206b4dec
      Isaac Dupree authored
      re-recording to avoid new conflicts was too hard, so I just put it
      all in one big patch :-(  (besides, some of the changes depended on
      each other.)  Here are what the component patches were:
      
      Fri Dec 28 11:02:55 EST 2007  Isaac Dupree <id@isaac.cedarswampstudios.org>
        * document BreakArray better
      
      Fri Dec 28 11:39:22 EST 2007  Isaac Dupree <id@isaac.cedarswampstudios.org>
        * properly ifdef BreakArray for GHCI
      
      Fri Jan  4 13:50:41 EST 2008  Isaac Dupree <id@isaac.cedarswampstudios.org>
        * change ifs on __GLASGOW_HASKELL__ to account for... (#1405)
        for it not being defined. I assume it being undefined implies
        a compiler with relatively modern libraries but without most
        unportable glasgow extensions.
      
      Fri Jan  4 14:21:21 EST 2008  Isaac Dupree <id@isaac.cedarswampstudios.org>
        * MyEither-->EitherString to allow Haskell98 instance
      
      Fri Jan  4 16:13:29 EST 2008  Isaac Dupree <id@isaac.cedarswampstudios.org>
        * re-portabilize Pretty, and corresponding changes
      
      Fri Jan  4 17:19:55 EST 2008  Isaac Dupree <id@isaac.cedarswampstudios.org>
        * Augment FastTypes to be much more complete
      
      Fri Jan  4 20:14:19 EST 2008  Isaac Dupree <id@isaac.cedarswampstudios.org>
        * use FastFunctions, cleanup FastString slightly
      
      Fri Jan  4 21:00:22 EST 2008  Isaac Dupree <id@isaac.cedarswampstudios.org>
        * Massive de-"#", mostly Int# --> FastInt (#1405)
      
      Fri Jan  4 21:02:49 EST 2008  Isaac Dupree <id@isaac.cedarswampstudios.org>
        * miscellaneous unnecessary-extension-removal
      
      Sat Jan  5 19:30:13 EST 2008  Isaac Dupree <id@isaac.cedarswampstudios.org>
        * add FastFunctions
      206b4dec
  38. 16 Jan, 2008 1 commit