1. 23 Sep, 2010 1 commit
  2. 18 Sep, 2010 1 commit
  3. 13 Sep, 2010 1 commit
  4. 30 Aug, 2010 1 commit
  5. 27 May, 2010 1 commit
  6. 06 Jan, 2010 1 commit
  7. 02 Jan, 2010 1 commit
  8. 28 Sep, 2009 1 commit
  9. 04 Nov, 2009 1 commit
  10. 29 Oct, 2009 1 commit
  11. 20 Oct, 2009 1 commit
    • simonpj@microsoft.com's avatar
      Allow -ticky and -prof together · 8277f2dc
      simonpj@microsoft.com authored
      The two used to be incompatible, but they aren't any longer.
      
      In fact, -ticky should not be a 'way' any more, and doing that
      is on Simon M's todo list, but this patch takes us a little
      step closer.
      
      I'm not sure this is worth merging to the 6.12 branch.
      8277f2dc
  12. 14 Oct, 2009 1 commit
  13. 29 Aug, 2009 1 commit
    • Simon Marlow's avatar
      Unify event logging and debug tracing. · a5288c55
      Simon Marlow authored
        - tracing facilities are now enabled with -DTRACING, and -DDEBUG
          additionally enables debug-tracing.  -DEVENTLOG has been
          removed.
      
        - -debug now implies -eventlog
      
        - events can be printed to stderr instead of being sent to the
          binary .eventlog file by adding +RTS -v (which is implied by the
          +RTS -Dx options).
      
        - -Dx debug messages can be sent to the binary .eventlog file
          by adding +RTS -l.  This should help debugging by reducing
          the impact of debug tracing on execution time.
      
        - Various debug messages that duplicated the information in events
          have been removed.
      a5288c55
  14. 20 Aug, 2009 1 commit
  15. 02 Aug, 2009 1 commit
    • Simon Marlow's avatar
      RTS tidyup sweep, first phase · a2a67cd5
      Simon Marlow authored
      The first phase of this tidyup is focussed on the header files, and in
      particular making sure we are exposinng publicly exactly what we need
      to, and no more.
      
       - Rts.h now includes everything that the RTS exposes publicly,
         rather than a random subset of it.
      
       - Most of the public header files have moved into subdirectories, and
         many of them have been renamed.  But clients should not need to
         include any of the other headers directly, just #include the main
         public headers: Rts.h, HsFFI.h, RtsAPI.h.
      
       - All the headers needed for via-C compilation have moved into the
         stg subdirectory, which is self-contained.  Most of the headers for
         the rest of the RTS APIs have moved into the rts subdirectory.
      
       - I left MachDeps.h where it is, because it is so widely used in
         Haskell code.
       
       - I left a deprecated stub for RtsFlags.h in place.  The flag
         structures are now exposed by Rts.h.
      
       - Various internal APIs are no longer exposed by public header files.
      
       - Various bits of dead code and declarations have been removed
      
       - More gcc warnings are turned on, and the RTS code is more
         warning-clean.
      
       - More source files #include "PosixSource.h", and hence only use
         standard POSIX (1003.1c-1995) interfaces.
      
      There is a lot more tidying up still to do, this is just the first
      pass.  I also intend to standardise the names for external RTS APIs
      (e.g use the rts_ prefix consistently), and declare the internal APIs
      as hidden for shared libraries.
      a2a67cd5
  16. 09 Jul, 2009 1 commit
  17. 05 Jul, 2009 1 commit
  18. 03 Apr, 2009 1 commit
    • simonpj@microsoft.com's avatar
      Adjust inlining heursitics · b71760aa
      simonpj@microsoft.com authored
      This patch is the result of a long series of nofib-based experiments
      to improve GHC's inlining heuristics.
      
      In the end, I'm not sure how worthwhile it all was: I only got a 
         1% decrease in code size
         1% decrease in allocation
      and I don't trust the runtime statistics enough to quote.
      
      Still, in doing all this I tidied up the code quite a bit, and 
      I understand it much better now, so I'm going to commit it.
      
      The main changes are in CoreUnfold, which has lots of new comments.
      Other changes:
      
        - litSize moves from Literal to CoreUnfold
        - interestingArg moves from SimplUtils to CoreUnfold
        - the default unfolding threshold (in StaticFlags) 
            reduces from 8 to 6 (since the size calculation 
            has changed a bit)
      
      b71760aa
  19. 17 Mar, 2009 1 commit
    • Simon Marlow's avatar
      Add fast event logging · 8b18faef
      Simon Marlow authored
      Generate binary log files from the RTS containing a log of runtime
      events with timestamps.  The log file can be visualised in various
      ways, for investigating runtime behaviour and debugging performance
      problems.  See for example the forthcoming ThreadScope viewer.
      
      New GHC option:
      
        -eventlog   (link-time option) Enables event logging.
      
        +RTS -l     (runtime option) Generates <prog>.eventlog with
                    the binary event information.
      
      This replaces some of the tracing machinery we already had in the RTS:
      e.g. +RTS -vg  for GC tracing (we should do this using the new event
      logging instead).
      
      Event logging has almost no runtime cost when it isn't enabled, though
      in the future we might add more fine-grained events and this might
      change; hence having a link-time option and compiling a separate
      version of the RTS for event logging.  There's a small runtime cost
      for enabling event-logging, for most programs it shouldn't make much
      difference.
      
      (Todo: docs)
      8b18faef
  20. 18 Dec, 2008 1 commit
  21. 16 Dec, 2008 1 commit
    • Simon Marlow's avatar
      UNDO: Add -fpass-case-bndr-to-join-points · 5a336f14
      Simon Marlow authored
      rolling back:
      
      Fri Dec  5 10:51:59 GMT 2008  simonpj@microsoft.com
        * Add -fpass-case-bndr-to-join-points
        
        See Note [Passing the case binder to join points] in Simplify.lhs
        The default now is *not* to pass the case binder.  There are some
        nofib results with the above note; the effect is almost always 
        negligible.
        
        I don't expect this flag to be used by users (hence no docs). It's just
        there to let me try the performance effects of switching on and off.
        
      
          M ./compiler/main/StaticFlagParser.hs +1
          M ./compiler/main/StaticFlags.hs +4
          M ./compiler/simplCore/Simplify.lhs -14 +73
      5a336f14
  22. 09 Dec, 2008 1 commit
    • Ian Lynagh's avatar
      Make some profiling flags dynamic · aedb94f5
      Ian Lynagh authored
      In particular:
          -fauto-sccs-on-all-toplevs          -auto-all   -no-auto-all
          -fauto-sccs-on-exported-toplevs     -auto       -no-auto
          -fauto-sccs-on-individual-cafs      -caf-all    -no-caf-all
      aedb94f5
  23. 05 Dec, 2008 2 commits
    • simonpj@microsoft.com's avatar
      Add -fpass-case-bndr-to-join-points · ccd0e382
      simonpj@microsoft.com authored
      See Note [Passing the case binder to join points] in Simplify.lhs
      The default now is *not* to pass the case binder.  There are some
      nofib results with the above note; the effect is almost always 
      negligible.
      
      I don't expect this flag to be used by users (hence no docs). It's just
      there to let me try the performance effects of switching on and off.
      ccd0e382
    • simonpj@microsoft.com's avatar
      Add static flag -fsimple-list-literals · 6f547477
      simonpj@microsoft.com authored
      The new static flag -fsimple-list-literals makes ExplicitList literals
      be desugared in the straightforward way, rather than using 'build' as
      now.  See SLPJ comments with Note [Desugaring explicit lists].
      
      I don't expect this flag to be used by users (hence no docs). It's just
      there to let me try the performance effects of switching on and off.
      6f547477
  24. 13 Oct, 2008 1 commit
    • dias@eecs.harvard.edu's avatar
      Big collection of patches for the new codegen branch. · e6243a81
      dias@eecs.harvard.edu authored
      o Fixed bug that emitted the copy-in code for closure entry
        in the wrong place -- at the initialization of the closure.
      o Refactored some of the closure entry code.
      o Added code to check that no LocalRegs are live-in to a procedure
         -- trip up some buggy programs earlier
      o Fixed environment bindings for thunks
         -- we weren't (re)binding the free variables in a thunk
      o Fixed a bug in proc-point splitting that dropped some updates
        to the entry block in a procedure.
      o Fixed improper calls to code that generates CmmLit's for strings
      o New invariant on cg_loc in CgIdInfo: the expression is always tagged
      o Code to load free vars on entry to a thunk was (wrongly) placed before
        the heap check.
      o Some of the StgCmm code was redundantly passing around Id's
        along with CgIdInfo's; no more.
      o Initialize the LocalReg's that point to a closure before allocating and
        initializing the closure itself -- otherwise, we have problems with
        recursive closure bindings
      o BlockEnv and BlockSet types are now abstract.
      o Update frames:
        - push arguments in Old call area
        - keep track of the return sp in the FCode monad
        - keep the return sp in every call, tail call, and return
            (because it might be different at different call sites,
             e.g. tail calls to the gc after a heap check are performed
                  before pushing the update frame)
        - set the sp appropriately on returns and tail calls
      o Reduce call, tail call, and return to a single LastCall node
      o Added slow entry code, using different calling conventions on entry and tail call
      o More fixes to the calling convention code.
        The tricky stuff is all about the closure environment: it must be passed in R1,
        but in non-closures, there is no such argument, so we can't treat all arguments
        the same way: the closure environment is special. Maybe the right step forward
        would be to define a different calling convention for closure arguments.
      o Let-no-escapes need to be emitted out-of-line -- otherwise, we drop code.
      o Respect RTS requirement of word alignment for pointers
        My stack allocation can pack sub-word values into a single word on the stack,
        but it wasn't requiring word-alignment for pointers. It does now,
        by word-aligning both pointer registers and call areas.
      o CmmLint was over-aggresively ruling out non-word-aligned memory references,
        which may be kosher now that we can spill small values into a single word.
      o Wrong label order on a conditional branch when compiling switches.
      o void args weren't dropped in many cases.
        To help prevent this kind of mistake, I defined a NonVoid wrapper,
        which I'm applying only to Id's for now, although there are probably
        other good candidates.
      o A little code refactoring: separate modules for procpoint analysis splitting, 
        stack layout, and building infotables.
      o Stack limit check: insert along with the heap limit check, using a symbolic
        constant (a special CmmLit), then replace it when the stack layout is known.
      o Removed last node: MidAddToContext 
      o Adding block id as a literal: means that the lowering of the calling conventions
        no longer has to produce labels early, which was inhibiting common-block elimination.
        Will also make it easier for the non-procpoint-splitting path.
      o Info tables: don't try to describe the update frame!
      o Over aggressive use of NonVoid!!!!
        Don't drop the non-void args before setting the type of the closure!!!
      o Sanity checking:
        Added a pass to stub dead dead slots on the stack
        (only ~10 lines with the dataflow framework)
      o More sanity checking:
        Check that incoming pointer arguments are non-stubbed.
        Note: these checks are still subject to dead-code removal, but they should
        still be quite helpful.
      o Better sanity checking: why stop at function arguments?
        Instead, in mkAssign, check that _any_ assignment to a pointer type is non-null
        -- the sooner the crash, the easier it is to debug.
        Still need to add the debugging flag to turn these checks on explicitly.
      o Fixed yet another calling convention bug.
        This time, the calls to the GC were wrong. I've added a new convention
        for GC calls and invoked it where appropriate.
        We should really straighten out the calling convention stuff:
          some of the code (and documentation) is spread across the compiler,
          and there's some magical use of the node register that should really
          be handled (not avoided) by calling conventions.
      o Switch bug: the arms in mkCmmLitSwitch weren't returning to a single join point.
      o Environment shadowing problem in Stg->Cmm:
        When a closure f is bound at the top-level, we should not bind f to the
        node register on entry to the closure.
        Why? Because if the body of f contains a let-bound closure g that refers
        to f, we want to make sure that it refers to the static closure for f.
        Normally, this would all be fine, because when we compile a closure,
        we rebind free variables in the environment. But f doesn't look like
        a free variable because it's a static value. So, the binding for f
        remains in the environment when we compile g, inconveniently referring
        to the wrong thing.
        Now, I bind the variable in the local environment only if the closure is not
        bound at the top level. It's still okay to make assumptions about the
        node holding the closure environment; we just won't find the binding
        in the environment, so code that names the closure will now directly
        get the label of the static closure, not the node register holding a
        pointer to the static closure.
      o Don't generate bogus Cmm code containing SRTs during the STG -> Cmm pass!
        The tables made reference to some labels that don't exist when we compute and
        generate the tables in the back end.
      o Safe foreign calls need some special treatment (at least until we have the integrated
        codegen). In particular:
        o they need info tables
        o they are not procpoints -- the successor had better be in the same procedure
        o we cannot (yet) implement the calling conventions early, which means we have
          to carry the calling-conv info all the way to the end
      o We weren't following the old convention when registering a module.
        Now, we use update frames to push any new modules that have to be registered
        and enter the youngest one on the stack.
        We also use the update frame machinery to specify that the return should pop
        the return address off the stack.
      o At each safe foreign call, an infotable must be at the bottom of the stack,
        and the TSO->sp must point to it.
      o More problems with void args in a direct call to a function:
        We were checking the args (minus voids) to check whether the call was saturated,
        which caused problems when the function really wasn't saturated because it
        took an extra void argument.
      o Forgot to distinguish integer != from floating != during Stg->Cmm
      o Updating slotEnv and areaMap to include safe foreign calls
        The dataflow analyses that produce the slotEnv and areaMap give
        results for each basic block, but we also need the results for
        a safe foreign call, which is a middle node.
        After running the dataflow analysis, we have another pass that
        updates the results to includ any safe foreign calls.
      o Added a static flag for the debugging technique that inserts
        instructions to stub dead slots on the stack and crashes when
        a stubbed value is loaded into a pointer-typed LocalReg.
      o C back end expects to see return continuations before their call sites.
        Sorted the flowgraphs appropriately after splitting.
      o PrimOp calling conventions are special -- unlimited registers, no stack
        Yet another calling convention...
      o More void value problems: if the RHS of a case arm is a void-typed variable,
        don't try to return it.
      o When calling some primOp, they may allocate memory; if so, we need to
        do a heap check when we return from the call.
      e6243a81
  25. 26 Aug, 2008 1 commit
  26. 30 Jul, 2008 1 commit
  27. 11 Jul, 2008 1 commit
  28. 16 Jun, 2008 1 commit
    • Ian Lynagh's avatar
      More commandline flag improvements · 0f5e104c
      Ian Lynagh authored
      * Allow -ffoo flags to be deprecated
      * Mark some -ffoo flags as deprecated
      * Avoid using deprecated flags in error messages, in the build system, etc
      * Add a flag to en/disable the deprecated flag warning
      0f5e104c
  29. 14 Jun, 2008 3 commits
  30. 05 Jun, 2008 1 commit
    • simonpj@microsoft.com's avatar
      Desugar multiple polymorphic bindings more intelligently · a3f24157
      simonpj@microsoft.com authored
      Occasionally people write very large recursive groups of definitions. 
      In general we desugar these to a single definition that binds tuple,
      plus lots of tuple selectors.  But that code has quadratic size, which
      can be bad.
      
      This patch adds a new case to the desugaring of bindings, for the
      situation where there are lots of polymorphic variables, but no
      dictionaries.  (Dictionaries force us into the general case.)
      
      See Note [Abstracting over tyvars only].  
      
      The extra behaviour can be disabled with the (static) flag
      
      	-fno-ds-multi-tyvar
      
      in case we want to experiment with switching it on or off.  There is
      essentially-zero effect on the nofib suite though.
      
      I was provoked into doing this by Trac #1136.  In fact I'm not sure
      it's the real cause of the problem there, but it's a good idea anyway.
      a3f24157
  31. 03 Jun, 2008 2 commits
  32. 29 May, 2008 1 commit
    • dias@eecs.harvard.edu's avatar
      Cmm back end upgrades · 25628e27
      dias@eecs.harvard.edu authored
      Several changes in this patch, partially bug fixes, partially new code:
      o bug fixes in ZipDataflow
         - added some checks to verify that facts converge
         - removed some erroneous checks of convergence on entry nodes
         - added some missing applications of transfer functions
      o changed dataflow clients to use ZipDataflow, making ZipDataflow0 obsolete
      o eliminated DFA monad (no need for separate analysis and rewriting monads with ZipDataflow)
      o started stack layout changes
         - no longer generating CopyIn and CopyOut nodes (not yet fully expunged though)
         - still not using proper calling conventions
      o simple new optimizations:
         - common block elimination
            -- have not yet tried to move the Adams opt out of CmmProcPointZ
         - block concatenation
      o piped optimization fuel up to the HscEnv
         - can be limited by a command-line flag
         - not tested, and probably not yet properly used by clients
      o added unique supply to FuelMonad, also lifted unique supply to DFMonad
      25628e27
  33. 20 May, 2008 1 commit
  34. 22 Apr, 2008 3 commits