ghc.git
12 years agocache bd->todo_bd->free and the limit in the workspace
Simon Marlow [Wed, 21 Nov 2007 15:58:51 +0000 (15:58 +0000)] 
cache bd->todo_bd->free and the limit in the workspace
avoids cache contention: bd->todo_bd->free may clash with any cache
line, so we localise it.

12 years agowarning fix
simonmar@microsoft.com [Wed, 21 Nov 2007 16:47:47 +0000 (16:47 +0000)] 
warning fix

12 years agofix boundary bugs in a couple of for-loops
simonmar@microsoft.com [Tue, 20 Nov 2007 13:38:35 +0000 (13:38 +0000)] 
fix boundary bugs in a couple of for-loops

12 years agoimprovements to PAPI support
simonmar@microsoft.com [Tue, 20 Nov 2007 13:36:35 +0000 (13:36 +0000)] 
improvements to PAPI support
- major (multithreaded) GC is measured separately from minor GC
- events to measure can now be specified on the command line, e.g
     prog +RTS -a+PAPI_TOT_CYC

12 years agouse SRC_CC_OPTS rather than SRC_HC_OPTS for C options
simonmar@microsoft.com [Mon, 19 Nov 2007 11:16:30 +0000 (11:16 +0000)] 
use SRC_CC_OPTS rather than SRC_HC_OPTS for C options

12 years agoallow PAPI to be installed somewhere non-standard
Simon Marlow [Thu, 1 Nov 2007 15:03:25 +0000 (15:03 +0000)] 
allow PAPI to be installed somewhere non-standard

12 years agofix warnings
Simon Marlow [Thu, 1 Nov 2007 15:02:58 +0000 (15:02 +0000)] 
fix warnings

12 years agofix a warning
Simon Marlow [Thu, 1 Nov 2007 15:02:28 +0000 (15:02 +0000)] 
fix a warning

12 years agofix a warning
Simon Marlow [Thu, 1 Nov 2007 15:02:00 +0000 (15:02 +0000)] 
fix a warning

12 years agorename n_threads to n_gc_threads
Simon Marlow [Wed, 31 Oct 2007 16:31:47 +0000 (16:31 +0000)] 
rename n_threads to n_gc_threads

12 years agoRefactor PAPI support, and add profiling of multithreaded GC
Simon Marlow [Wed, 31 Oct 2007 16:30:15 +0000 (16:30 +0000)] 
Refactor PAPI support, and add profiling of multithreaded GC

12 years agofix merge errors
Simon Marlow [Wed, 31 Oct 2007 15:38:39 +0000 (15:38 +0000)] 
fix merge errors

12 years agorefactoring of eager_promotion in scavenge_block()
Simon Marlow [Wed, 31 Oct 2007 15:34:17 +0000 (15:34 +0000)] 
refactoring of eager_promotion in scavenge_block()

12 years agocompile special minor GC versions of evacuate() and scavenge_block()
Simon Marlow [Wed, 31 Oct 2007 15:33:39 +0000 (15:33 +0000)] 
compile special minor GC versions of evacuate() and scavenge_block()

This is for two reasons: minor GCs don't need to do per-object locking
for parallel GC, which is fairly expensive, and secondly minor GCs
don't need to follow SRTs.

12 years agofixes for eval_thunk_selector() in parallel GC
Simon Marlow [Wed, 31 Oct 2007 15:32:52 +0000 (15:32 +0000)] 
fixes for eval_thunk_selector() in parallel GC

12 years agoRemove the optimisation of avoiding scavenging for certain objects
Simon Marlow [Wed, 31 Oct 2007 14:45:42 +0000 (14:45 +0000)] 
Remove the optimisation of avoiding scavenging for certain objects

Some objects don't need to be scavenged, in particular if they have no
pointers.  This seems like an obvious optimisation, but in fact it
only accounts for about 1% of objects (in GHC, for example), and the
extra complication means it probably isn't worth doing.

12 years agoGC refactoring: change evac_gen to evac_step
Simon Marlow [Wed, 31 Oct 2007 14:42:30 +0000 (14:42 +0000)] 
GC refactoring: change evac_gen to evac_step

By establishing an ordering on step pointers, we can simplify the test
  (stp->gen_no < evac_gen)
