1. 13 Feb, 2017 1 commit
  2. 12 Feb, 2017 15 commits
    • Ben Gamari's avatar
      Bump hoopl submodule to · e46a2e16
      Ben Gamari authored
    • alexbiehl's avatar
      Binary: Correct endian issue when cross-compiling · d3ea38ef
      alexbiehl authored
      Using `WORDS_BIGENDIAN` wasn't such a great idea after all!
      When cross compiling host and target endianess may differ and
      `WORDS_BIGENDIAN` refers to host endianess.
      Reviewers: austin, bgamari, trofi
      Reviewed By: bgamari, trofi
      Subscribers: rwbarton, trofi, thomie
      Differential Revision: https://phabricator.haskell.org/D3122
    • olsner's avatar
      Apply SplitSections to all C compilations · a50082c1
      olsner authored
      Previously this was added only to the RTS's C files (those are the bulk
      of it though), but there are C bits in ghc-prim, integer-gmp and base
      Followup for #8405, allows the large table of character properties in
      base to be stripped when not used.
      Test Plan: validate
      Reviewers: austin, bgamari, simonmar
      Reviewed By: bgamari
      Subscribers: thomie, snowleopard
      Differential Revision: https://phabricator.haskell.org/D3121
    • Niklas Hambüchen's avatar
      bufWrite: Save extra syscall when data fills handle buffer completely. · 6b4e46a1
      Niklas Hambüchen authored
      The bug is that the check `if (size - w > count)` should be
      `if (size - w >= count)` instead (`>=` instead of `>`),
      because we can do the write all fine if it fits exactly.
      This allows us to do 1 instead of 2 write syscalls the case it fits.
      An example of when this matters is when an application writes output
      in chunks that are a fraction of the handle buffer size.
      For example, assume the buffer size is 8 KB, and the application writes
      four 2 KB chunks.
      Until now, this would result in 3 copies to the handle buffer, but
      the 4th one would not be allowed in by `size - w > count`
      (because `size - w == count` is the case), so we'd end up with a write
      syscall of only 6 KB data instead of 8 KB, thus creating more syscalls
      Implementing this fix (switching to `size - w >= count`), we also have
      to flush the buffer if we fill it completely.
      If we made only the changes described so far, that would have the
      unintended side effect that writes of the size equal to the handle
      buffer size (`count == size`) suddenly also go to the handle buffer
      first: The data would first be copied to the handle buffer, and then
      immediately get flushed to the underlying FD.  We don't want that extra
      `memcpy`, because it'd be unnecessary: The point of handle buffering is
      to coalesce smaller writes, and there are no smaller writes in this
      case.  For example, if you specify 8 KB buffers (which menas you want
      your data to be written out in 8 KB blocks), and you get data that's
      already 8 KB in size, you can write that out as an 8 KB straight away,
      zero-copy fashion.  For this reason, adding to the handle buffer now got
      an additional condition `count < size`.  That way, writes equal to the
      buffer size go straight to the FD, as they did before this commit.
      Reviewers: simonmar, austin, hvr, bgamari
      Reviewed By: simonmar
      Subscribers: mpickering, thomie
      Differential Revision: https://phabricator.haskell.org/D3117
    • Niklas Hambüchen's avatar
      Fix: hPutBuf issues unnecessary empty write syscalls for large writes (#13246) · 805db965
      Niklas Hambüchen authored
      Until now, any `hPutBuf` that wrote `>= the handle buffer size` would
      trigger an unnecessary `write("")` system call before the actual write
      system call.
      This is fixed by making sure that we never flush an empty handle buffer:
      Only flush `when (w > 0)`.
      Reviewers: simonmar, austin, hvr, bgamari
      Reviewed By: bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D3119
    • Niklas Hambüchen's avatar
      Fix: Default FD buffer size is not a power of 2 (#13245) · 4e2e9b73
      Niklas Hambüchen authored
      Reviewers: simonmar, austin, hvr, bgamari
      Reviewed By: bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D3115
    • David Feuer's avatar
      Avoid repeated list elem checks · 7938ef23
      David Feuer authored
      Convert a list to a set before testing membership multiple times.
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3111
    • alexbiehl's avatar
      Binary: Only allocate un-interned FastStrings · 64da671a
      alexbiehl authored
      Test Plan: Validate
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D3109
    • Christiaan Baaij's avatar
      zonkCt tries to maintain the canonical form of a Ct. · 07292e95
      Christiaan Baaij authored
      For example,
       - a CDictCan should stay a CDictCan;
       - a CTyEqCan should stay a CTyEqCan (if the LHS stays as a variable.).
       - a CHoleCan should stay a CHoleCan
      Why?  For CDicteqCan see Trac #11525.
      Test Plan: Validate
      Reviewers: austin, adamgundry, simonpj, goldfire, bgamari
      Reviewed By: simonpj, bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D3105
    • Ben Gamari's avatar
      rts/Profiling: Factor out report generation · 56c9bb39
      Ben Gamari authored
      Here we move the actual report generation logic to
      `rts/ProfilerReport.c`. This break is actually quite clean,
          void writeCCSReport( FILE *prof_file, CostCentreStack const *ccs,
                               ProfilerTotals totals );
      This is more profiler refactoring in preparation for machine-readable
      Test Plan: Validate
      Reviewers: austin, erikd, simonmar
      Reviewed By: simonmar
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D3097
    • Ben Gamari's avatar
      rts/Profiling: Kill a few globals and add consts · 1a14d384
      Ben Gamari authored
      Previously it was quite difficult to follow the dataflow through this
      file due to global mutation and rather non-descriptive types.
      This is a cleanup in preparation for factoring out the report-generating
      logic, which is itself in preparation for somedayteaching the profiler
      to produce more machine-readable reports (JSON perhaps?).
      Test Plan: Validate
      Reviewers: austin, erikd, simonmar
      Reviewed By: simonmar
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D3096
    • Edward Z. Yang's avatar
      Fix #13214 by correctly setting up dep_orphs for signatures. · 26eaa7ec
      Edward Z. Yang authored
      Prior to this, I hadn't thought about orphan handling at all.
      This commit implements the semantics that if a signature
      (transitively) imports an orphan instance, that instance
      is considered in scope no matter what the implementing module
      is.  (As it turns out, this is the semantics that falls out
      when orphans are recorded transitively.)
      This patch fixes a few bugs:
      1. Put semantic modules in dep_orphs rather than identity
      2. Don't put the implementing module in dep_orphs when
         merging signatures (this is a silly bug that happened
         because we were reusing calculateAvails, which is
         designed for imports. It mostly works for signature
         merging, except this case.)
      3. When renaming a signature, blast in the orphans of the
         implementing module inside Dependencies.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      Test Plan: validate
      Reviewers: bgamari, austin
      Reviewed By: bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D3095
    • Joachim Breitner's avatar
      Improve the Occurrence Analyzer’s handling of one-shot functions · a1980ecb
      Joachim Breitner authored
      When determining whether an expression is used saturatedly, count the
      number of value arguments that the occurrence analyser sees, and add
      the number of one-shot arguments that we know (from the strictness
      analyser) are passed from the context.
      perf results suggest no noticable change in allocations, reduction of
      code sizes, and performance regression possibliy due to loss of join
      Test Plan: perf.haskell.org
      Reviewers: simonpj, austin, bgamari
      Reviewed By: bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D3089
    • rwbarton's avatar
      Mark orphan instances and rules in --show-iface output · 17b1e0ba
      rwbarton authored
      Test Plan: new test Orphans
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D3086
    • Ben Gamari's avatar
      Dwarf.Types: Use DW_CFA_same_value encoding when possible · 7fac7cdc
      Ben Gamari authored
      This is a bit smaller than the alternative, DW_CFA_val_expression. Also
      a bit of refactoring.
      Test Plan: Validate
      Reviewers: scpmw, simonmar, austin
      Reviewed By: simonmar
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D2745
  3. 11 Feb, 2017 1 commit
  4. 10 Feb, 2017 6 commits
    • Ryan Scott's avatar
      Refactor DeriveAnyClass's instance context inference · 639e702b
      Ryan Scott authored
      Currently, `DeriveAnyClass` has two glaring flaws:
      * It only works on classes whose argument is of kind `*` or `* -> *` (#9821).
      * The way it infers constraints makes no sense. It basically co-opts the
        algorithms used to infer contexts for `Eq` (for `*`-kinded arguments) or
        `Functor` (for `(* -> *)`-kinded arguments). This tends to produce overly
        constrained instances, which in extreme cases can lead to legitimate things
        failing to typecheck (#12594). Or even worse, it can trigger GHC panics
        (#12144 and #12423).
      This completely reworks the way `DeriveAnyClass` infers constraints to fix
      these two issues. It now uses the type signatures of the derived class's
      methods to infer constraints (and to simplify them). A high-level description
      of how this works is included in the GHC users' guide, and more technical notes
      on what is going on can be found as comments (and a Note) in `TcDerivInfer`.
      Fixes #9821, #12144, #12423, #12594.
      Test Plan: ./validate
      Reviewers: dfeuer, goldfire, simonpj, austin, bgamari
      Subscribers: dfeuer, thomie
      Differential Revision: https://phabricator.haskell.org/D2961
    • Facundo Domínguez's avatar
      Relax test TH_addCStub2 so it succeeds on travis. · e79ef75d
      Facundo Domínguez authored
      Test Plan: ./validate
      Reviewers: bgamari, nomeata, austin, mpickering
      Reviewed By: mpickering
      Subscribers: mpickering, rwbarton, mboes, thomie
      Differential Revision: https://phabricator.haskell.org/D3124
    • Ryan Scott's avatar
      Prevent Template Haskell splices from throwing a spurious TypeInType error · 283a3465
      Ryan Scott authored
      There was a rather annoying corner case where splicing poly-kinded
      Template Haskell declarations could trigger an error muttering about
      `TypeInType` not being enabled, whereas the equivalent non-TH code would
      compile without issue. This was causing by overzealous validity check in the
      renamer, wherein failed to distinguish between two different `Exact` names
      with the same `OccName`. As a result, it mistakenly believed some type
      variables were being used as both type and kind variables simultaneously! Ack.
      This avoids the issue by simply disabling the aforementioned validity check
      for Exact names. Fixes #12503.
      Test Plan: ./validate
      Reviewers: austin, bgamari, goldfire
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D3022
    • Simon Peyton Jones's avatar
      Change rewritableTyVarsOfType to anyRewritableTyVar · 76244ec2
      Simon Peyton Jones authored
      This fixes the regression in FrozenErrorTests, eliminates the
      awkward "crash on forall" in rewritableTyVars, and makes it more
      efficient too.
    • Gabor Greif's avatar
      Spelling in comments [ci skip] · 3211fa06
      Gabor Greif authored
    • Alan Zimmerman's avatar
      TH-spliced class instances are pretty-printed incorrectly post-#3384 · 258c7195
      Alan Zimmerman authored
      The HsSyn prettyprinter tests patch 499e4382
      broke the pretty-printing of Template Haskell-spliced class instances.
      Test Plan: ./validate
      Reviewers: RyanGlScott, austin, goldfire, bgamari
      Reviewed By: RyanGlScott, bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D3043
  5. 09 Feb, 2017 9 commits
  6. 08 Feb, 2017 8 commits