1. 12 Jun, 2015 11 commits
  2. 09 Jun, 2015 11 commits
  3. 04 Jun, 2015 2 commits
  4. 02 Jun, 2015 13 commits
    • rwbarton's avatar
      Detabify a programlisting in the User's Guide (#10425) · 77b55b8a
      rwbarton authored
      (cherry picked from commit 5688053a)
    • Joachim Breitner's avatar
      newTempName: Do not include pid in basename · 1ff03e46
      Joachim Breitner authored
      The filename of temporary files, especially the basename of C files, can
      end up in the output in some form, e.g. as part of linker debug
      information. In the interest of bit-wise exactly reproducible
      compilation (#4012), the basename of the temporary file no longer
      contains random information (it used to ontain the process id).
      This is ok, as the temporary directory used contains the pid (see
      This patch has been applied to the Debian package (version 7.10.1-5) and
      allowed a fully bit-wise reproducible build:
      Reviewed By: austin, rwbarton
      Differential Revision: https://phabricator.haskell.org/D910
      GHC Trac Issues: #4012
      (cherry picked from commit 7a82b776)
    • Alan Zimmerman's avatar
      ApiAnnotations : rationalise tests · b57348fd
      Alan Zimmerman authored
      At the moment the API Annotations tests have a driver that has been
      copy/pasted multiple times.
      Compile it once, and run it for each test case.
      Test Plan: ./validate
      Reviewers: hvr, austin
      Reviewed By: austin
      Subscribers: bgamari, thomie
      Differential Revision: https://phabricator.haskell.org/D913
      GHC Trac Issues: #10452
      (cherry picked from commit e00910b0)
    • Austin Seipp's avatar
      compiler: make sure we reject -O + HscInterpreted · 20d33af1
      Austin Seipp authored
      When using GHCi, we explicitly reject optimization, because the
      compilers optimization passes can introduce unboxed tuples, which the
      interpreter is not able to handle. But this goes the other way too: using
      GHCi on optimized code may cause the optimizer to float out breakpoints
      that the interpreter introduces. This manifests itself in weird ways,
      particularly if you as an API client use custom DynFlags to introduce
      optimization in combination with HscInterpreted.
      It turns out we weren't checking for consistent DynFlag settings when
      doing `setSessionDynFlags`, as #10052 showed. While the main driver
      handled it in `DynFlags` via `parseDynamicFlags`, we didn't check this
      This does a little refactoring to split out some of the common code, and
      immunizes the various `DynFlags` utilities in the `GHC` module from this
      particular bug. We should probably be checking other general invariants
      This fixes #10052, and adds some notes about the behavior in `GHC` and
      As a bonus, expose `warningMsg` from `ErrUtils` as a helper since it
      didn't exist (somehow).
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      Reviewed By: edsko
      Differential Revision: https://phabricator.haskell.org/D727
      GHC Trac Issues: #10052
      (cherry picked from commit 091944e3)
    • Iavor S. Diatchki's avatar
      Rename tests so that they have a unique name. · 763936c2
      Iavor S. Diatchki authored
      (cherry picked from commit 3b90d8c8)
    • Joachim Breitner's avatar
      Rename new T9858d to T9858e to avoid test name clash · 28943a89
      Joachim Breitner authored
      (Next time, when fixing someone else’s mistake, I really shouldn’t do
      the precise same thing.)
      (cherry picked from commit a55bfabb)
    • Joachim Breitner's avatar
      Rename new T9858c to T9858d to avoid test name clash · b980228a
      Joachim Breitner authored
      (cherry picked from commit 43d71373)
    • Austin Seipp's avatar
    • Austin Seipp's avatar
      compiler: kill a stray pprTrace in OccName · 91324d46
      Austin Seipp authored
      Left in by c89bd681
      , and otherwise rather annoying during the build!
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      (cherry picked from commit 4d6c0ee1)
    • Austin Seipp's avatar
      testsuite: commit missing T4945 stdout · 452e3367
      Austin Seipp authored
      Simon apparently forgot this it seems.
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      (cherry picked from commit 7d519dab)
    • Simon Peyton Jones's avatar
      Fix a huge space leak in the mighty Simplifier · 8af219ad
      Simon Peyton Jones authored
      This long-standing, terrible, adn somewhat subtle bug was exposed
      by Trac #10370, thanks to Reid Barton's brilliant test case (comment:3).
      The effect is large on the Trac #10370 test.
      Here is what the profile report says:
       total time  =       24.35 secs   (24353 ticks @ 1000 us, 1 processor)
       total alloc = 11,864,360,816 bytes  (excludes profiling overheads)
       total time  =       21.16 secs   (21160 ticks @ 1000 us, 1 processor)
       total alloc = 7,947,141,136 bytes  (excludes profiling overheads)
      The /combined/ effect of the tidyOccName fix, plus this one, is dramtic
      for Trac #10370.  Here is what +RTS -s says:
        15,490,210,952 bytes allocated in the heap
         1,783,919,456 bytes maximum residency (20 sample(s))
        MUT     time   30.117s  ( 31.383s elapsed)
        GC      time   90.103s  ( 90.107s elapsed)
        Total   time  120.843s  (122.065s elapsed)
         7,928,671,936 bytes allocated in the heap
            52,914,832 bytes maximum residency (25 sample(s))
        MUT     time   13.912s  ( 15.110s elapsed)
        GC      time    6.809s  (  6.808s elapsed)
        Total   time   20.789s  ( 21.954s elapsed)
      - Heap allocation halved
      - Residency cut by a factor of more than 30.
      - ELapsed time cut by a factor of 6
      Not bad!
      The details
      The culprit was SimplEnv.mkCoreSubst, which used mapVarEnv to do some
      impedence-matching from the substitituion used by the simplifier to
      the one used by CoreSubst.  But the impedence-mactching was recursive!
        mk_subst tv_env cv_env id_env
          = CoreSubst.mkSubst in_scope tv_env cv_env (mapVarEnv fiddle id_env)
        fiddle (DoneEx e)          = e
        fiddle (DoneId v)          = Var v
        fiddle (ContEx tv cv id e) = CoreSubst.substExpr (mk_subst tv cv id) e
      Inside fiddle, in the ContEx case, we may do another whole level of
      fiddle.  And so on.  Moreover, UniqFM (which is built on Data.IntMap) is
      strict, so the fiddling is done eagerly.  I didn't wok through all the
      details but the result is a gargatuan blow-up of entirely unnecessary work.
      Laziness would make this go away, I think, but I don't want to mess
      with IntMap.  And in any case, the impedence matching is a royal pain.
      In the end I simply ceased trying to use CoreSubst.substExpr in the
      simplifier, and instead just use simplExpr.  That does mean bit of
      duplication; e.g.  new code for simplRules.  But it's not a big deal
      and it's far more direct and easy to reason about.
      A bit of knock-on refactoring:
       * Data type ArgSummary moves to CoreUnfold.
       * interestingArg moves from CoreUnfold to SimplUtils, and gets a
         SimplEnv argument which can be used when we encounter a variable.
       * simplLamBndrs, addBndrRules move from SimplEnv to Simplify
         (because they now calls simplUnfolding, simplRules resp)
       * SimplUtils.substExpr, substUnfolding, mkCoreSubst die completely
       * In Simplify some several functions that were previously pure
         substitution-based functions are now monadic:
           - addBndrRules, simplRule
           - addCoerce, add_coerce in simplCast
       * In case 2c of Simplify.rebuildCase, there was a pretty disgusting
         expression-substitution taking place for 'rhs'; and we really don't
         want to make that monadic becuase 'rhs' can be big.
         Solution: reduce the arity of the rules for seq.
         See Note [User-defined RULES for seq] in MkId.
      (cherry picked from commit 45d9a15c)
    • Simon Peyton Jones's avatar
      Fix quadratic behaviour in tidyOccName · 9b406cc6
      Simon Peyton Jones authored
      In the test program from comment:3 of Trac #10370, it turned out
      that 25% of all compile time was going in OccName.tidyOccName!
      It was all becuase the algorithm for finding an unused OccName
      had a quadratic case.
      This patch fixes it.  THe effect is pretty big:
      	total time  =       34.30 secs   (34295 ticks @ 1000 us, 1 processor)
      	total alloc = 15,496,011,168 bytes  (excludes profiling overheads)
      	total time  =       25.41 secs   (25415 ticks @ 1000 us, 1 processor)
      	total alloc = 11,812,744,816 bytes  (excludes profiling overheads)
      (cherry picked from commit c89bd681)
    • Simon Peyton Jones's avatar
      Reduce magic for seqId · cf9f638f
      Simon Peyton Jones authored
      An upcoming commit means that the RULES for 'seq' get only
      one value arg, not two.  This patch prepares for that by
      - reducing the arity of seq's built-in rule, to take one value arg
      - making 'seq' not inline on the LHS of RULES
      - and removing the horrid un-inlining in DsBinds.decomposeRuleLhs
      (cherry picked from commit eae703aa)
  5. 01 Jun, 2015 3 commits