to
  (stp < evac_step)
which is common in evacuate().

12 years agoGC refactoring: make evacuate() take an StgClosure**
Simon Marlow [Wed, 31 Oct 2007 14:36:34 +0000 (14:36 +0000)] 
GC refactoring: make evacuate() take an StgClosure**

Change the type of evacuate() from
  StgClosure *evacuate(StgClosure *);
to
  void evacuate(StgClosure **);

So evacuate() itself writes the source pointer, rather than the
caller.  This is slightly cleaner, and avoids a few memory writes:
sometimes evacuate() doesn't move the object, and in these cases the
source pointer doesn't need to be written.  It doesn't have a
measurable impact on performance, though.

12 years agotiny optimisation in evacuate()
Simon Marlow [Wed, 31 Oct 2007 13:09:35 +0000 (13:09 +0000)] 
tiny optimisation in evacuate()

12 years agoInitial parallel GC support
Simon Marlow [Wed, 31 Oct 2007 13:07:18 +0000 (13:07 +0000)] 
Initial parallel GC support

eg. use +RTS -g2 -RTS for 2 threads.  Only major GCs are parallelised,
minor GCs are still sequential. Don't use more threads than you
have CPUs.

It works most of the time, although you won't see much speedup yet.
Tuning and more work on stability still required.

12 years agoRefactoring of the GC in preparation for parallel GC
Simon Marlow [Wed, 31 Oct 2007 12:51:36 +0000 (12:51 +0000)] 
Refactoring of the GC in preparation for parallel GC

This patch localises the state of the GC into a gc_thread structure,
and reorganises the inner loop of the GC to scavenge one block at a
time from global work lists in each "step".  The gc_thread structure
has a "workspace" for each step, in which it collects evacuated
objects until it has a full block to push out to the step's global
list.  Details of the algorithm will be on the wiki in due course.

At the moment, THREADED_RTS does not compile, but the single-threaded
GC works (and is 10-20% slower than before).

12 years agoalso count total dispatch stalls in +RTS -as
Simon Marlow [Tue, 30 Oct 2007 14:45:09 +0000 (14:45 +0000)] 
also count total dispatch stalls in +RTS -as

12 years agomove GetRoots() to GC.c
Simon Marlow [Tue, 30 Oct 2007 13:00:52 +0000 (13:00 +0000)] 
move GetRoots() to GC.c

11 years agoTweak a comment to talk about UnboxedTuples rather than -fglasgow-exts
Ian Lynagh [Mon, 16 Jun 2008 22:52:48 +0000 (22:52 +0000)] 
Tweak a comment to talk about UnboxedTuples rather than -fglasgow-exts

11 years agoSuggest -XRelaxedPolyRec rather than -fglasgow-exts in an error message
Ian Lynagh [Mon, 16 Jun 2008 21:34:38 +0000 (21:34 +0000)] 
Suggest -XRelaxedPolyRec rather than -fglasgow-exts in an error message

11 years agoFix the splitter with perl 5.10; patch from Audrey Tang
Ian Lynagh [Wed, 11 Jun 2008 12:28:37 +0000 (12:28 +0000)] 
Fix the splitter with perl 5.10; patch from Audrey Tang

11 years agoRemove some build system code that can't happen
Ian Lynagh [Mon, 16 Jun 2008 18:14:25 +0000 (18:14 +0000)] 
Remove some build system code that can't happen
ghc_ge_601 is no longer defined

11 years agoFix Trac #2358: 1-tuples in Template Haskell
simonpj@microsoft.com [Sat, 14 Jun 2008 12:39:39 +0000 (12:39 +0000)] 
Fix Trac #2358: 1-tuples in Template Haskell

fons points out that TH was treating 1-tuples inconsistently.  Generally
we make a 1-tuple into a no-op, so that (e) and e are the same.  But
I'd forgotten to do this for types.

It is possible to have a type with an un-saturated 1-tuple type
constructor. That now elicits an error message when converting from
TH syntax to Hs syntax

11 years agoFix nasty Simplifier scoping bug
simonpj@microsoft.com [Sat, 14 Jun 2008 02:39:37 +0000 (02:39 +0000)] 
Fix nasty Simplifier scoping bug

