ghc.git
7 years agoSimplify simplifyInfer quite a lot ghc-spj
Simon Peyton Jones [Mon, 23 Apr 2012 17:09:01 +0000 (18:09 +0100)] 
Simplify simplifyInfer quite a lot

Work in progress, on branch

7 years agoMake simplifyInfer generalise only over simple class constraints
Simon Peyton Jones [Sun, 22 Apr 2012 17:36:27 +0000 (18:36 +0100)] 
Make simplifyInfer generalise only over simple class constraints

So we never infer
   f :: Eq (Tree a) => blah
when there isn't an instance for Eq (Tree a).

This fixes Trac #6022.

It does represent a change in behaviour: certain (bizarre) programs
will be rejected that were previously accepted. Specifically, if you
have

   module A where
   f x = ...somethign needing (C T)...

   moudule B where
   import A
   instance C T
   test = f True

Here the (C T) instance is provided "later".  But this is wierd; it
would be better to give a type signature for f
   f :: C T => Bool -> Bool
and then you'd be fine.

7 years agoTiny refactoring; no change in behaviour
Simon Peyton Jones [Sun, 22 Apr 2012 17:32:50 +0000 (18:32 +0100)] 
Tiny refactoring; no change in behaviour

7 years agoRespect kind-variable scoping when instantiating dfuns
Simon Peyton Jones [Sun, 22 Apr 2012 16:52:55 +0000 (17:52 +0100)] 
Respect kind-variable scoping when instantiating dfuns

Fixes Trac #6020

7 years agoEmpty data types should not be "trimmed" by TidyPgm
Simon Peyton Jones [Sun, 22 Apr 2012 15:24:07 +0000 (16:24 +0100)] 
Empty data types should not be "trimmed" by TidyPgm

That in turn means that you can derive Show etc in other modules,
fixing Trac #6031

7 years agoOS X: disable bootstrapping info for 'ar'
Manuel M T Chakravarty [Sat, 21 Apr 2012 07:43:34 +0000 (17:43 +1000)] 
OS X: disable bootstrapping info for 'ar'

