ghc-hetmet.git
15 years agoFix crash in biographical heap profiling (#2576) 2008-09-12 2008-09-12_2
Simon Marlow [Fri, 12 Sep 2008 11:25:44 +0000 (11:25 +0000)]
Fix crash in biographical heap profiling (#2576)

15 years agoFix retainer profiling (#2576)
Simon Marlow [Fri, 12 Sep 2008 11:06:43 +0000 (11:06 +0000)]
Fix retainer profiling (#2576)

15 years agoFix some bugs in the stack-reducing code (#2571)
Simon Marlow [Fri, 12 Sep 2008 10:01:40 +0000 (10:01 +0000)]
Fix some bugs in the stack-reducing code (#2571)

15 years agoext-core library: Add dead code eliminator for Core
Tim Chevalier [Fri, 12 Sep 2008 04:41:47 +0000 (04:41 +0000)]
ext-core library: Add dead code eliminator for Core

Added code for dead code elimination to the ext-core library. This can be used in concert with Language.Core.Merge to produce a single self-contained module without unnecessary cruft.

15 years agoext-core library: expose some more modules
Tim Chevalier [Fri, 12 Sep 2008 03:45:15 +0000 (03:45 +0000)]
ext-core library: expose some more modules

15 years agoext-core library: Change syntax for primitive coercions
Tim Chevalier [Fri, 12 Sep 2008 03:33:47 +0000 (03:33 +0000)]
ext-core library: Change syntax for primitive coercions

Changed the ext-core syntax to include primitive coercions (left, right, sym, trans, etc.) as syntax rather than referring them to their names as in GHC. (I hope I updated the docs to reflect this...)

15 years agoext-core library: Export a lot more things from Prims
Tim Chevalier [Fri, 12 Sep 2008 03:22:19 +0000 (03:22 +0000)]
ext-core library: Export a lot more things from Prims

See comments for details.

15 years agoext-core library: Extend Core preprocessor
Tim Chevalier [Fri, 12 Sep 2008 03:14:52 +0000 (03:14 +0000)]
ext-core library: Extend Core preprocessor

See comments for details.

15 years agoext-core library: Export a bunch more stuff from the parser
Tim Chevalier [Fri, 12 Sep 2008 02:56:15 +0000 (02:56 +0000)]
ext-core library: Export a bunch more stuff from the parser

15 years agoext-core library: Fix performance bug
Tim Chevalier [Fri, 12 Sep 2008 02:53:14 +0000 (02:53 +0000)]
ext-core library: Fix performance bug

isUtupleTy was implemented inefficiently (and is called a lot by the typechecker). Replaced with uglier but faster code.

15 years agoext-core library: Remove some cruft
Tim Chevalier [Fri, 12 Sep 2008 02:38:42 +0000 (02:38 +0000)]
ext-core library: Remove some cruft

15 years agoext-core library: Add code for merging multiple Core modules into a single module
Tim Chevalier [Fri, 12 Sep 2008 02:15:35 +0000 (02:15 +0000)]
ext-core library: Add code for merging multiple Core modules into a single module

I added a new module, Merge, to the ext-core library that combines a list of ext-core modules into a new, uniquely renamed module.

See comments in Merge.hs for more details.

15 years agoUse OSThreadProcAttr for workerStart
Ian Lynagh [Thu, 11 Sep 2008 15:38:27 +0000 (15:38 +0000)]
Use OSThreadProcAttr for workerStart

15 years agoInclude docs in the bindists
Ian Lynagh [Thu, 11 Sep 2008 14:05:19 +0000 (14:05 +0000)]
Include docs in the bindists

15 years agoDon't install pwd
Ian Lynagh [Thu, 11 Sep 2008 12:54:22 +0000 (12:54 +0000)]
Don't install pwd

15 years agoIn stgReallocForGMP, we need to copy min(old_size,new_size)
Ian Lynagh [Thu, 11 Sep 2008 12:08:06 +0000 (12:08 +0000)]
In stgReallocForGMP, we need to copy min(old_size,new_size)
We used to always copy old_size

15 years agoTell perl to autoflush output in darcs-all. Suggested by Claus Reinke
Ian Lynagh [Thu, 11 Sep 2008 00:13:48 +0000 (00:13 +0000)]
Tell perl to autoflush output in darcs-all. Suggested by Claus Reinke

15 years agoRemove dataConInstOrigDictsAndArgTys
simonpj@microsoft.com [Wed, 10 Sep 2008 15:42:00 +0000 (15:42 +0000)]
Remove dataConInstOrigDictsAndArgTys

This suspicious function had just one call, in BuildTyCl.mkNewTyConRhs.
I've done it another way now, which is tidier.

15 years agoWe always install stage2, so we need to always put stage2 into bindists
Ian Lynagh [Tue, 9 Sep 2008 22:16:27 +0000 (22:16 +0000)]
We always install stage2, so we need to always put stage2 into bindists

15 years agoAdd a do-nothing install-docs rule in ext-core/ when LATEX_DOCS=NO
Ian Lynagh [Tue, 9 Sep 2008 11:39:29 +0000 (11:39 +0000)]
Add a do-nothing install-docs rule in ext-core/ when LATEX_DOCS=NO

15 years agoLink to core.pdf, not core.ps.gz
Ian Lynagh [Tue, 9 Sep 2008 11:35:43 +0000 (11:35 +0000)]
Link to core.pdf, not core.ps.gz

15 years agoFix debug message formatting on Windows
simonpj@microsoft.com [Wed, 10 Sep 2008 14:20:42 +0000 (14:20 +0000)]
Fix debug message formatting on Windows

15 years agoCheck the *right* set of type variables for escape!
simonpj@microsoft.com [Wed, 10 Sep 2008 09:58:16 +0000 (09:58 +0000)]
Check the *right* set of type variables for escape!

I did the wrong checkSigTyVars, which (happily) triggered an ASSERT
failure.  This should fix it.

15 years agoMore refactoring of instance declarations (fixes Trac #2572)
simonpj@microsoft.com [Wed, 10 Sep 2008 08:51:21 +0000 (08:51 +0000)]
More refactoring of instance declarations (fixes Trac #2572)

In refactoring instance declarations I'd taken a short cut over
scoped type variables, but it wasn't right as #2572 shows.

Fixing it required a significant chunk of further refactoring,
alas. But it's done!  Quite tidily as it turns out.

The main issue is that when typechecking a default method, we
need two sets of type variables in scope
class C a where
      op :: forall b. ...
  op = e
In 'e', *both* 'a' and 'b' are in scope.  But the type of the
default method has a nested flavour
op :: forall a. C a => forall b. ....
and our normal scoping mechanisms don't bring 'b' into scope.
(And probably shouldn't.)

Solution (which is done for instance methods too) is to use
a local defintion, like this:

  $dmop :: forall a. C a => forall b. ....
  $dmop a d = let
                 op :: forall b. ...
                 op = e
              in op

and now the scoping works out.  I hope I have now see the
last of this code for a bit!

15 years agoFix Trac #2581: inlining of record selectors
simonpj@microsoft.com [Wed, 10 Sep 2008 08:30:14 +0000 (08:30 +0000)]
Fix Trac #2581: inlining of record selectors

Bryan discovered that a non-trivial record selector (non-trivial in
the sense that it has to reconstruct the result value because of
UNPACK directives) weren't being inlined.  The reason was that the
unfolding generated by MkId.mRecordSelId was never being optimised
*at all*, and hence looked big, and hence wasn't inlined.

(The out-of-line version *is* put into the code of the module
and *is* optimised, which made this bug pretty puzzling.  But the
unfolding inside the record-selector-Id itself, which is a GlobalId
and hence does not get its inlining updated like LocalIds, was
big and fat.)

Solution: I wrote a very simple optimiser, CoreUnfold.simplOptExpr,
which does enough optimisation to solve this particular problem.
It's short, simple, and will be useful in other contexts.

15 years agoFix Trac #2573; and explanatory comment
simonpj@microsoft.com [Wed, 10 Sep 2008 08:23:13 +0000 (08:23 +0000)]
Fix Trac #2573; and explanatory comment

15 years agoFix the zonking of HsWrappers
simonpj@microsoft.com [Wed, 10 Sep 2008 08:20:03 +0000 (08:20 +0000)]
Fix the zonking of HsWrappers

HsWrappers are horribly inconsistent at the moment. I intended that
  WpLam, WpApp     are for evidence abstraction/application
  WpTyLam, WpTyApp are for type abstraction/application

But when we zonk (WpApp co), where co is a coercion variable, we
get a *coercion* not a coercion *variable*.   So for now I'm making
it into a WpTyApp, which the desugarer handles perfectly well.

(I'd forgotten to zonk it properly at all; that is the bug that
this patch fixes.)

15 years agoAdd newDictOcc, newDictOccs
simonpj@microsoft.com [Wed, 10 Sep 2008 08:19:13 +0000 (08:19 +0000)]
Add newDictOcc, newDictOccs

15 years agoLayout and type synonyms only
simonpj@microsoft.com [Wed, 10 Sep 2008 08:18:15 +0000 (08:18 +0000)]
Layout and type synonyms only

15 years agoRobustify the setting of implied flags
simonpj@microsoft.com [Wed, 10 Sep 2008 08:15:28 +0000 (08:15 +0000)]
Robustify the setting of implied flags

When setting implied flags, do so recursively.  So if -Xa implies -Xb,
and -Xb implies -Xc, we do the right thing.

I thought we needed this, but we don't.  But it seems like a good idea
anyway.

15 years agoRename a variable
simonpj@microsoft.com [Wed, 10 Sep 2008 08:15:10 +0000 (08:15 +0000)]
Rename a variable

15 years agoComments only
simonpj@microsoft.com [Wed, 10 Sep 2008 06:50:30 +0000 (06:50 +0000)]
Comments only

15 years agoSimplify the type signature for tcPolyBinds
simonpj@microsoft.com [Wed, 10 Sep 2008 07:35:29 +0000 (07:35 +0000)]
Simplify the type signature for tcPolyBinds

15 years agoTell GHC which module nON_EXHAUSTIVE_GUARDS_ERROR_ID comes from
simonpj@microsoft.com [Tue, 9 Sep 2008 16:21:07 +0000 (16:21 +0000)]
Tell GHC which module nON_EXHAUSTIVE_GUARDS_ERROR_ID comes from

This one was missed when the error-ids all moved to Control.Exception.Base
(The nofib test 'fluid' showed it up.)

15 years agoImprove float-in somewhat
simonpj@microsoft.com [Tue, 9 Sep 2008 15:57:09 +0000 (15:57 +0000)]
Improve float-in somewhat

See Note [Floating in past a lambda group]. The new thing
here is that we previously were not floating in past a group
that had (\(a:*) \(x:State# a). e), with a type var *and* a
one-shot lambda.

The fix makes wave4main allocate 2% less, and doesn't change any other
nofib number, so it's not a big deal.

15 years agoImportant performance wibble to callSiteInline (the n_vals_wanted > 0 thing)
simonpj@microsoft.com [Tue, 9 Sep 2008 15:50:11 +0000 (15:50 +0000)]
Important performance wibble to callSiteInline (the n_vals_wanted > 0 thing)

See Note [Inlining in ArgCtxt].  This very small change gives quite a
big performance win. Just showing the bigger ones:

        Program           Size    Allocs   Runtime
--------------------------------------------------------------------------------
           anna          -0.7%     -4.3%      0.15
       cichelli          -0.6%     -6.4%      0.15
         fulsom          -0.4%    -18.5%     -8.1%
            gcd          -0.6%    -12.0%      0.06
        integer          -0.6%    -16.2%     -8.4%
          power          -0.7%    -19.3%     -4.8%
--------------------------------------------------------------------------------
            Min          -0.7%    -19.3%    -15.7%
            Max          -0.1%     +0.1%     +5.7%
 Geometric Mean          -0.6%     -1.9%     -4.3%

The original change was to improve a case that Roman found (see test
eyeball/inline1) but that seems to work ok now anyway.

15 years agowhen a memory leak is detected, report which blocks are unreachable
Simon Marlow [Tue, 9 Sep 2008 14:51:22 +0000 (14:51 +0000)]
when a memory leak is detected, report which blocks are unreachable

15 years agoSeparate pruning from marking of spark pools
Simon Marlow [Tue, 9 Sep 2008 13:52:51 +0000 (13:52 +0000)]
Separate pruning from marking of spark pools
Fixes crash when using compacting GC in parallel programs

15 years agoun-disable warnings in some modules
Simon Marlow [Tue, 9 Sep 2008 13:43:02 +0000 (13:43 +0000)]
un-disable warnings in some modules

15 years agoFix warnings
Simon Marlow [Tue, 9 Sep 2008 13:42:47 +0000 (13:42 +0000)]
Fix warnings

15 years agoMore sanity checking for the TSO write barrier
Simon Marlow [Tue, 9 Sep 2008 13:37:48 +0000 (13:37 +0000)]
More sanity checking for the TSO write barrier
Check that all threads marked as dirty are really on the mutable list.

15 years agoMove checkGlobalTSOList() call from GarbageCollect() to checkSanity()
Simon Marlow [Tue, 9 Sep 2008 13:34:53 +0000 (13:34 +0000)]
Move checkGlobalTSOList() call from GarbageCollect() to checkSanity()

15 years agosmall bugfix in traverseBlackHoleQueue()
Simon Marlow [Tue, 9 Sep 2008 13:33:07 +0000 (13:33 +0000)]
small bugfix in traverseBlackHoleQueue()

15 years agoFix race condition in wakeupThreadOnCapability() (#2574)
Simon Marlow [Tue, 9 Sep 2008 13:32:23 +0000 (13:32 +0000)]
Fix race condition in wakeupThreadOnCapability() (#2574)
wakeupThreadOnCapbility() is used to signal another capability that
there is a thread waiting to be added to its run queue.  It adds the
thread to the (locked) wakeup queue on the remote capability.  In
order to do this, it has to modify the TSO's link field, which has a
write barrier.  The write barrier might put the TSO on the mutable
list, and the bug was that it was using the mutable list of the
*target* capability, which we do not have exclusive access to.  We
should be using the current Capabilty's mutable list in this case.

15 years agoFix compacting GC bug: don't forget to thread the blackhole_queue
Simon Marlow [Tue, 9 Sep 2008 13:22:34 +0000 (13:22 +0000)]
Fix compacting GC bug: don't forget to thread the blackhole_queue

15 years agoCapability stopping when waiting for GC
berthold@mathematik.uni-marburg.de [Tue, 19 Aug 2008 15:18:42 +0000 (15:18 +0000)]
Capability stopping when waiting for GC

15 years agoScheduler code cleanup
berthold@mathematik.uni-marburg.de [Tue, 2 Sep 2008 16:13:13 +0000 (16:13 +0000)]
Scheduler code cleanup

This patch removes old code from the Schedule.c file.

I removed GRAN code for GranSim, a simulator for parallel Haskell execution with GpH model.
This code is inactive since ghc-4.x.

Code for PARALLEL_HASKELL has been partially removed. The remaining code is valid, but can
refer to nonexisting functionality in other files.

15 years agoFix parallel GC bug (crash in concprog001(threaded2))
Simon Marlow [Mon, 8 Sep 2008 14:56:52 +0000 (14:56 +0000)]
Fix parallel GC bug (crash in concprog001(threaded2))
Two threads were trying to move the same TSO.  I like this test, it
has caught plenty of bugs in the past.

15 years agoMake LOOKS_LIKE_{INFO,CLOSURE}_PTR into inline functions, instead of macros
Simon Marlow [Mon, 8 Sep 2008 14:43:48 +0000 (14:43 +0000)]
Make LOOKS_LIKE_{INFO,CLOSURE}_PTR into inline functions, instead of macros
The macros were duplicating their arguments, which was normally
harmless, but in the parallel GC was actually wrong and caused
spurious assertion failures.

15 years agoUse test -f rather than test -e
Ian Lynagh [Mon, 8 Sep 2008 22:46:18 +0000 (22:46 +0000)]
Use test -f rather than test -e
Hopefully this will fix the SunOS builbot slave.

15 years agoMake a pdf, rather than ps.gz, of teh ext-core docs
Ian Lynagh [Mon, 8 Sep 2008 18:48:29 +0000 (18:48 +0000)]
Make a pdf, rather than ps.gz, of teh ext-core docs

15 years agoFIX BUILD on non-Windows
Simon Marlow [Mon, 8 Sep 2008 14:24:14 +0000 (14:24 +0000)]
FIX BUILD on non-Windows

15 years agomake this build with GHC 6.7+
Simon Marlow [Mon, 8 Sep 2008 10:28:55 +0000 (10:28 +0000)]
make this build with GHC 6.7+

15 years agoadd (c) Lennart Augustsson (part of #740)
Simon Marlow [Mon, 8 Sep 2008 10:28:43 +0000 (10:28 +0000)]
add (c) Lennart Augustsson (part of #740)

15 years agosysErrorBelch: don't put an extra \n on Windows
Simon Marlow [Wed, 3 Sep 2008 10:50:18 +0000 (10:50 +0000)]
sysErrorBelch: don't put an extra \n on Windows

15 years agoWindows: print an error message in addDLL
Simon Marlow [Wed, 3 Sep 2008 10:49:51 +0000 (10:49 +0000)]
Windows: print an error message in addDLL
Also, look for libXXX.dll in addition to XXX.dll (see #1883, this
isn't really a proper fix, but it'll help in some cases).
And I tidied up the error message for a DLL load failure, though it's
still a bit of a mess because addDLL is supposed to return a (static)
string with the error message, but this isn't possible on Windows.

15 years agobindist fixes
Ian Lynagh [Sun, 7 Sep 2008 18:52:32 +0000 (18:52 +0000)]
bindist fixes

15 years agoFix the ext-core doc in bindists
Ian Lynagh [Sun, 7 Sep 2008 16:48:13 +0000 (16:48 +0000)]
Fix the ext-core doc in bindists

15 years agoAdd extern flag to avoid multiple symbol errors on Mac os X
daniel@phasevelocity.org [Fri, 22 Aug 2008 06:21:36 +0000 (06:21 +0000)]
Add extern flag to avoid multiple symbol errors on Mac os X

15 years agoType families: new algorithm to solve equalities
Manuel M T Chakravarty [Sun, 7 Sep 2008 11:21:28 +0000 (11:21 +0000)]
Type families: new algorithm to solve equalities
- This adds the new equational solver based on the notion of normalised
  equalities.
- The new algorithm is conceptually much simpler and will eventually enable us
  to implement a fully integrated solver that solves equality and dictionary
  constraints together.
- More details are at
  <http://hackage.haskell.org/trac/ghc/wiki/TypeFunctionsSolving>
- The code is there, but it is not being used yet.

15 years agoDon't build latex docs by default
Ian Lynagh [Sat, 6 Sep 2008 18:49:12 +0000 (18:49 +0000)]
Don't build latex docs by default
"LATEX_DOCS = YES" enables them

15 years agoNow that haddock is in-tree, build haddock docs by default
Ian Lynagh [Sat, 6 Sep 2008 18:46:33 +0000 (18:46 +0000)]
Now that haddock is in-tree, build haddock docs by default

15 years agoAdd an explanation of the format of the packages file format
Ian Lynagh [Sat, 6 Sep 2008 15:55:19 +0000 (15:55 +0000)]
Add an explanation of the format of the packages file format

15 years agoInstall the stage 2 ghc package when installing; fixes trac #2567
Ian Lynagh [Sat, 6 Sep 2008 14:25:46 +0000 (14:25 +0000)]
Install the stage 2 ghc package when installing; fixes trac #2567

15 years agoUpdate the users guide to point at the in-tree core.ps.gz
Ian Lynagh [Sat, 6 Sep 2008 14:02:43 +0000 (14:02 +0000)]
Update the users guide to point at the in-tree core.ps.gz
It used to point to a file on haskell.org, which didn't necessarily
describe the right version of core.

15 years agoCompress the ext-core docs
Ian Lynagh [Sat, 6 Sep 2008 13:56:16 +0000 (13:56 +0000)]
Compress the ext-core docs

15 years agoInstall the ext-core docs
Ian Lynagh [Sat, 6 Sep 2008 13:51:52 +0000 (13:51 +0000)]
Install the ext-core docs

15 years agoMake ext-core when making all in docs
Ian Lynagh [Sat, 6 Sep 2008 12:14:15 +0000 (12:14 +0000)]
Make ext-core when making all in docs

15 years agoRemove the haddock detection
Ian Lynagh [Fri, 5 Sep 2008 18:25:53 +0000 (18:25 +0000)]
Remove the haddock detection
Now that we build haddock in the GHC build, we don't need to look for it
on the path.

15 years agoAdd a comment to utils/Makefile
Ian Lynagh [Fri, 5 Sep 2008 15:50:10 +0000 (15:50 +0000)]
Add a comment to utils/Makefile

15 years agoFix up the instance-declaration re-engineering story
simonpj@microsoft.com [Fri, 5 Sep 2008 17:26:54 +0000 (17:26 +0000)]
Fix up the instance-declaration re-engineering story

This patch deals with a rather complicated situation involving
overlapping instances.  It's all explained in the commments
   Note [Subtle interaction of recursion and overlap]

The absence of this case make DoCon and regex-base fail with
an error about overlapping instances.  Now they work properly
again.

15 years agoComments only
simonpj@microsoft.com [Fri, 5 Sep 2008 17:25:53 +0000 (17:25 +0000)]
Comments only

15 years agoMinor refactoring to share InstEnv.instanceBindFun
simonpj@microsoft.com [Fri, 5 Sep 2008 17:25:07 +0000 (17:25 +0000)]
Minor refactoring to share InstEnv.instanceBindFun

15 years agoRemove unused constructors AvoidMe, WildCard
simonpj@microsoft.com [Fri, 5 Sep 2008 17:24:24 +0000 (17:24 +0000)]
Remove unused constructors AvoidMe, WildCard

15 years agoMore specialiser wibbles
simonpj@microsoft.com [Fri, 5 Sep 2008 17:21:12 +0000 (17:21 +0000)]
More specialiser wibbles

Several things

 * Only gather call details for local things, not imported ones

 * When making auxiliary dictionary bindings in specDefn, remember
   to give them an unfolding.  Otherwise we don't gather call details
   for functions applied to them.

15 years agoRetain unfoldings even with SimplGently
simonpj@microsoft.com [Fri, 5 Sep 2008 17:18:14 +0000 (17:18 +0000)]
Retain unfoldings even with SimplGently

When binding x = e, we now attach an unfolding to 'x' even if
it won't be used because SimplGently is on.

Reason: the specialiser runs right after SimplGently, and it (now)
only gathers call information for calls whose dictionary arguments are
"interesting" -- i.e. have an unfolding of some kind.

15 years agoComments only
simonpj@microsoft.com [Fri, 5 Sep 2008 17:17:31 +0000 (17:17 +0000)]
Comments only

15 years agoBetter debug panic messages in applyTys
simonpj@microsoft.com [Fri, 5 Sep 2008 17:16:39 +0000 (17:16 +0000)]
Better debug panic messages in applyTys

15 years agoMake ASSERT2 mention msg even when debug is off (avoid warnings)
simonpj@microsoft.com [Fri, 5 Sep 2008 17:14:58 +0000 (17:14 +0000)]
Make ASSERT2 mention msg even when debug is off (avoid warnings)

15 years agoMove the "This is a generated file" to the top of GHC.Prim
Ian Lynagh [Fri, 5 Sep 2008 12:21:09 +0000 (12:21 +0000)]
Move the "This is a generated file" to the top of GHC.Prim

15 years agoMake genprimopcode generate code that haddock 2 understands
Ian Lynagh [Fri, 5 Sep 2008 12:14:43 +0000 (12:14 +0000)]
Make genprimopcode generate code that haddock 2 understands
Mainly this means adding a binding for all the exports, e.g. as well as
    gtAddr# :: Addr# -> Addr# -> Bool
we also generate
    gtAddr# = let x = x in x

15 years agoDefine _BSD_SOURCE in Stg.h
Ian Lynagh [Thu, 4 Sep 2008 18:50:42 +0000 (18:50 +0000)]
Define _BSD_SOURCE in Stg.h
This means S_ISSOCK gets defined on Linux

15 years agoAdd a note explaining a couple of seq's
Ian Lynagh [Thu, 4 Sep 2008 15:49:31 +0000 (15:49 +0000)]
Add a note explaining a couple of seq's

15 years agofix message for missing packages
Ross Paterson [Thu, 4 Sep 2008 16:48:16 +0000 (16:48 +0000)]
fix message for missing packages

An incorrect libraries/ prefix was being added.

15 years agoadd assertion to check that UniqFM is only passed "positive" uniques
dias@eecs.harvard.edu [Thu, 4 Sep 2008 13:51:55 +0000 (13:51 +0000)]
add assertion to check that UniqFM is only passed "positive" uniques
The insertion code in UniqFM fails if a unique key
produces a negative FastInt. I've added an assertion to check
that each insertion uses a positive Unique.

Where do the negative uniques come from? Both Simom M and
I have run into this problem when computing hashes for data structures.
In both cases, we have avoided the problem by ensuring that
the hashes remain positive.

15 years agoAdd darcs-all usage info
Ian Lynagh [Thu, 4 Sep 2008 12:54:12 +0000 (12:54 +0000)]
Add darcs-all usage info

15 years agoRe-merge concurrent,timeout,unique,st,getopt into base
Ian Lynagh [Wed, 3 Sep 2008 22:35:08 +0000 (22:35 +0000)]
Re-merge concurrent,timeout,unique,st,getopt into base

15 years agoFix ifBuildable
Ian Lynagh [Wed, 3 Sep 2008 20:41:01 +0000 (20:41 +0000)]
Fix ifBuildable
Required libraries now have 3 fields in the packages file, not 2

15 years agoMajor change in compilation of instance declarations (fix Trac #955, #2328)
simonpj@microsoft.com [Wed, 3 Sep 2008 12:02:28 +0000 (12:02 +0000)]
Major change in compilation of instance declarations (fix Trac #955, #2328)

This patch makes an important change to the way that dictionary
functions are handled.  Before, they were unconditionally marked
INLIINE, but all the code written by the user in the instance
was inside that unconditionally-inlined function.  Result: massive
code bloat in programs that use complicated instances.

This patch make instances behave rather as if all the methods
were written in separate definitions.  That dramatically reduces
bloat.  The new plan is described in TcInstDcls
Note [How instance declarations are translated]

Everything validates.  The major code-bloat bug is squashed: in particular
DoCon is fine now (Trac #2328) and I believe that #955 is also better.

Nofib results:

Binary sizes
        -1 s.d.      +2.5%
        +1 s.d.      +3.1%
        Average      +2.8%

Allocations
        -1 s.d.      -6.4%
        +1 s.d.      +2.5%
        Average      -2.0%

Note that 2% improvement.  Some programs improve by 20% (rewrite)!
Two get slightly worse: pic (2.1%), and gameteb (3.2%), but all others
improve or stay the same.

I am not absolutely 100% certain that all the corners are correct; for
example, when default methods are marked INLINE, are they inlined?  But
overall it's better.

It's nice that the patch also removes a lot of code.  I deleted some
out of date comments, but there's something like 100 fewer lines of
code in the new version!  (In the line counts below, there are a lot
of new comments.)

15 years agoImproved specialisation of recursive groups
simonpj@microsoft.com [Wed, 3 Sep 2008 11:56:29 +0000 (11:56 +0000)]
Improved specialisation of recursive groups

This patch significantly improves the way in which recursive groups
are specialised.  This turns out ot be very important when specilising
the bindings that (now) emerge from instance declarations.

Consider
    let rec { f x = ...g x'...
            ; g y = ...f y'.... }
    in f 'a'
Here we specialise 'f' at Char; but that is very likely to lead to
a specialisation of 'g' at Char.  We must do the latter, else the
whole point of specialisation is lost.  This was not happening before.

The whole thing is desribed in
    Note [Specialising a recursive group]

Simon

15 years agoCope with recent versions of Perl that lack the $* feature
simonpj@microsoft.com [Tue, 2 Sep 2008 10:30:43 +0000 (10:30 +0000)]
Cope with recent versions of Perl that lack the $* feature

15 years agoFIX #2554: GHC.TopHandler.{runIO,runNonIO} should be GC roots
Simon Marlow [Tue, 2 Sep 2008 12:45:04 +0000 (12:45 +0000)]
FIX #2554: GHC.TopHandler.{runIO,runNonIO} should be GC roots

15 years agoCheck the modification times of libraries in --make link step
Simon Marlow [Mon, 1 Sep 2008 13:26:14 +0000 (13:26 +0000)]
Check the modification times of libraries in --make link step
When linking in --make we check the modification time of the
executable against the modification time of the object files, and only
re-link if any object file is newer.  However, we should also check
the modification times of packages, since the recompilation checker
also tracks dependencies in packages.

In a GHC build this means that if you recompile stage2 and don't
manage to change any fingerpints, we won't recompile Main but we'll
still re-link it.

15 years agoMake the dynlibs, ghci and ncg flags manual too
Ian Lynagh [Sun, 31 Aug 2008 15:24:28 +0000 (15:24 +0000)]
Make the dynlibs, ghci and ncg flags manual too

15 years agoSquash a space leak
Ian Lynagh [Sat, 30 Aug 2008 23:54:30 +0000 (23:54 +0000)]
Squash a space leak

15 years agoFix a space leak
Ian Lynagh [Sat, 30 Aug 2008 19:26:19 +0000 (19:26 +0000)]
Fix a space leak

15 years agofix a space leak
Ian Lynagh [Sat, 30 Aug 2008 19:25:26 +0000 (19:25 +0000)]
fix a space leak

15 years agoMake ghc.cabal's editline flag manual, to simplify the Makefile
Ian Lynagh [Sun, 31 Aug 2008 15:21:03 +0000 (15:21 +0000)]
Make ghc.cabal's editline flag manual, to simplify the Makefile

15 years agoDon't build ghc in stage1 with editline (since we already don't build ghci). Fixes...
Judah Jacobson [Sat, 30 Aug 2008 21:14:29 +0000 (21:14 +0000)]
Don't build ghc in stage1 with editline (since we already don't build ghci).  Fixes #2557.

15 years agoIf we want a profiled GHC then use -auto-all when building the GHC lib
Ian Lynagh [Sat, 30 Aug 2008 19:13:05 +0000 (19:13 +0000)]
If we want a profiled GHC then use -auto-all when building the GHC lib