This bug was somehow tickled by the new code for desugaring
polymorphic bindings, but the bug has been there a long time.  The
bindings floated out in simplLazyBind, generated by abstractFloats,
were getting processed by postInlineUnconditionally. But that was
wrong because part of their scope has already been processed.

That led to a bit of refactoring in the simplifier.  See comments
with Simplify.addPolyBind.

In principle this might happen in 6.8.3, but in practice it doesn't seem
to, so probably not worth merging.

11 years agoCoreLint should check for out-of-scope worker
simonpj@microsoft.com [Sat, 14 Jun 2008 02:38:09 +0000 (02:38 +0000)] 
CoreLint should check for out-of-scope worker

11 years agoMore commandline flag improvements
Ian Lynagh [Mon, 16 Jun 2008 14:29:17 +0000 (14:29 +0000)] 
More commandline flag improvements
* 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

11 years agoRemove an ifdef
Ian Lynagh [Mon, 16 Jun 2008 11:11:14 +0000 (11:11 +0000)] 
Remove an ifdef

11 years agoAdd ghc_ge_609
Ian Lynagh [Sun, 15 Jun 2008 13:46:36 +0000 (13:46 +0000)] 
Add ghc_ge_609

11 years agoRemove an ifdef
Ian Lynagh [Sun, 15 Jun 2008 13:37:43 +0000 (13:37 +0000)] 
Remove an ifdef

11 years agoDon't compile Cabal with -cpp -fffi
Ian Lynagh [Sun, 15 Jun 2008 01:08:26 +0000 (01:08 +0000)] 
Don't compile Cabal with -cpp -fffi
Instead rely on the sources having suitable pragmas

11 years agoRemove a typo
Ian Lynagh [Sun, 15 Jun 2008 00:59:56 +0000 (00:59 +0000)] 
Remove a typo

11 years agoAllow -X flags to be deprecated, and deprecate RecordPuns; fixes #2320
Ian Lynagh [Sun, 15 Jun 2008 00:00:41 +0000 (00:00 +0000)] 
Allow -X flags to be deprecated, and deprecate RecordPuns; fixes #2320

11 years agoFix a warning in DsForeign
Ian Lynagh [Sat, 14 Jun 2008 21:53:46 +0000 (21:53 +0000)] 
Fix a warning in DsForeign

11 years agoFix warnings in Linker
Ian Lynagh [Sat, 14 Jun 2008 21:26:27 +0000 (21:26 +0000)] 
Fix warnings in Linker

11 years agoUse the right set of linkables in unload_wkr
Ian Lynagh [Sat, 14 Jun 2008 21:15:39 +0000 (21:15 +0000)] 
Use the right set of linkables in unload_wkr

11 years agoUse bracket_ rather than bracket in withExtendedLinkEnv
Ian Lynagh [Sat, 14 Jun 2008 21:14:14 +0000 (21:14 +0000)] 
Use bracket_ rather than bracket in withExtendedLinkEnv

11 years agoRemove more ifdeffery
Ian Lynagh [Sat, 14 Jun 2008 20:51:31 +0000 (20:51 +0000)] 
Remove more ifdeffery

11 years agoRemove more ifdeffery
Ian Lynagh [Sat, 14 Jun 2008 20:42:34 +0000 (20:42 +0000)] 
Remove more ifdeffery

11 years agoRemove more ifdeffery
Ian Lynagh [Sat, 14 Jun 2008 20:32:15 +0000 (20:32 +0000)] 
Remove more ifdeffery

11 years agoRemove some ifdeffery
Ian Lynagh [Sat, 14 Jun 2008 20:26:40 +0000 (20:26 +0000)] 
Remove some ifdeffery

11 years agoFix some warnings in ParsePkgConf
Ian Lynagh [Sat, 14 Jun 2008 20:15:58 +0000 (20:15 +0000)] 
Fix some warnings in ParsePkgConf

11 years agoFix warnings in DsForeign
Ian Lynagh [Sat, 14 Jun 2008 20:08:20 +0000 (20:08 +0000)] 
Fix warnings in DsForeign

11 years agoFix warnings in PprCore
Ian Lynagh [Sat, 14 Jun 2008 19:56:11 +0000 (19:56 +0000)] 
Fix warnings in PprCore

