1. 18 Mar, 2009 1 commit
  2. 19 Mar, 2009 4 commits
  3. 18 Mar, 2009 3 commits
  4. 17 Mar, 2009 1 commit
  5. 16 Mar, 2009 2 commits
  6. 18 Mar, 2009 2 commits
    • simonpj@microsoft.com's avatar
      Add the notion of "constructor-like" Ids for rule-matching · 4bc25e8c
      simonpj@microsoft.com authored
      This patch adds an optional CONLIKE modifier to INLINE/NOINLINE pragmas, 
         {-# NOINLINE CONLIKE [1] f #-}
      The effect is to allow applications of 'f' to be expanded in a potential
      rule match.  Example
        {-# RULE "r/f" forall v. r (f v) = f (v+1) #-}
      
      Consider the term
           let x = f v in ..x...x...(r x)...
      Normally the (r x) would not match the rule, because GHC would be scared
      about duplicating the redex (f v). However the CONLIKE modifier says to
      treat 'f' like a constructor in this situation, and "look through" the
      unfolding for x.  So (r x) fires, yielding (f (v+1)).
      
      The main changes are:
        - Syntax
      
        - The inlinePragInfo field of an IdInfo has a RuleMatchInfo
          component, which records whether or not the Id is CONLIKE.
          Of course, this needs to be serialised in interface files too.
      
        - The occurrence analyser (OccAnal) and simplifier (Simplify) treat
          CONLIKE thing like constructors, by ANF-ing them
      
        - New function coreUtils.exprIsExpandable is like exprIsCheap, but
          additionally spots applications of CONLIKE functions
      
        - A CoreUnfolding has a field that caches exprIsExpandable
      
        - The rule matcher consults this field.  See 
          Note [Expanding variables] in Rules.lhs.
      
      On the way I fixed a lurking variable bug in the way variables are
      expanded.  See Note [Do not expand locally-bound variables] in
      Rule.lhs.  I also did a bit of reformatting and refactoring in
      Rules.lhs, so the module has more lines changed than are really
      different.
      4bc25e8c
    • Simon Marlow's avatar
      bd78c94a
  7. 17 Mar, 2009 3 commits
    • 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
    • Simon Marlow's avatar
      FIX biographical profiling (#3039, probably #2297) · f8f4cb3f
      Simon Marlow authored
      Since we introduced pointer tagging, we no longer always enter a
      closure to evaluate it.  However, the biographical profiler relies on
      closures being entered in order to mark them as "used", so we were
      getting spurious amounts of data attributed to VOID.  It turns out
      there are various places that need to be fixed, and I think at least
      one of them was also wrong before pointer tagging (CgCon.cgReturnDataCon).
      f8f4cb3f
    • Simon Marlow's avatar
      Add getNumberOfProcessors(), FIX MacOS X build problem (hopefully) · 0ee0be10
      Simon Marlow authored
      Somebody needs to implement getNumberOfProcessors() for MacOS X,
      currently it will return 1.
      0ee0be10
  8. 16 Mar, 2009 3 commits
  9. 13 Mar, 2009 2 commits
  10. 17 Feb, 2009 1 commit
  11. 16 Mar, 2009 4 commits
  12. 15 Mar, 2009 1 commit
  13. 13 Mar, 2009 6 commits
  14. 12 Mar, 2009 1 commit
  15. 13 Mar, 2009 1 commit
    • Simon Marlow's avatar
      Instead of a separate context-switch flag, set HpLim to zero · 304e7fb7
      Simon Marlow authored
      This reduces the latency between a context-switch being triggered and
      the thread returning to the scheduler, which in turn should reduce the
      cost of the GC barrier when there are many cores.
      
      We still retain the old context_switch flag which is checked at the
      end of each block of allocation.  The idea is that setting HpLim may
      fail if the the target thread is modifying HpLim at the same time; the
      context_switch flag is a fallback.  It also allows us to "context
      switch soon" without forcing an immediate switch, which can be costly.
      304e7fb7
  16. 12 Mar, 2009 1 commit
    • Simon Marlow's avatar
      FIX #3079, dodgy parsing of LANGUAGE pragmas · c197fe60
      Simon Marlow authored
      I ended up rewriting this horrible bit of code, using (yikes) lazy I/O
      to slurp in the source file a chunk at a time.  The old code tried to
      read the file a chunk at a time, but failed with LANGUAGE pragmas
      because the parser for LANGUAGE has state and the state wasn't being
      saved between chunks.  We're still closing the Handle eagerly, so
      there shouldn't be any problems here.
      c197fe60
  17. 11 Mar, 2009 4 commits