Xcode 4.3 installs the command line tools in a different location as earlier versions of Xcode. With the bootstrapping info, the build fails if the bootstrap compiler was built with an older version of Xcode.

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 20 Apr 2012 17:38:59 +0000 (18:38 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoMove free-var info from InstDecl to FamInstDecl
Simon Peyton Jones [Fri, 20 Apr 2012 17:38:25 +0000 (18:38 +0100)] 
Move free-var info from InstDecl to FamInstDecl

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 20 Apr 2012 16:43:37 +0000 (17:43 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 20 Apr 2012 16:07:59 +0000 (17:07 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoComments only
Simon Peyton Jones [Fri, 20 Apr 2012 16:06:57 +0000 (17:06 +0100)] 
Comments only

7 years agoMerge branch 'master' of http://darcs.haskell.org//ghc
Simon Peyton Jones [Fri, 20 Apr 2012 16:06:40 +0000 (17:06 +0100)] 
Merge branch 'master' of darcs.haskell.org//ghc

7 years agoDo SCC on instance declarations (fixes Trac #5715)
Simon Peyton Jones [Fri, 20 Apr 2012 16:05:15 +0000 (17:05 +0100)] 
Do SCC on instance declarations (fixes Trac #5715)

The trouble here is that given

    {-# LANGUAGE DataKinds, TypeFamilies #-}
    data instance Foo a = Bar (Bar a)

we want to get a sensible message that we can't use the promoted 'Bar'
constructor until after its definition; it's a staging error.  Bud the
staging mechanism that we use for vanilla data declarations don't work
here.

Solution is to perform strongly-connected component analysis on the
instance declarations. But that in turn means that we need to track
free-variable information on more HsSyn declarations, which is why
so many files are touched.  All the changes are boiler-platey except
the ones in TcInstDcls.

7 years agoAdding -ddump-avoid-vect option for vectorisation avoidance diagnostics
Manuel M T Chakravarty [Fri, 20 Apr 2012 06:03:17 +0000 (16:03 +1000)] 
Adding -ddump-avoid-vect option for vectorisation avoidance diagnostics

7 years agoAdd newline to the end of file
Jose Pedro Magalhaes [Thu, 19 Apr 2012 15:13:20 +0000 (17:13 +0200)] 
Add newline to the end of file

7 years agoFix operand expansion function.
Paolo Capriotti [Mon, 16 Apr 2012 18:46:26 +0000 (19:46 +0100)] 
Fix operand expansion function.

7 years agoSimplify the typechecking of RULES
Simon Peyton Jones [Mon, 16 Apr 2012 14:30:20 +0000 (15:30 +0100)] 
Simplify the typechecking of RULES

Not only does this fix Trac #5853, but it also eliminate
the horrid SimplEqsOnly part of the constraint simplifier.

The new plan is described in TcRules
 Note [Simplifying RULE constraints]

7 years agoSimplify construction of equality predicates
Simon Peyton Jones [Mon, 16 Apr 2012 14:27:22 +0000 (15:27 +0100)] 
Simplify construction of equality predicates

There was an ASSERT which does not hold during type checking (and
should not) which is later checked by Core Lint

7 years agoImplemented word-sized addressing of pointers and literals.
Paolo Capriotti [Thu, 5 Apr 2012 17:42:37 +0000 (18:42 +0100)] 
Implemented word-sized addressing of pointers and literals.

7 years agoBytecode assembler refactoring.
Paolo Capriotti [Thu, 5 Apr 2012 17:09:40 +0000 (18:09 +0100)] 
Bytecode assembler refactoring.

Use a free monad to specify the assembling procedure, so that it can be
run multiple times without producing side effects.

This paves the way for a more general implementation of variable-sized
instructions, since we need to dry-run the bytecode assembler to
determine the size of the operands for some instructions.

7 years agoExport State monad transformer from ByteCodeItbls.
Paolo Capriotti [Thu, 5 Apr 2012 15:45:21 +0000 (16:45 +0100)] 
Export State monad transformer from ByteCodeItbls.

7 years agoSupport large SLIDE instructions.
Paolo Capriotti [Thu, 5 Apr 2012 08:52:18 +0000 (09:52 +0100)] 
Support large SLIDE instructions.

The bytecode generator used to keep track of the stack depth with a
16-bit counter, which could overflow for very large BCOs, resulting in
incorrect bytecode.

This commit switches to a word-sized counter, and eagerly panics
whenever an operand is too big, instead of truncating the result.

This allows us to work around the 16-bit limitation in the case of SLIDE
instructions, since we can simply factor it into multiple SLIDEs with
smaller arguments.

7 years agoUse monotonic time function for darwin (#5865)
Paolo Capriotti [Sat, 24 Mar 2012 02:19:43 +0000 (02:19 +0000)] 
Use monotonic time function for darwin (#5865)

7 years agoUse monotonic clock in Select.c (#5865)
Paolo Capriotti [Tue, 20 Mar 2012 11:57:28 +0000 (11:57 +0000)] 
Use monotonic clock in Select.c (#5865)

7 years agoMerge branch 'master' of http://darcs.haskell.org//ghc
Simon Peyton Jones [Fri, 13 Apr 2012 20:42:29 +0000 (21:42 +0100)] 
Merge branch 'master' of darcs.haskell.org//ghc

7 years agoAllow kind-variable binders in type signatures
Simon Peyton Jones [Fri, 13 Apr 2012 20:40:56 +0000 (21:40 +0100)] 
Allow kind-variable binders in type signatures

This is the last major addition to the kind-polymorphism story,
by allowing (Trac #5938)

 type family F a   -- F :: forall k. k -> *
 data T a          -- T :: forall k. k -> *
 type instance F (T (a :: Maybe k)) = Char

The new thing is the explicit 'k' in the type signature on 'a',
which itself is inside a type pattern for F.

Main changes are:

* HsTypes.HsBSig now has a *pair* (kvs, tvs) of binders,
  the kind variables and the type variables

* extractHsTyRdrTyVars returns a pair (kvs, tvs)
  and the function itself has moved from RdrHsSyn to RnTypes

* Quite a bit of fiddling with
     TcHsType.tcHsPatSigType and tcPatSig
  which have become a bit simpler.  I'm still not satisfied
  though.  There's some consequential fiddling in TcRules too.

* Removed the unused HsUtils.collectSigTysFromPats

There's a consequential wibble to Haddock too

7 years agoFix worker/wrapper for CPR functions
Simon Peyton Jones [Fri, 13 Apr 2012 16:38:32 +0000 (17:38 +0100)] 
Fix worker/wrapper for CPR functions

A long-standing and egregious bug in the worker/wrapper code meant
that some functions with the CPR property weren't getting a CPR
w/w. And that had the effect of making a tail-recursive function not
tail recursive.  As well as increasing allocation.

Fixes Trac #5920, and #5997.

Nofib results (highlights):

        Program           Size    Allocs   Runtime   Elapsed  TotalMem
--------------------------------------------------------------------------------
         boyer2          -0.1%    -15.3%      0.01      0.01     +0.0%
        mandel2          -0.0%     -8.1%      0.01      0.01     +0.0%
           para          -0.1%    -11.8%     -7.9%     -7.8%     +0.0%
--------------------------------------------------------------------------------
            Min          -0.1%    -15.3%     -7.9%     -7.8%    -33.3%
            Max          +0.0%     +0.2%     +6.3%     +6.3%     +3.7%
 Geometric Mean          -0.0%     -0.4%     +0.1%     +0.1%     -0.5%

Looks like a clear win.  And I have not even recompiled the libraries, so
it'll probably be a bit better in the ed.

7 years agoAllow overlaps when -XIncoherentInstances is in force
Simon Peyton Jones [Fri, 13 Apr 2012 11:54:44 +0000 (12:54 +0100)] 
Allow overlaps when -XIncoherentInstances is in force

This change allows a top-level instance to be used even if there is
a (potentially) overlapping local given.  Which isn't fab, but it is
what IncoherentInstances is *for*.

This fixes the bug part of Trac #6002.

7 years agoUntabify HsTypes
Simon Peyton Jones [Fri, 13 Apr 2012 10:10:43 +0000 (11:10 +0100)] 
Untabify HsTypes

7 years agoRevert "Added ':runmonad' command to GHCi"
Simon Peyton Jones [Fri, 13 Apr 2012 09:37:48 +0000 (10:37 +0100)] 
Revert "Added ':runmonad' command to GHCi"

Two problems, for now at any rate
  a) Breaks the build with lots of errors like
        No instance for (Show (IO ())) arising from a use of `print'
  b) Discussion of the approache hasn't converged yet
     (Simon M had a number of suggestions)

This reverts commit eecd7c98c1f079c14d99ed831dff33a48ee45e67.

7 years agoAdded ':runmonad' command to GHCi
David Terei [Wed, 1 Feb 2012 03:48:00 +0000 (19:48 -0800)] 
Added ':runmonad' command to GHCi

This command allows you to lift user stmts in GHCi into an IO monad
that implements the GHC.GHCi.GHCiSandboxIO type class. This allows for
easy sandboxing of GHCi using :runmonad and Safe Haskell.

Longer term it would be nice to allow a more general model for the Monad
than GHCiSandboxIO but delaying this for the moment.

7 years agoMore imporvements to optimisation flag docs.
David Terei [Thu, 12 Apr 2012 21:42:05 +0000 (14:42 -0700)] 
More imporvements to optimisation flag docs.

7 years agoDon't document '-freg-liveness' or '-fllvm-tbaa', developer flags
David Terei [Thu, 12 Apr 2012 20:54:14 +0000 (13:54 -0700)] 
Don't document '-freg-liveness' or '-fllvm-tbaa', developer flags

7 years agoFix crash with tiny initial stack size (#5993)
Simon Marlow [Thu, 12 Apr 2012 10:41:17 +0000 (11:41 +0100)] 
Fix crash with tiny initial stack size (#5993)

7 years agoupdateThunk: minor tweak to avoid an unnecessary call to checkBlockingQueues
Simon Marlow [Thu, 12 Apr 2012 10:21:41 +0000 (11:21 +0100)] 
updateThunk: minor tweak to avoid an unnecessary call to checkBlockingQueues

7 years agoAllow threads in GHCi to receive BlockedIndefintely* exceptions (#2786)
Simon Marlow [Thu, 12 Apr 2012 10:21:02 +0000 (11:21 +0100)] 
Allow threads in GHCi to receive BlockedIndefintely* exceptions (#2786)

This is a partial fix for #2786.  It seems we still don't get
NonTermination exceptions for interpreted computations, but we do now
get the BlockedIndefinitely family.

7 years agoFix instance signature error message (#6001)
Paolo Capriotti [Thu, 12 Apr 2012 09:44:31 +0000 (10:44 +0100)] 
Fix instance signature error message (#6001)

Display class method signature instead of user-provided signature.

7 years agoFix a race condition in the GHCi debugger exposed by testcase break011.
Paolo Capriotti [Thu, 29 Mar 2012 22:19:04 +0000 (23:19 +0100)] 
Fix a race condition in the GHCi debugger exposed by testcase break011.

7 years agoDo not re-encode correctly encoded inputs and arguments (#5795)
Paolo Capriotti [Wed, 28 Mar 2012 15:11:34 +0000 (16:11 +0100)] 
Do not re-encode correctly encoded inputs and arguments (#5795)

7 years agoAdd support for additional .ghci files in GHCi (#5265)
Paolo Capriotti [Wed, 11 Apr 2012 13:34:25 +0000 (14:34 +0100)] 
Add support for additional .ghci files in GHCi (#5265)

Patch by Sam Anklesaria <amsay@amsay.net>

7 years agoRevert "trac #5265 (support for additional .ghci files)"
Paolo Capriotti [Wed, 11 Apr 2012 13:19:25 +0000 (14:19 +0100)] 
Revert "trac #5265 (support for additional .ghci files)"

This reverts commit 991f141989940c897cb2fc3dba7b5b49342d402a.

7 years agoTurn on TRACE_gc with +RTS -Ds (this regressed at some point)
Simon Marlow [Wed, 11 Apr 2012 10:38:56 +0000 (11:38 +0100)] 
Turn on TRACE_gc with +RTS -Ds (this regressed at some point)

7 years agoImprove the handling of threadDelay in the non-threaded RTS
Simon Marlow [Wed, 11 Apr 2012 10:38:24 +0000 (11:38 +0100)] 
Improve the handling of threadDelay in the non-threaded RTS

Firstly, we were rounding up too much, such that the smallest delay
was 20ms.  Secondly, there is no need to use millisecond resolution on
a 64-bit machine where we have room in the TSO to use the normal
nanosecond resolution that we use elsewhere in the RTS.

7 years agoFix crash with debug tracing and the new heap events
Simon Marlow [Wed, 11 Apr 2012 09:58:56 +0000 (10:58 +0100)] 
Fix crash with debug tracing and the new heap events

7 years agoDisable the timer signal while blocked in select() (#5991)
Simon Marlow [Wed, 11 Apr 2012 09:12:14 +0000 (10:12 +0100)] 
Disable the timer signal while blocked in select() (#5991)

The threaded RTS had a fix for this a long time ago (#1623) but this
patch applies a similar fix to the non-threaded RTS.

7 years agosmall cleanup
Simon Marlow [Wed, 11 Apr 2012 08:47:54 +0000 (09:47 +0100)] 
small cleanup

7 years agofix quadratic performance issue with long module names (#5981)
Simon Marlow [Tue, 10 Apr 2012 15:31:13 +0000 (16:31 +0100)] 
fix quadratic performance issue with long module names (#5981)

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Dimitrios.Vytiniotis [Tue, 10 Apr 2012 08:57:28 +0000 (09:57 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoSetting empty touchable range in implications that are generated from polytype
Dimitrios.Vytiniotis [Tue, 10 Apr 2012 08:57:10 +0000 (09:57 +0100)] 
Setting empty touchable range in implications that are generated from polytype
decomposition in the constraint solver.

7 years agoFix RTS build on OS X
Manuel M T Chakravarty [Tue, 10 Apr 2012 04:13:40 +0000 (14:13 +1000)] 
Fix RTS build on OS X

* The following commits made validate fail on OS X (Lion):
65aaa9b2715c5245838123f3a0fa5d92e0a66bce and c294d95dc04950ab4c5380bf6ce8651f621f8591
* I just commented out all offending code until it validated again. The original authors need to clean this up.

7 years agoUpdates to the constraint solver to be able to handle implication
Dimitrios.Vytiniotis [Tue, 10 Apr 2012 01:11:25 +0000 (02:11 +0100)] 
Updates to the constraint solver to be able to handle implication
constraint generation during solveInteractCts, needed for polytype
equality decomposition. More commentary to follow.

7 years agoUpdate names to match the implementation in GHC.TypeLits.
Iavor S. Diatchki [Mon, 9 Apr 2012 02:38:45 +0000 (19:38 -0700)] 
Update names to match the implementation in GHC.TypeLits.

7 years agoAllow promoted constructors in the typedoc production (#5948)
Paolo Capriotti [Fri, 6 Apr 2012 14:01:01 +0000 (15:01 +0100)] 
Allow promoted constructors in the typedoc production (#5948)

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Dimitrios.Vytiniotis [Thu, 5 Apr 2012 19:42:33 +0000 (20:42 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoImproved caching: I was flushing the solved when going under implications,
Dimitrios.Vytiniotis [Thu, 5 Apr 2012 19:37:17 +0000 (20:37 +0100)] 
Improved caching: I was flushing the solved when going under implications,
this was the reason for the regression of T3064.

7 years agoImplemeting a lookup modulo non-idempotent substitution.
Dimitrios.Vytiniotis [Thu, 5 Apr 2012 19:34:51 +0000 (20:34 +0100)] 
Implemeting a lookup modulo non-idempotent substitution.

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Thu, 5 Apr 2012 10:43:19 +0000 (11:43 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoFix Trac #5952, by changing the Outputable TyCon instance,
Simon Peyton Jones [Thu, 5 Apr 2012 10:42:53 +0000 (11:42 +0100)] 
Fix Trac #5952, by changing the Outputable TyCon instance,
so that it does not print a quote in front of a promoted
TyCon in a Kind.

I also systematically renamed
   PromotedTypeTyCon  -->   PromotedTyCon
   PromotedDataTyCon  -->   PromotedDataCon

7 years agoMerge branch 'master' of http://darcs.haskell.org//ghc
Simon Peyton Jones [Thu, 5 Apr 2012 10:39:46 +0000 (11:39 +0100)] 
Merge branch 'master' of darcs.haskell.org//ghc

7 years agoImprove kind-checking of type splices slightly
Simon Peyton Jones [Thu, 5 Apr 2012 10:39:33 +0000 (11:39 +0100)] 
Improve kind-checking of type splices slightly

It is still Not Right, but can't readily be fixed until
the major overhaul of TH described in Simon PJ's 2011
GHC blog post.  (Then type splices will be done in
the renamer.)

7 years agoImprove error reporting for out-of-scope variables
Simon Peyton Jones [Thu, 5 Apr 2012 10:37:02 +0000 (11:37 +0100)] 
Improve error reporting for out-of-scope variables

Sometimes when a variable is out of scope in the type-checker,
it's not a GHC bug, but rather a TH staging error.  See
Note [Out of scope might be a staging error] in TcEnv.

This showed up as Trac #5795.

7 years agoWhite space only
Simon Peyton Jones [Thu, 5 Apr 2012 10:30:02 +0000 (11:30 +0100)] 
White space only

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc into ghc-new-flavor
Dimitrios.Vytiniotis [Thu, 5 Apr 2012 08:03:31 +0000 (09:03 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc into ghc-new-flavor

7 years ago--amend
David Terei [Wed, 4 Apr 2012 22:14:24 +0000 (15:14 -0700)] 
--amend

7 years agoFix GHC API with respect to safe haskell. (#5989)
David Terei [Tue, 3 Apr 2012 02:00:51 +0000 (19:00 -0700)] 
Fix GHC API with respect to safe haskell. (#5989)

This fixes haddock so it correctly reports
the safe haskell mode of a module.

7 years agoUpdate safe haskell error/warn formatting
David Terei [Tue, 3 Apr 2012 19:37:30 +0000 (12:37 -0700)] 
Update safe haskell error/warn formatting

7 years agoFix tracking of reason safe inference failed. (#5988)
David Terei [Tue, 3 Apr 2012 01:58:43 +0000 (18:58 -0700)] 
Fix tracking of reason safe inference failed. (#5988)

7 years agoFix uneeded test in safe haskell code
David Terei [Mon, 2 Apr 2012 22:07:26 +0000 (15:07 -0700)] 
Fix uneeded test in safe haskell code

7 years agoAdd the GC_GLOBAL_SYNC event marking that all caps are stopped for GC
Mikolaj [Fri, 9 Mar 2012 19:51:30 +0000 (20:51 +0100)] 
Add the GC_GLOBAL_SYNC event marking that all caps are stopped for GC

Quoting design rationale by dcoutts: The event indicates that we're doing
a stop-the-world GC and all other HECs should be between their GC_START
and GC_END events at that moment. We don't want to use GC_STATS_GHC
for that, because GC_STATS_GHC is for extra GHC-specific info,
not something we have to rely on to be able to match the GC pauses
across HECs to a particular global GC.

7 years agoFix the timestamps in GC_START and GC_END events on the GC-initiating cap
Mikolaj [Fri, 9 Mar 2012 13:22:06 +0000 (14:22 +0100)] 
Fix the timestamps in GC_START and GC_END events on the GC-initiating cap

There was a discrepancy between GC times reported in +RTS -s
and the timestamps of GC_START and GC_END events on the cap,
on which +RTS -s stats for the given GC are based.
This is fixed by posting the events with exactly the same timestamp
as generated for the stat calculation. The calls posting the events
are moved too, so that the events are emitted close to the time instant
they claim to be emitted at. The GC_STATS_GHC was moved, too, ensuring
it's emitted before the moved GC_END on all caps, which simplifies tools code.

7 years agoEmit final heap alloc events and rearrange code to calculate alloc totals
Duncan Coutts [Wed, 22 Feb 2012 18:25:27 +0000 (18:25 +0000)] 
Emit final heap alloc events and rearrange code to calculate alloc totals

In stat_exit we want to emit a final EVENT_HEAP_ALLOCATED for each cap
so that we get the same total allocation count as reported via +RTS -s.
To do so we need to update the per-cap total_allocated counts.

Previously we had a single calcAllocated(rtsBool) function that counted
the large allocations and optionally the nurseries for all caps. The GC
would always call it with false, and the stat_exit always with true.
The reason for these two modes is that the GC counts the nurseries via
clearNurseries() (which also updates the per-cap total_allocated
counts), so it's only the stat_exit() path that needs to count them.

We now split the calcAllocated() function into two: countLargeAllocated
and updateNurseriesStats. As the name suggests, the latter now updates
the per-cap total_allocated counts, in additon to returning a total.

7 years agoMove trace of cap delete from shutdownCapability to freeCapability
Duncan Coutts [Wed, 22 Feb 2012 01:41:29 +0000 (01:41 +0000)] 
Move trace of cap delete from shutdownCapability to freeCapability

Will let us do final per-cap trace events from stat_exit().
Otherwise we would end up with eventlogs with events for caps
that have already been deleted.

7 years agoAdjust the eventlog description header for the spark counter event
Duncan Coutts [Fri, 3 Feb 2012 13:52:06 +0000 (13:52 +0000)] 
Adjust the eventlog description header for the spark counter event

The EventLogFormat.h described the spark counter fields in a different
order to that which ghc emits (the GC'd and fizzled fields were
reversed). At this stage it is easier to fix the ghc-events lib and
to have ghc continue to emit them in the current order.

7 years agoAdd new eventlog events for various heap and GC statistics
Duncan Coutts [Mon, 6 Feb 2012 12:22:18 +0000 (12:22 +0000)] 
Add new eventlog events for various heap and GC statistics

They cover much the same info as is available via the GHC.Stats module
or via the '+RTS -s' textual output, but via the eventlog and with a
better sampling frequency.

We have three new generic heap info events and two very GHC-specific
ones. (The hope is the general ones are usable by other implementations
that use the same eventlog system, or indeed not so sensitive to changes
in GHC itself.)

The general ones are:

 * total heap mem allocated since prog start, on a per-HEC basis
 * current size of the heap (MBlocks reserved from OS for the heap)
 * current size of live data in the heap

Currently these are all emitted by GHC at GC time (live data only at
major GC).

The GHC specific ones are:

 * an event giving various static heap paramaters:
   * number of generations (usually 2)
   * max size if any
   * nursary size
   * MBlock and block sizes
 * a event emitted on each GC containing:
   * GC generation (usually just 0,1)
   * total bytes copied
   * bytes lost to heap slop and fragmentation
   * the number of threads in the parallel GC (1 for serial)
   * the maximum number of bytes copied by any par GC thread
   * the total number of bytes copied by all par GC threads
     (these last three can be used to calculate an estimate of the
      work balance in parallel GCs)

7 years agoChange the presentation of parallel GC work balance in +RTS -s
Duncan Coutts [Fri, 17 Feb 2012 02:55:29 +0000 (02:55 +0000)] 
Change the presentation of parallel GC work balance in +RTS -s

Also rename internal variables to make the names match what they hold.
The parallel GC work balance is calculated using the total amount of
memory copied by all GC threads, and the maximum copied by any
individual thread. You have serial GC when the max is the same as
copied, and perfectly balanced GC when total/max == n_caps.

Previously we presented this as the ratio total/max and told users
that the serial value was 1 and the ideal value N, for N caps, e.g.

  Parallel GC work balance: 1.05 (4045071 / 3846774, ideal 2)

The downside of this is that the user always has to keep in mind the
number of cores being used. Our new presentation uses a normalised
scale 0--1 as a percentage. The 0% means completely serial and 100%
is perfect balance, e.g.

  Parallel GC work balance: 4.56% (serial 0%, perfect 100%)

7 years agoCalculate the total memory allocated on a per-capability basis
Duncan Coutts [Fri, 3 Feb 2012 12:57:19 +0000 (12:57 +0000)] 
Calculate the total memory allocated on a per-capability basis

In addition to the existing global method. For now we just do
it both ways and assert they give the same grand total. At some
stage we can simplify the global method to just take the sum of
the per-cap counters.

7 years agoAdd eventlog/trace stuff for capabilities: create/delete/enable/disable
Duncan Coutts [Fri, 3 Feb 2012 12:20:36 +0000 (12:20 +0000)] 
Add eventlog/trace stuff for capabilities: create/delete/enable/disable

Now that we can adjust the number of capabilities on the fly, we need
this reflected in the eventlog. Previously the eventlog had a single
startup event that declared a static number of capabilities. Obviously
that's no good anymore.

For compatability we're keeping the EVENT_STARTUP but adding new
EVENT_CAP_CREATE/DELETE. The EVENT_CAP_DELETE is actually just the old
EVENT_SHUTDOWN but renamed and extended (using the existing mechanism
to extend eventlog events in a compatible way). So we now emit both
EVENT_STARTUP and EVENT_CAP_CREATE. One day we will drop EVENT_STARTUP.

Since reducing the number of capabilities at runtime does not really
delete them, it just disables them, then we also have new events for
disable/enable.

The old EVENT_SHUTDOWN was in the scheduler class of events. The new
EVENT_CAP_* events are in the unconditional class, along with the
EVENT_CAPSET_* ones. Knowing when capabilities are created and deleted
is crucial to making sense of eventlogs, you always want those events.
In any case, they're extremely low volume.

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc into ghc-new-flavor
Dimitrios.Vytiniotis [Wed, 4 Apr 2012 16:03:09 +0000 (17:03 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc into ghc-new-flavor

7 years agoDocument optimisation passes, to some extent at least
Simon Peyton Jones [Wed, 4 Apr 2012 14:58:37 +0000 (15:58 +0100)] 
Document optimisation passes, to some extent at least

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc into ghc-new-flavor
Dimitrios.Vytiniotis [Wed, 4 Apr 2012 13:39:29 +0000 (14:39 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc into ghc-new-flavor

7 years agoAdding a forgotten pre-canonicalication cache-lookup stage.
Dimitrios.Vytiniotis [Wed, 4 Apr 2012 13:38:26 +0000 (14:38 +0100)] 
Adding a forgotten pre-canonicalication cache-lookup stage.

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Wed, 4 Apr 2012 13:17:54 +0000 (14:17 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoTighten up on type validity checking
Simon Peyton Jones [Wed, 4 Apr 2012 13:14:35 +0000 (14:14 +0100)] 
Tighten up on type validity checking

Fixes Trac #5957, which pointed out that
  Int -> Ord a => a -> a
is not Haskell 98

7 years agoUpdate comments about Addr in foreign declarations.
Paolo Capriotti [Wed, 4 Apr 2012 12:38:07 +0000 (13:38 +0100)] 
Update comments about Addr in foreign declarations.

7 years agoImproved checks for "dynamic" and "wrapper" foreign declarations (#5664)
Paolo Capriotti [Tue, 3 Apr 2012 09:41:52 +0000 (10:41 +0100)] 
Improved checks for "dynamic" and "wrapper" foreign declarations (#5664)

7 years agoWibble: using original type for the dictionary if it has not changed (to preserve...
Dimitrios.Vytiniotis [Wed, 4 Apr 2012 11:54:11 +0000 (12:54 +0100)] 
Wibble: using original type for the dictionary if it has not changed (to preserve synonyms)

7 years agoMore informative tracing for ddump-cs-trace
Dimitrios.Vytiniotis [Wed, 4 Apr 2012 11:52:39 +0000 (12:52 +0100)] 
More informative tracing for ddump-cs-trace

7 years agoWhen rewriting a flavor with rewriteCtFlavor, in the case of reflexivity,
Dimitrios.Vytiniotis [Tue, 3 Apr 2012 12:29:55 +0000 (13:29 +0100)] 
When rewriting a flavor with rewriteCtFlavor, in the case of reflexivity,
avoid setting the flavor PredType to be the new PredType if the types exactly
match, so that in case of failure we report errors that do not have expanded
type synonyms.

7 years agoBugfix in emitKindConstraint (must not cache orig constraint as Solved!); added
Dimitrios.Vytiniotis [Tue, 3 Apr 2012 10:59:51 +0000 (11:59 +0100)] 
Bugfix in emitKindConstraint (must not cache orig constraint as Solved!); added
short note to document an example.

7 years agoPrevent nested TH exceptions from bubbling up to the top level (#5976)
Paolo Capriotti [Fri, 30 Mar 2012 11:30:28 +0000 (12:30 +0100)] 
Prevent nested TH exceptions from bubbling up to the top level (#5976)

7 years agoCommentary, following the relaxation of idempotence of the inert substitution.
Dimitrios.Vytiniotis [Tue, 3 Apr 2012 09:48:47 +0000 (10:48 +0100)] 
Commentary, following the relaxation of idempotence of the inert substitution.

7 years agoDropping the idempotence restriction on the inert substitution,
Dimitrios.Vytiniotis [Mon, 2 Apr 2012 15:34:36 +0000 (16:34 +0100)] 
Dropping the idempotence restriction on the inert substitution,
for efficiency. More documentation to follow.

7 years agoDeleting more old commented code.
Dimitrios.Vytiniotis [Mon, 2 Apr 2012 15:33:28 +0000 (16:33 +0100)] 
Deleting more old commented code.

7 years agoSupport qualified identifiers in quasi-quotes (#5555).
Paolo Capriotti [Mon, 2 Apr 2012 12:09:10 +0000 (13:09 +0100)] 
Support qualified identifiers in quasi-quotes (#5555).

7 years agoFixed typo in b857c8ad which caused NewtypeD to be interpreted as DataD.
Mikhail Vorozhtsov [Mon, 2 Apr 2012 11:03:48 +0000 (18:03 +0700)] 
Fixed typo in b857c8ad which caused NewtypeD to be interpreted as DataD.

Signed-off-by: Paolo Capriotti <p.capriotti@gmail.com>
7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc into ghc-new-flavor
Dimitrios.Vytiniotis [Mon, 2 Apr 2012 09:38:36 +0000 (10:38 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc into ghc-new-flavor

7 years agoWhitespace only in main/Packages.lhs
Ian Lynagh [Sun, 1 Apr 2012 10:55:56 +0000 (11:55 +0100)] 
Whitespace only in main/Packages.lhs

7 years agoTidy up compiler/ghc.cabal.in
Ian Lynagh [Sun, 1 Apr 2012 00:35:46 +0000 (01:35 +0100)] 
Tidy up compiler/ghc.cabal.in

We now always have base4, and don't need a workaround for GHC 6.4.2.

7 years agoAdd a section about promoted literals to the manual.
Iavor S. Diatchki [Sat, 31 Mar 2012 19:47:25 +0000 (12:47 -0700)] 
Add a section about promoted literals to the manual.

7 years agoAdd an entry for -XExplicitNamespaces to the manual.
Iavor S. Diatchki [Sat, 31 Mar 2012 19:15:23 +0000 (12:15 -0700)] 
Add an entry for -XExplicitNamespaces to the manual.