11 years agoFix warnings in Main
Ian Lynagh [Sat, 14 Jun 2008 19:41:20 +0000 (19:41 +0000)] 
Fix warnings in Main

11 years agoSet -Wall in compiler/Makefile.ghcbin
Ian Lynagh [Sat, 14 Jun 2008 19:35:36 +0000 (19:35 +0000)] 
Set -Wall in compiler/Makefile.ghcbin

11 years agoUse maybePrefixMatch in StaticFlags rather than redefining it ourselves
Ian Lynagh [Sat, 14 Jun 2008 19:05:05 +0000 (19:05 +0000)] 
Use maybePrefixMatch in StaticFlags rather than redefining it ourselves

11 years agoUse -fforce-recomp rather than -no-recomp
Ian Lynagh [Sat, 14 Jun 2008 18:17:40 +0000 (18:17 +0000)] 
Use -fforce-recomp rather than -no-recomp

11 years agoTweak the deprecated flags warning
Ian Lynagh [Sat, 14 Jun 2008 17:48:50 +0000 (17:48 +0000)] 
Tweak the deprecated flags warning

11 years agoUse -O0 rather than -Onot in compiler/Makefile
Ian Lynagh [Sat, 14 Jun 2008 17:12:56 +0000 (17:12 +0000)] 
Use -O0 rather than -Onot in compiler/Makefile

11 years agoDon't use -recomp whem compiling GHC, as it's the default (and now deprecated)
Ian Lynagh [Sat, 14 Jun 2008 16:56:49 +0000 (16:56 +0000)] 
Don't use -recomp whem compiling GHC, as it's the default (and now deprecated)

11 years agoUse -fforce-recomp rather than -no-recomp when building genapply
Ian Lynagh [Sat, 14 Jun 2008 16:19:27 +0000 (16:19 +0000)] 
Use -fforce-recomp rather than -no-recomp when building genapply

11 years agoGet -recomp and -no-recomp the right way round
Ian Lynagh [Sat, 14 Jun 2008 16:18:51 +0000 (16:18 +0000)] 
Get -recomp and -no-recomp the right way round

11 years agoFix conversions between Double/Float and simple-integer
Ian Lynagh [Sat, 14 Jun 2008 15:23:37 +0000 (15:23 +0000)] 
Fix conversions between Double/Float and simple-integer

11 years agoUse unified diff
Ian Lynagh [Tue, 3 Jun 2008 17:29:47 +0000 (17:29 +0000)] 
Use unified diff

11 years agoUse -O0 rather than the deprecated -Onot
Ian Lynagh [Sat, 14 Jun 2008 15:21:31 +0000 (15:21 +0000)] 
Use -O0 rather than the deprecated -Onot

11 years agoHandle errors in an OPTIONS pragma when preprocessing
Ian Lynagh [Sat, 14 Jun 2008 14:58:40 +0000 (14:58 +0000)] 
Handle errors in an OPTIONS pragma when preprocessing

11 years agoAllow flags to be marked as deprecated
Ian Lynagh [Sat, 14 Jun 2008 14:48:29 +0000 (14:48 +0000)] 
Allow flags to be marked as deprecated

11 years agoeta-reduce a Monad type synonym, so we can use it non-applied
Ian Lynagh [Sat, 14 Jun 2008 14:20:56 +0000 (14:20 +0000)] 
eta-reduce a Monad type synonym, so we can use it non-applied

11 years agoUse a proper datatype, rather than pairs, for flags
Ian Lynagh [Sat, 14 Jun 2008 13:38:48 +0000 (13:38 +0000)] 
Use a proper datatype, rather than pairs, for flags

11 years agoFix warnings in DriverMkDepend
Ian Lynagh [Sat, 14 Jun 2008 13:32:24 +0000 (13:32 +0000)] 
Fix warnings in DriverMkDepend

11 years agoFix whitespace in DriverMkDepend
Ian Lynagh [Sat, 14 Jun 2008 13:29:14 +0000 (13:29 +0000)] 
Fix whitespace in DriverMkDepend

11 years agoFix the last warnings in DynFlags
Ian Lynagh [Sat, 14 Jun 2008 12:50:33 +0000 (12:50 +0000)] 
Fix the last warnings in DynFlags
We might want to put the values initSysTools finds in their own type,
rather than having them flattened into DynFlags

