1. 19 Dec, 2011 2 commits
  2. 11 Dec, 2011 1 commit
  3. 07 Dec, 2011 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      Add new primtypes 'ArrayArray#' and 'MutableArrayArray#' · 021a0dd2
      chak@cse.unsw.edu.au. authored
      The primitive array types, such as 'ByteArray#', have kind #, but are represented by pointers. They are boxed, but unpointed types (i.e., they cannot be 'undefined').
      
      The two categories of array types —[Mutable]Array# and [Mutable]ByteArray#— are containers for unboxed (and unpointed) as well as for boxed and pointed types.  So far, we lacked support for containers for boxed, unpointed types (i.e., containers for the primitive arrays themselves).  This is what the new primtypes provide.
      
      Containers for boxed, unpointed types are crucial for the efficient implementation of scattered nested arrays, which are central to the new DPH backend library dph-lifted-vseg.  Without such containers, we cannot eliminate all unboxing from the inner loops of traversals processing scattered nested arrays.
      021a0dd2
  4. 06 Dec, 2011 2 commits
  5. 04 Dec, 2011 1 commit
  6. 02 Dec, 2011 2 commits
    • Ian Lynagh's avatar
      Move includes/DerivedConstants.h and includes/GHCConstants.h into dist dirs · e8723129
      Ian Lynagh authored
      When they existed, they were getting included in the includes_H_FILES
      variable (as it uses wildcard to find all header files). But the
      .depends files for the programs that generate the headers depend on
      $(includes_H_FILES), so the .depends files looked out-of-date once the
      headers had been created. This caused unnecessary make reinvocations.
      
      So now we put them in dist* directories, where they ought to be anyway.
      e8723129
    • Simon Marlow's avatar
      More changes aimed at improving call stacks. · 1469f1eb
      Simon Marlow authored
        - Attach a SrcSpan to every CostCentre.  This had the side effect
          that CostCentres that used to be merged because they had the same
          name are now considered distinct; so I had to add a Unique to
          CostCentre to give them distinct object-code symbols.
      
        - New flag: -fprof-auto-calls.  This flag adds an automatic SCC to
          every call site (application, to be precise).  This is typically
          more useful for call stacks than annotating whole functions.
      
      Various tidy-ups at the same time: removed unused NoCostCentre
      constructor, and refactored a bit in Coverage.lhs.
      
      The call stack we get from traceStack now looks like this:
      
      Stack trace:
        Main.CAF (<entire-module>)
        Main.main.xs (callstack002.hs:18:12-24)
        Main.map (callstack002.hs:13:12-16)
        Main.map.go (callstack002.hs:15:21-34)
        Main.map.go (callstack002.hs:15:21-23)
        Main.f (callstack002.hs:10:7-43)
      1469f1eb
  7. 30 Nov, 2011 1 commit
    • Simon Marlow's avatar
      Further tweaks to the ccs primops · 1fc25dfd
      Simon Marlow authored
       - add getCCSOf# :: a -> State# s -> (# State# s, Addr# #)
         (returns the CCS attached to the supplied object)
      
       - remove traceCcs# (obsoleted by getCCSOf#)
      
       - rename getCCCS# to getCurrentCCS#
      1fc25dfd
  8. 29 Nov, 2011 3 commits
    • Simon Marlow's avatar
      Add a new primop: getCCCS# :: State# s -> (# State# s, Addr# #) · 1f7433b7
      Simon Marlow authored
      Returns a pointer to the current cost-centre stack when profiling,
      NULL otherwise.
      1f7433b7
    • Simon Marlow's avatar
      Make profiling work with multiple capabilities (+RTS -N) · 50de6034
      Simon Marlow authored
      This means that both time and heap profiling work for parallel
      programs.  Main internal changes:
      
        - CCCS is no longer a global variable; it is now another
          pseudo-register in the StgRegTable struct.  Thus every
          Capability has its own CCCS.
      
        - There is a new built-in CCS called "IDLE", which records ticks for
          Capabilities in the idle state.  If you profile a single-threaded
          program with +RTS -N2, you'll see about 50% of time in "IDLE".
      
        - There is appropriate locking in rts/Profiling.c to protect the
          shared cost-centre-stack data structures.
      
      This patch does enough to get it working, I have cut one big corner:
      the cost-centre-stack data structure is still shared amongst all
      Capabilities, which means that multiple Capabilities will race when
      updating the "allocations" and "entries" fields of a CCS.  Not only
      does this give unpredictable results, but it runs very slowly due to
      cache line bouncing.
      
      It is strongly recommended that you use -fno-prof-count-entries to
      disable the "entries" count when profiling parallel programs. (I shall
      add a note to this effect to the docs).
      50de6034
    • Simon Marlow's avatar
      Get rid of the "safety" field of CmmCall (OldCmm) · cbe24168
      Simon Marlow authored
      This field was doing nothing.  I think it originally appeared in a
      very old incarnation of the new code generator.
      cbe24168
  9. 26 Nov, 2011 3 commits
  10. 16 Nov, 2011 1 commit
  11. 14 Nov, 2011 1 commit
  12. 07 Nov, 2011 1 commit
    • Simon Marlow's avatar
      Cost centre names are now in UTF-8 (#5559) · 630b8955
      Simon Marlow authored
      So the .prof file will be UTF-8.  This is mostly ok, except that the
      RTS doesn't calculate the column widths correctly (it assumes bytes =
      chars).
      
      hp2ps doesn't do anything sensible with Unicode strings, it just dumps
      the bytes into the .ps file.
      630b8955
  13. 06 Nov, 2011 2 commits
  14. 04 Nov, 2011 1 commit
  15. 02 Nov, 2011 2 commits
    • Simon Marlow's avatar
      Overhaul of infrastructure for profiling, coverage (HPC) and breakpoints · 7bb0447d
      Simon Marlow authored
      User visible changes
      ====================
      
      Profilng
      --------
      
      Flags renamed (the old ones are still accepted for now):
      
        OLD            NEW
        ---------      ------------
        -auto-all      -fprof-auto
        -auto          -fprof-exported
        -caf-all       -fprof-cafs
      
      New flags:
      
        -fprof-auto              Annotates all bindings (not just top-level
                                 ones) with SCCs
      
        -fprof-top               Annotates just top-level bindings with SCCs
      
        -fprof-exported          Annotates just exported bindings with SCCs
      
        -fprof-no-count-entries  Do not maintain entry counts when profiling
                                 (can make profiled code go faster; useful with
                                 heap profiling where entry counts are not used)
      
      Cost-centre stacks have a new semantics, which should in most cases
      result in more useful and intuitive profiles.  If you find this not to
      be the case, please let me know.  This is the area where I have been
      experimenting most, and the current solution is probably not the
      final version, however it does address all the outstanding bugs and
      seems to be better than GHC 7.2.
      
      Stack traces
      ------------
      
      +RTS -xc now gives more information.  If the exception originates from
      a CAF (as is common, because GHC tends to lift exceptions out to the
      top-level), then the RTS walks up the stack and reports the stack in
      the enclosing update frame(s).
      
      Result: +RTS -xc is much more useful now - but you still have to
      compile for profiling to get it.  I've played around a little with
      adding 'head []' to GHC itself, and +RTS -xc does pinpoint the problem
      quite accurately.
      
      I plan to add more facilities for stack tracing (e.g. in GHCi) in the
      future.
      
      Coverage (HPC)
      --------------
      
       * derived instances are now coloured yellow if they weren't used
       * likewise record field names
       * entry counts are more accurate (hpc --fun-entry-count)
       * tab width is now correct (markup was previously off in source with
         tabs)
      
      Internal changes
      ================
      
      In Core, the Note constructor has been replaced by
      
              Tick (Tickish b) (Expr b)
      
      which is used to represent all the kinds of source annotation we
      support: profiling SCCs, HPC ticks, and GHCi breakpoints.
      
      Depending on the properties of the Tickish, different transformations
      apply to Tick.  See CoreUtils.mkTick for details.
      
      Tickets
      =======
      
      This commit closes the following tickets, test cases to follow:
      
        - Close #2552: not a bug, but the behaviour is now more intuitive
          (test is T2552)
      
        - Close #680 (test is T680)
      
        - Close #1531 (test is result001)
      
        - Close #949 (test is T949)
      
        - Close #2466: test case has bitrotted (doesn't compile against current
          version of vector-space package)
      7bb0447d
    • Simon Marlow's avatar
  16. 17 Oct, 2011 2 commits
  17. 14 Oct, 2011 5 commits
  18. 03 Oct, 2011 1 commit
    • Ian Lynagh's avatar
      Handle HValues slightly nicer · aff9d690
      Ian Lynagh authored
      We now have addrToAny# rather than addrToHValue#, and both addrToAny#
      and mkApUpd0# return "Any" rather than "a". This makes it a little
      easier to see what's going on, and fixes a warning in ByteCodeLink.
      aff9d690
  19. 02 Oct, 2011 1 commit
  20. 17 Sep, 2011 1 commit
    • Ian Lynagh's avatar
      Improve the handling of Integer literals · 1e87c0a6
      Ian Lynagh authored
      LitInteger now carries around the id of mkInteger, which it uses
      to construct the core to build Integer literals. This way we don't
      have to build in info about lots of Ids.
      
      We also no longer have any special-casing for integer-simple, so
      there is less code involved.
      1e87c0a6
  21. 13 Sep, 2011 1 commit
    • Ian Lynagh's avatar
      change how Integer's are handled in Core · fdac48f3
      Ian Lynagh authored
      We now treat them as literals until CorePrep, when we finally
      convert them into the real Core representation. This makes it a lot
      simpler to implement built-in rules on them.
      fdac48f3
  22. 11 Sep, 2011 2 commits
  23. 07 Sep, 2011 1 commit
  24. 06 Sep, 2011 2 commits
    • batterseapower's avatar
      Implement -XConstraintKind · 9729fe7c
      batterseapower authored
      Basically as documented in http://hackage.haskell.org/trac/ghc/wiki/KindFact,
      this patch adds a new kind Constraint such that:
      
        Show :: * -> Constraint
        (?x::Int) :: Constraint
        (Int ~ a) :: Constraint
      
      And you can write *any* type with kind Constraint to the left of (=>):
      even if that type is a type synonym, type variable, indexed type or so on.
      
      The following (somewhat related) changes are also made:
       1. We now box equality evidence. This is required because we want
          to give (Int ~ a) the *lifted* kind Constraint
       2. For similar reasons, implicit parameters can now only be of
          a lifted kind. (?x::Int#) => ty is now ruled out
       3. Implicit parameter constraints are now allowed in superclasses
          and instance contexts (this just falls out as OK with the new
          constraint solver)
      
      Internally the following major changes were made:
       1. There is now no PredTy in the Type data type. Instead
          GHC checks the kind of a type to figure out if it is a predicate
       2. There is now no AClass TyThing: we represent classes as TyThings
          just as a ATyCon (classes had TyCons anyway)
       3. What used to be (~) is now pretty-printed as (~#). The box
          constructor EqBox :: (a ~# b) -> (a ~ b)
       4. The type LCoercion is used internally in the constraint solver
          and type checker to represent coercions with free variables
          of type (a ~ b) rather than (a ~# b)
      9729fe7c
    • Simon Marlow's avatar
      fix the eager-blackholing check, which I inadvertently broke in · 6ffaf6ff
      Simon Marlow authored
      1c2f8953 (symptom was broken
      biographical profiling, see #5451).
      6ffaf6ff