1. 27 Jul, 2015 1 commit
  2. 22 Jul, 2015 1 commit
    • Simon Marlow's avatar
      Eliminate zero_static_objects_list() · b949c96b
      Simon Marlow authored
      Summary:
      In a workload with a large amount of code, zero_static_objects_list()
      takes a significant amount of time, and furthermore it is in the
      single-threaded part of the GC.
      
      This patch uses a slightly fiddly scheme for marking objects on the
      static object lists, using a flag in the low 2 bits that flips between
      two states to indicate whether an object has been visited during this
      GC or not.  We also have to take into account objects that have not
      been visited yet, which might appear at any time due to runtime linking.
      
      Test Plan: validate
      
      Reviewers: austin, bgamari, ezyang, rwbarton
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1076
      b949c96b
  3. 16 Dec, 2014 1 commit
    • Peter Wortmann's avatar
      Tick scopes · 5fecd767
      Peter Wortmann authored
      This patch solves the scoping problem of CmmTick nodes: If we just put
      CmmTicks into blocks we have no idea what exactly they are meant to
      cover.  Here we introduce tick scopes, which allow us to create
      sub-scopes and merged scopes easily.
      
      Notes:
      
      * Given that the code often passes Cmm around "head-less", we have to
        make sure that its intended scope does not get lost. To keep the amount
        of passing-around to a minimum we define a CmmAGraphScoped type synonym
        here that just bundles the scope with a portion of Cmm to be assembled
        later.
      
      * We introduce new scopes at somewhat random places, aligning with
        getCode calls. This works surprisingly well, but we might have to
        add new scopes into the mix later on if we find things too be too
        coarse-grained.
      
      (From Phabricator D169)
      5fecd767
  4. 09 Sep, 2014 1 commit
    • Austin Seipp's avatar
      Make Applicative a superclass of Monad · d94de872
      Austin Seipp authored
      Summary:
      This includes pretty much all the changes needed to make `Applicative`
      a superclass of `Monad` finally. There's mostly reshuffling in the
      interests of avoid orphans and boot files, but luckily we can resolve
      all of them, pretty much. The only catch was that
      Alternative/MonadPlus also had to go into Prelude to avoid this.
      
      As a result, we must update the hsc2hs and haddock submodules.
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      
      Test Plan: Build things, they might not explode horribly.
      
      Reviewers: hvr, simonmar
      
      Subscribers: simonmar
      
      Differential Revision: https://phabricator.haskell.org/D13
      d94de872
  5. 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
  6. 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
  7. 13 Mar, 2014 1 commit
  8. 11 Mar, 2014 3 commits
  9. 01 Feb, 2014 1 commit
    • Jan Stolarek's avatar
      Loopification jump between stack and heap checks · ea584ab6
      Jan Stolarek authored
      Fixes #8585
      
      When emmiting label of a self-recursive tail call (ie. when
      performing loopification optimization) we emit the loop header
      label after a stack check but before the heap check. The reason is
      that tail-recursive functions use constant amount of stack space
      so we don't need to repeat the check in every loop. But they can
      grow the heap so heap check must be repeated in every call.
      See Note [Self-recursive tail calls] and [Self-recursive loop header].
      ea584ab6
  10. 18 Oct, 2013 2 commits
  11. 16 Oct, 2013 1 commit
    • Jan Stolarek's avatar
      Generate (old + 0) instead of Sp in stack checks · 94125c97
      Jan Stolarek authored
      When compiling a function we can determine how much stack space it will
      use. We therefore need to perform only a single stack check at the beginning
      of a function to see if we have enough stack space. Instead of referring
      directly to Sp - as we used to do in the past - the code generator uses
      (old + 0) in the stack check. Stack layout phase turns (old + 0) into Sp.
      
      The idea here is that, while we need to perform only one stack check for
      each function, we could in theory place more stack checks later in the
      function. They would be redundant, but not incorrect (in a sense that they
      should not change program behaviour). We need to make sure however that a
      stack check inserted after incrementing the stack pointer checks for a
      respectively smaller stack space. This would not be the case if the code
      generator produced direct references to Sp. By referencing (old + 0) we make
      sure that we always check for a correct amount of stack: when converting
      (old + 0) to Sp the stack layout phase takes into account changes already
      made to stack pointer. The idea for this change came from observations made
      while debugging #8275.
      94125c97
  12. 02 Sep, 2013 1 commit
  13. 20 Aug, 2013 2 commits
    • Jan Stolarek's avatar
      Remove unused module · 6b032db4
      Jan Stolarek authored
      This commit removes module StgCmmGran which has only no-op functions.
      According to comments in the module, it was used by GpH, but GpH
      project seems to be dead for a couple of years now.
      6b032db4
    • Jan Stolarek's avatar
      Trailing whitespaces, code formatting, detabify · 3f279f37
      Jan Stolarek authored
      A major cleanup of trailing whitespaces and tabs in codeGen/
      directory. I also adjusted code formatting in some places.
      3f279f37
  14. 02 May, 2013 1 commit
  15. 12 Apr, 2013 2 commits
  16. 11 Apr, 2013 1 commit
  17. 29 Mar, 2013 1 commit
    • nfrisby's avatar
      ticky enhancements · 460abd75
      nfrisby authored
        * the new StgCmmArgRep module breaks a dependency cycle; I also
          untabified it, but made no real changes
      
        * updated the documentation in the wiki and change the user guide to
          point there
      
        * moved the allocation enters for ticky and CCS to after the heap check
      
          * I left LDV where it was, which was before the heap check at least
            once, since I have no idea what it is
      
        * standardized all (active?) ticky alloc totals to bytes
      
        * in order to avoid double counting StgCmmLayout.adjustHpBackwards
          no longer bumps ALLOC_HEAP_ctr
      
        * I resurrected the SLOW_CALL counters
      
          * the new module StgCmmArgRep breaks cyclic dependency between
            Layout and Ticky (which the SLOW_CALL counters cause)
      
          * renamed them SLOW_CALL_fast_<pattern> and VERY_SLOW_CALL
      
        * added ALLOC_RTS_ctr and _tot ticky counters
      
          * eg allocation by Storage.c:allocate or a BUILD_PAP in stg_ap_*_info
      
          * resurrected ticky counters for ALLOC_THK, ALLOC_PAP, and
            ALLOC_PRIM
      
          * added -ticky and -DTICKY_TICKY in ways.mk for debug ways
      
        * added a ticky counter for total LNE entries
      
        * new flags for ticky: -ticky-allocd -ticky-dyn-thunk -ticky-LNE
      
          * all off by default
      
          * -ticky-allocd: tracks allocation *of* closure in addition to
             allocation *by* that closure
      
          * -ticky-dyn-thunk tracks dynamic thunks as if they were functions
      
          * -ticky-LNE tracks LNEs as if they were functions
      
        * updated the ticky report format, including making the argument
          categories (more?) accurate again
      
        * the printed name for things in the report include the unique of
          their ticky parent as well as if they are not top-level
      460abd75
  18. 09 Mar, 2013 1 commit
  19. 19 Nov, 2012 1 commit
    • Simon Marlow's avatar
      Code-size optimisation for top-level indirections (#7308) · 7da13762
      Simon Marlow authored
      Top-level indirections are often generated when there is a cast, e.g.
      
      foo :: T
      foo = bar `cast` (some coercion)
      
      For these we were generating a full-blown CAF, which is a fair chunk
      of code.
      
      This patch makes these indirections generate a single IND_STATIC
      closure (4 words) instead.  This is exactly what the CAF would
      evaluate to eventually anyway, we're just shortcutting the whole
      process.
      7da13762
  20. 13 Nov, 2012 1 commit
    • Simon Marlow's avatar
      Fix the Slow calling convention (#7192) · 4270d7e7
      Simon Marlow authored
      The Slow calling convention passes the closure in R1, but we were
      ignoring this and hoping it would work, which it often did.  However,
      this bug seems to have been the cause of #7192, because the
      graph-colouring allocator is more sensitive to having correct liveness
      information on jumps.
      4270d7e7
  21. 30 Oct, 2012 1 commit
  22. 16 Oct, 2012 1 commit
    • ian@well-typed.com's avatar
      Some alpha renaming · cd33eefd
      ian@well-typed.com authored
      Mostly d -> g (matching DynFlag -> GeneralFlag).
      Also renamed if* to when*, matching the Haskell if/when names
      cd33eefd
  23. 08 Oct, 2012 1 commit
    • Simon Marlow's avatar
      Produce new-style Cmm from the Cmm parser · a7c0387d
      Simon Marlow authored
      The main change here is that the Cmm parser now allows high-level cmm
      code with argument-passing and function calls.  For example:
      
      foo ( gcptr a, bits32 b )
      {
        if (b > 0) {
           // we can make tail calls passing arguments:
           jump stg_ap_0_fast(a);
        }
      
        return (x,y);
      }
      
      More details on the new cmm syntax are in Note [Syntax of .cmm files]
      in CmmParse.y.
      
      The old syntax is still more-or-less supported for those occasional
      code fragments that really need to explicitly manipulate the stack.
      However there are a couple of differences: it is now obligatory to
      give a list of live GlobalRegs on every jump, e.g.
      
        jump %ENTRY_CODE(Sp(0)) [R1];
      
      Again, more details in Note [Syntax of .cmm files].
      
      I have rewritten most of the .cmm files in the RTS into the new
      syntax, except for AutoApply.cmm which is generated by the genapply
      program: this file could be generated in the new syntax instead and
      would probably be better off for it, but I ran out of enthusiasm.
      
      Some other changes in this batch:
      
       - The PrimOp calling convention is gone, primops now use the ordinary
         NativeNodeCall convention.  This means that primops and "foreign
         import prim" code must be written in high-level cmm, but they can
         now take more than 10 arguments.
      
       - CmmSink now does constant-folding (should fix #7219)
      
       - .cmm files now go through the cmmPipeline, and as a result we
         generate better code in many cases.  All the object files generated
         for the RTS .cmm files are now smaller.  Performance should be
         better too, but I haven't measured it yet.
      
       - RET_DYN frames are removed from the RTS, lots of code goes away
      
       - we now have some more canned GC points to cover unboxed-tuples with
         2-4 pointers, which will reduce code size a little.
      a7c0387d
  24. 26 Sep, 2012 1 commit
    • Edward Z. Yang's avatar
      Partially fix #367 by adding HpLim checks to entry with -fno-omit-yields. · d3128bfc
      Edward Z. Yang authored
      The current fix is relatively dumb as far as where to add HpLim
      checks: it will always perform a check unless we know that we're
      returning from a closure or we are doing a non let-no-escape case
      analysis.  The performance impact on the nofib suite looks like this:
      
                  Min          +5.7%     -0.0%     -6.5%     -6.4%    -50.0%
                  Max          +6.3%     +5.8%     +5.0%     +5.5%     +0.8%
       Geometric Mean          +6.2%     +0.1%     +0.5%     +0.5%     -0.8%
      
      Overall, the executable bloat is the biggest problem, so we keep the old
      omit-yields optimization on by default. Remember that if you need an
      interruptibility guarantee, you need to recompile all of your libraries
      with -fno-omit-yields.
      
      A better fix would involve only inserting the yields necessary to break
      loops; this is left as future work.
      Signed-off-by: Edward Z. Yang's avatarEdward Z. Yang <ezyang@mit.edu>
      d3128bfc
  25. 16 Sep, 2012 1 commit
  26. 12 Sep, 2012 2 commits
  27. 31 Aug, 2012 1 commit
  28. 07 Aug, 2012 3 commits
  29. 02 Aug, 2012 1 commit
    • Simon Marlow's avatar
      Explicitly share some return continuations · 6ede0067
      Simon Marlow authored
      Instead of relying on common-block-elimination to share return
      continuations in the common case (case-alternative heap checks) we do
      it explicitly.  This isn't hard to do, is more robust, and saves some
      compilation time.  Full commentary in Note [sharing continuations].
      6ede0067
  30. 30 Jul, 2012 1 commit
  31. 24 Jul, 2012 1 commit
  32. 11 Jul, 2012 1 commit