11 years agoPass dynflags down to loadPackageConfig rather than using defaultDynFlags
Ian Lynagh [Sat, 14 Jun 2008 12:34:27 +0000 (12:34 +0000)] 
Pass dynflags down to loadPackageConfig rather than using defaultDynFlags

11 years agoMake initSysTools use the dflags it is passed, rather than defaultDynFlags
Ian Lynagh [Sat, 14 Jun 2008 12:28:34 +0000 (12:28 +0000)] 
Make initSysTools use the dflags it is passed, rather than defaultDynFlags

11 years agoRemove some unused bindings from HaddockLex
Ian Lynagh [Sat, 14 Jun 2008 12:20:57 +0000 (12:20 +0000)] 
Remove some unused bindings from HaddockLex

11 years agoPass dynflags down through to pragState
Ian Lynagh [Sat, 14 Jun 2008 12:11:56 +0000 (12:11 +0000)] 
Pass dynflags down through to pragState
so we no longer need to use defaultDynFlags there

11 years agoWhitespace only in DynFlags
Ian Lynagh [Sat, 14 Jun 2008 12:03:16 +0000 (12:03 +0000)] 
Whitespace only in DynFlags

11 years agoDefine and use is_decdigit for lexing escapes; fixes trac #2304
Ian Lynagh [Fri, 13 Jun 2008 20:35:53 +0000 (20:35 +0000)] 
Define and use is_decdigit for lexing escapes; fixes trac #2304

11 years agoMake SysTools warning-free
Ian Lynagh [Thu, 12 Jun 2008 14:17:38 +0000 (14:17 +0000)] 
Make SysTools warning-free

11 years agoRemove some CPPery with the help of a new value isWindowsHost in Util
Ian Lynagh [Thu, 12 Jun 2008 00:27:11 +0000 (00:27 +0000)] 
Remove some CPPery with the help of a new value isWindowsHost in Util
isWindowsHost is True iff mingw32_HOST_OS is defined.

11 years agoRemove unused FFI import GetTempPathA (getTempPath)
Ian Lynagh [Thu, 12 Jun 2008 00:19:36 +0000 (00:19 +0000)] 
Remove unused FFI import GetTempPathA (getTempPath)

11 years agoWhitespace only, in SysTools
Ian Lynagh [Wed, 11 Jun 2008 23:31:29 +0000 (23:31 +0000)] 
Whitespace only, in SysTools

11 years agoGet rid of the last remnants of PROJECT_DIR
Ian Lynagh [Wed, 11 Jun 2008 23:04:33 +0000 (23:04 +0000)] 
Get rid of the last remnants of PROJECT_DIR
This disappeared when we stopped being "fptools" and became just "ghc"

11 years agoTell the testsuite how many threads we want it to use when validating
Ian Lynagh [Wed, 11 Jun 2008 15:54:56 +0000 (15:54 +0000)] 
Tell the testsuite how many threads we want it to use when validating

11 years agoFix warnings in LexCore
Ian Lynagh [Tue, 10 Jun 2008 12:53:17 +0000 (12:53 +0000)] 
Fix warnings in LexCore

11 years agoFix warnings in Ctype
Ian Lynagh [Tue, 10 Jun 2008 12:42:23 +0000 (12:42 +0000)] 
Fix warnings in Ctype

11 years agoFix warnings in TcPat
Ian Lynagh [Tue, 10 Jun 2008 12:33:43 +0000 (12:33 +0000)] 
Fix warnings in TcPat

11 years agoFix warnings in TcEnv
Ian Lynagh [Tue, 10 Jun 2008 12:18:19 +0000 (12:18 +0000)] 
Fix warnings in TcEnv

11 years agoFix warnings in TcRnTypes
Ian Lynagh [Fri, 6 Jun 2008 23:47:04 +0000 (23:47 +0000)] 
Fix warnings in TcRnTypes

11 years agoFix warnings in TcTyClsDecls
Ian Lynagh [Fri, 6 Jun 2008 21:32:39 +0000 (21:32 +0000)] 
Fix warnings in TcTyClsDecls

