1. 26 Jan, 2018 6 commits
  2. 25 Jan, 2018 4 commits
    • Simon Peyton Jones's avatar
      Fix the lone-variable case in callSiteInline · 06366890
      Simon Peyton Jones authored
      See Note [Lone variables] in CoreUnfold and
      Note [exprIsExpandable] in CoreUtils.
      Helpfully pointed out by Matthew Pickering in Trac #14688
      Nofib results are good:
              Program           Size    Allocs   Runtime   Elapsed  TotalMem
                 anna          +0.1%     +0.3%     0.151     0.151      0.0%
               awards          +0.0%     -0.2%     0.001     0.001      0.0%
            compress2          +0.6%     -0.7%     -4.8%     -5.0%     -4.0%
                eliza          +0.0%     -2.4%     0.001     0.001      0.0%
               fulsom          +0.4%    -13.3%     -7.6%     -7.6%   +190.0%
               gamteb          +0.0%     -0.6%     0.062     0.062      0.0%
                   gg          +0.1%     -0.4%     0.016     0.016      0.0%
                  ida          +0.1%     +0.3%     0.110     0.110      0.0%
                kahan          +0.0%     -0.7%     -0.9%     -0.9%      0.0%
                 mate          +0.1%     -5.2%     -4.9%     -4.9%      0.0%
               n-body          +0.0%     -0.2%     -0.3%     -3.0%      0.0%
               pretty          +0.0%     -2.8%     0.000     0.000      0.0%
                  scs          +0.0%     -0.2%     +1.6%     +2.4%      0.0%
               simple          +0.4%     -0.2%     -2.3%     -2.3%     -3.4%
              veritas          +0.4%     -1.0%     0.003     0.003      0.0%
                 wang          +0.0%     -1.6%     0.165     0.165      0.0%
                  Min          -0.0%    -13.3%    -16.2%    -18.8%     -4.0%
                  Max          +0.6%     +0.3%     +4.9%     +4.9%   +190.0%
       Geometric Mean          +0.1%     -0.3%     -1.7%     -2.4%     +0.9%
    • Simon Peyton Jones's avatar
      Comments only · 2a2e6a8f
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Remove dead code: mkNthCoRole · 076bdb36
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Comments about CoercionHoles · d36ae5d6
      Simon Peyton Jones authored
      Richard was confused; I hope these comments help.
  3. 23 Jan, 2018 1 commit
    • niteria's avatar
      Allocate less in plus_mod_dep · f00ddea9
      niteria authored
      This gives a 10% allocation improvement on MultiLayerModules.
      The idea is to reuse existing tuples, instead of constantly
      constructing new ones.
      Test Plan: ./validate
      Reviewers: simonpj, bgamari
      Reviewed By: simonpj, bgamari
      Subscribers: rwbarton, thomie, simonmar, carter
      Differential Revision: https://phabricator.haskell.org/D4332
  4. 22 Jan, 2018 4 commits
    • Ryan Scott's avatar
      Pass -dsuppress-uniques when running T14507 · 452dee3f
      Ryan Scott authored
      Not doing so resulted in different uniques being printed on different
      environments, as shown in #14703.
    • Simon Peyton Jones's avatar
    • Ben Gamari's avatar
      Bump transformers submodule to · 24e56ebd
      Ben Gamari authored
    • Oleg Grenrus's avatar
      Update Cabal submodule · 2671cccd
      Oleg Grenrus authored
      - Cabal-2.2 uses SPDX license identifiers, so I had to update
        `cabal-version: 2.1` packages `license: BSD3` to `license: BSD-3-Clause`
      - `ghc-cabal` used old ReadP parsec, now it uses `parsec` too
      - InstalledPackageInfo pretty-printing have changed a little,
        fields with default values aren't printed. This can be changed in
        `Cabal` still, but I haven't found problems with omitting them.
      Note: `BSD-3-Clause` is parsed as "name = BSD, version = 3" by old
      parser (because 3-Clause looks like version 3 with tag Clause).
      If you see *"BSD-3" is not a valid license*, then something is using
      old parser still.
      Fixes #9885.
  5. 21 Jan, 2018 8 commits
    • Ben Gamari's avatar
      SysTools: Add detection support for LLD linker · 6c0db98b
      Ben Gamari authored
      I noticed while trying to test against LLVM 5.0 that GHC would throw "Couldn't
      figure out linker information" warnings due to LLD being chosen by configure.
      Adding detection support to silence these is simple enough, let's just do it.
    • niteria's avatar
      Use IntSet in Dataflow · 88297438
      niteria authored
      Before this change, a list was used as a substitute for a heap.
      This led to quadratic behavior on a simple program (see new
      test case).
      This change replaces it with IntSet in effect reverting
      5a1a2633. @simonmar said it's fine to revert as long as nofib
      results are good.
      Test Plan:
      new test case:
      20% improvement
      3x improvement when N=10000
      I run it twice for before and after because the compile time
      results are noisy.
      - Compile Allocations:
                before    before re-run    after     after re-run
      -1 s.d.   -----     -0.0%            -0.1%     -0.1%
      +1 s.d.   -----     +0.0%            +0.1%     +0.1%
      Average   -----     +0.0%            -0.0%     -0.0%
      - Compile Time:
                before    before re-run    after     after re-run
      -1 s.d.   -----     -0.1%            -2.3%     -2.6%
      +1 s.d.   -----     +5.2%            +3.7%     +4.4%
      Average   -----     +2.5%            +0.7%     +0.8%
      I checked each case and couldn't find consistent slow-down/speed-up on
      compile time. Full results here: P173
      Reviewers: simonpj, simonmar, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter, simonmar
      GHC Trac Issues: #14667
      Differential Revision: https://phabricator.haskell.org/D4329
    • Takenobu Tani's avatar
      Implement underscores in numeric literals (NumericUnderscores extension) · 4a13c5b1
      Takenobu Tani authored
      Implement the proposal of underscores in numeric literals.
      Underscores in numeric literals are simply ignored.
      The specification of the feature is available here:
      For a discussion of the various choices:
      Implementation detail:
      * Added dynamic flag
        * `NumericUnderscores` extension flag is added for this feature.
      * Alex "Regular expression macros" in Lexer.x
        * Add `@numspc` (numeric spacer) macro to represent multiple
        * Modify `@decimal`, `@decimal`, `@binary`, `@octal`, `@hexadecimal`,
          `@exponent`, and `@bin_exponent` macros to include `@numspc`.
      * Alex "Rules" in Lexer.x
        * To be simpler, we have only the definitions with underscores.
          And then we have a separate function (`tok_integral` and `tok_frac`)
          that validates the literals.
      * Validation functions in Lexer.x
        * `tok_integral` and `tok_frac` functions validate
          whether contain underscores or not.
          If `NumericUnderscores` extensions are not enabled,
          check that there are no underscores.
        * `tok_frac` function is created by merging `strtoken` and
        * `init_strtoken` is deleted. Because it is no longer used.
      * Remove underscores from target literal string
        * `parseUnsignedInteger`, `readRational__`, and `readHexRational} use
          the customized `span'` function to remove underscores.
      * Added Testcase
        * testcase for NumericUnderscores enabled.
            NumericUnderscores0.hs and NumericUnderscores1.hs
        * testcase for NumericUnderscores disabled.
            NoNumericUnderscores0.hs and NoNumericUnderscores1.hs
        * testcase to invalid pattern for NumericUnderscores enabled.
            NumericUnderscoresFail0.hs and NumericUnderscoresFail1.hs
      Test Plan: `validate` including the above testcase
      Reviewers: goldfire, bgamari
      Reviewed By: bgamari
      Subscribers: carter, rwbarton, thomie
      GHC Trac Issues: #14473
      Differential Revision: https://phabricator.haskell.org/D4235
    • Douglas Wilson's avatar
      [rts] Adjust whitehole_spin · 180ca65f
      Douglas Wilson authored
      Rename to whitehole_gc_spin, in preparation for adding stats for the
      whitehole busy-loop in SMPClosureOps.
      Make whitehole_gc_spin volatile, and move it to be defined and
      statically initialised in GC.c. This saves some #ifs, and I'm pretty
      sure it should be volatile.
      Test Plan: ./validate
      Reviewers: bgamari, erikd, simonmar
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4300
    • Alp Mestanogullari's avatar
      tentative improvement to callstack docs · 5edb18a9
      Alp Mestanogullari authored
      This is an attempt at clarifying the docs for HasCallStack in both the
      user guide and libraries/base/GHC/Stack/Types.hs. The example used right
      now is built around an hypothetical 'error' function that doesn't itself
      print call stacks, and the fact that this doesn't hold makes it all
      confusing, see #14635.
      Reviewers: hvr, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #14635
      Differential Revision: https://phabricator.haskell.org/D4317
    • Ryan Scott's avatar
      Fix #14692 by correcting an off-by-one error in TcGenDeriv · 0074a08e
      Ryan Scott authored
      A silly mistake in `gen_Show_binds` was causing derived
      `Show` instances for empty data types to case on the precedence
      argument instead of the actual value being showed.
      Test Plan: make test TEST=drv-empty-data
      Reviewers: bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #14692
      Differential Revision: https://phabricator.haskell.org/D4328
    • Ben Gamari's avatar
      testsuite: Add testcase for #14670 · 765ba657
      Ben Gamari authored
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #14670
      Differential Revision: https://phabricator.haskell.org/D4314
    • John Ky's avatar
      Add new mbmi and mbmi2 compiler flags · f8557696
      John Ky authored
      This adds support for the bit deposit and extraction operations provided
      by the BMI and BMI2 instruction set extensions on modern amd64 machines.
      Implement x86 code generator for pdep and pext.  Properly initialise
      bmiVersion field.
      pdep and pext test cases
      Fix pattern match for pdep and pext instructions
      Fix build of pdep and pext code for 32-bit architectures
      Test Plan: Validate
      Reviewers: austin, simonmar, bgamari, angerman
      Reviewed By: bgamari
      Subscribers: trommler, carter, angerman, thomie, rwbarton, newhoggy
      GHC Trac Issues: #14206
      Differential Revision: https://phabricator.haskell.org/D4236
  6. 18 Jan, 2018 8 commits
  7. 17 Jan, 2018 1 commit
  8. 15 Jan, 2018 8 commits
    • niteria's avatar
      Fix quadratic behavior of prepareAlts · cf2c029c
      niteria authored
      This code is quadratic and a simple test case I used
      managed to tickle it.
      The example (same one as #14667) looks like this:
      module A10000 where
       data A = A
         | A00001
         | A00002
         | A10000
       f :: A -> Int
       f A00001 = 19900001
       f A00002 = 19900002
       f A10000 = 19910000
      Applied on top of a fix for #14667, it gives a 30% compile time
      Test Plan: ./validate
      Reviewers: simonpj, bgamari
      Subscribers: rwbarton, thomie, simonmar, carter
      Differential Revision: https://phabricator.haskell.org/D4307
    • John Ericson's avatar
      configure: Various cleanups · 8de89305
      John Ericson authored
      Substitute RanlibCmd for consistency, and other configure cleanups that
      should have no effect
      The other commands are so substituted. Maybe we don't need ranlib at
      all, and the configure snippet can be removed all together, but that
      can always be done later.
      Reviewers: bgamari, hvr, angerman
      Reviewed By: bgamari, angerman
      Subscribers: rwbarton, thomie, erikd, carter
      Differential Revision: https://phabricator.haskell.org/D4286
    • Andreas Klebinger's avatar
      Simplify guard in createSwitchPlan. · bc383f20
      Andreas Klebinger authored
      Given that we have two unique keys (guaranteed by Map) checking that
      `|range| == 1` is faster.
      The fact that `x1 == lo` and `x2 == hi` is guaranteed by mkSwitchTargets
      which removes values outside of the range.
      Test Plan: ci
      Reviewers: bgamari, simonmar
      Reviewed By: simonmar
      Subscribers: rwbarton, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4295
    • Andreas Klebinger's avatar
      Remove executable filename check on windows · 1bf70b20
      Andreas Klebinger authored
      On Windows GHC enforces currently that the real executable is named
      I don't see a good reason why this is neccessary.
      This patch removes this restriction and fixes #14652
      Test Plan: ci
      Reviewers: bgamari, Phyx
      Reviewed By: Phyx
      Subscribers: Phyx, rwbarton, thomie, carter
      GHC Trac Issues: #14652
      Differential Revision: https://phabricator.haskell.org/D4296
    • Ryan Scott's avatar
      Parenthesize forall-type args in cvtTypeKind · f380115c
      Ryan Scott authored
      Trac #14646 happened because we forgot to parenthesize `forall` types to
      the left of an arrow. This simple patch fixes that.
      Test Plan: make test TEST=T14646
      Reviewers: alanz, goldfire, bgamari
      Reviewed By: alanz
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #14646
      Differential Revision: https://phabricator.haskell.org/D4298
    • Matthew Pickering's avatar
      Add flag -fno-it · 41afbb3f
      Matthew Pickering authored
      This flag stops ghci creating the special variable `it`
      after evaluating an expression. This stops ghci leaking
      as much memory when evaluating expressions. See #14336
      Reviewers: bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #14336
      Differential Revision: https://phabricator.haskell.org/D4299
    • Tao He's avatar
      Fix hash in haddock of ghc-prim. · 2feed118
      Tao He authored
      Reviewers: bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #14653
      Differential Revision: https://phabricator.haskell.org/D4305
    • Ömer Sinan Ağacan's avatar
      CoreLint: typo in a comment · 78306b53
      Ömer Sinan Ağacan authored
      Reviewers: bgamari, goldfire
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4308