11 years agoFix warnings in TcHsType
Ian Lynagh [Fri, 6 Jun 2008 20:48:54 +0000 (20:48 +0000)] 
Fix warnings in TcHsType

11 years agoFix warnings in TcSimplify
Ian Lynagh [Fri, 6 Jun 2008 20:24:35 +0000 (20:24 +0000)] 
Fix warnings in TcSimplify

11 years agoFix warnings in TcRules
Ian Lynagh [Fri, 6 Jun 2008 20:08:00 +0000 (20:08 +0000)] 
Fix warnings in TcRules

11 years agoFix warnings in TcInstDcls
Ian Lynagh [Fri, 6 Jun 2008 20:05:34 +0000 (20:05 +0000)] 
Fix warnings in TcInstDcls

11 years agoFix warnings in TcMType
Ian Lynagh [Fri, 6 Jun 2008 19:49:31 +0000 (19:49 +0000)] 
Fix warnings in TcMType

11 years agoFix warnings in TcForeign
Ian Lynagh [Fri, 6 Jun 2008 19:26:10 +0000 (19:26 +0000)] 
Fix warnings in TcForeign

11 years agoFix warnings in TcClassDcl
Ian Lynagh [Fri, 6 Jun 2008 19:14:13 +0000 (19:14 +0000)] 
Fix warnings in TcClassDcl

11 years agoFix a bug in eqPatType
Ian Lynagh [Fri, 6 Jun 2008 18:46:31 +0000 (18:46 +0000)] 
Fix a bug in eqPatType
One of the conditions we were checking was
    t2 `eqPatLType` t2
rather than
    t1 `eqPatLType` t2

11 years agoShow whether DEBUG is on in ghc --info
Ian Lynagh [Fri, 6 Jun 2008 18:44:15 +0000 (18:44 +0000)] 
Show whether DEBUG is on in ghc --info

11 years agoUse -fno-toplevel-reorder with gcc >= 4.2 on sparc-solaris; fixes trac #2312
Ian Lynagh [Fri, 6 Jun 2008 13:38:17 +0000 (13:38 +0000)] 
Use -fno-toplevel-reorder with gcc >= 4.2 on sparc-solaris; fixes trac #2312

11 years agoTeach configure about amd64/NetBSD; fixes trac #2348
Ian Lynagh [Fri, 6 Jun 2008 13:09:55 +0000 (13:09 +0000)] 
Teach configure about amd64/NetBSD; fixes trac #2348

11 years agoEnable the mangler for netbsd/amd64; fixes trac #2347
Ian Lynagh [Fri, 6 Jun 2008 13:07:06 +0000 (13:07 +0000)] 
Enable the mangler for netbsd/amd64; fixes trac #2347

11 years agoImprove documentation for standalone deriving
simonpj@microsoft.com [Fri, 6 Jun 2008 12:24:59 +0000 (12:24 +0000)] 
Improve documentation for standalone deriving

11 years agoFix Trac #2334: validity checking for type families
simonpj@microsoft.com [Fri, 6 Jun 2008 12:17:30 +0000 (12:17 +0000)] 
Fix Trac #2334: validity checking for type families

When we deal with a family-instance declaration (TcTyClsDecls.tcFamInstDecl)
we must check the TyCon for validity; for example, that a newtype has exactly
one field.  That is done all-at-once for normal declarations, and had been
forgotten altogether for families.

I also refactored the interface to tcFamInstDecl1 slightly.

A slightly separate matter: if there's an error in family instances
(e.g. overlap) we get a confusing error message cascade if we attempt to
deal with 'deriving' clauses too; this patch bales out earlier in that case.

Another slightly separate matter: standalone deriving for family
instances can legitimately have more specific types, just like normal
data decls. For example

   data instance F [a] = ...
   deriving instance (Eq a, Eq b) => Eq (F [(a,b)])

So tcLookupFamInstExact can a bit more forgiving than it was.

11 years agoVital follow-up to fix of Trac #2045
simonpj@microsoft.com [Thu, 5 Jun 2008 16:54:34 +0000 (16:54 +0000)] 
Vital follow-up to fix of Trac #2045

Sorry -- my 'validate' didn't work right and I missed a trick.
This patch must accompany

 * Fix Trac #2045: use big-tuple machiney for implication constraints