Roman Leshchinskiy [Fri, 12 Sep 2008 00:44:03 +0000 (00:44 +0000)]
Expose the dph packages automatically if -dph-* is set
Roman Leshchinskiy [Thu, 11 Sep 2008 05:43:33 +0000 (05:43 +0000)]
Don't panic on non-vectorisable expressions
Roman Leshchinskiy [Wed, 10 Sep 2008 04:53:39 +0000 (04:53 +0000)]
-Odph implies -fno-spec-constr-count
simonpj@microsoft.com [Mon, 15 Sep 2008 15:49:08 +0000 (15:49 +0000)]
Improve warning for SpecConstr
simonpj@microsoft.com [Mon, 15 Sep 2008 15:48:41 +0000 (15:48 +0000)]
White space only
simonpj@microsoft.com [Mon, 15 Sep 2008 07:29:46 +0000 (07:29 +0000)]
Minor refactoring to get rid of Type.splitNewTyConApp
simonpj@microsoft.com [Mon, 15 Sep 2008 15:06:01 +0000 (15:06 +0000)]
Refactor the desugaring of RULE lhss a bit
This is just a tidy-up. Previously we were calling occurAnalyse
twice on each LHS which was silly and a bit unclean too.
This patch should have no overall effect, though.
simonpj@microsoft.com [Mon, 15 Sep 2008 15:04:33 +0000 (15:04 +0000)]
Do not use the Static Arg Transformation by default with -O2
Max has some more heuristics to add, and is meanwhile worried
that having SAT on by default will make some highly-tuned array
programs worse. So it's off by default.
Use -fstatic-argument-transformation to switch it on.
simonpj@microsoft.com [Sun, 14 Sep 2008 11:46:41 +0000 (11:46 +0000)]
Comments, and a couple of asserts, only
simonpj@microsoft.com [Sun, 14 Sep 2008 11:34:34 +0000 (11:34 +0000)]
Fix Trac #2587: take account of type lets
GHC allows a non-recursive let for type varaibles
let a = TYPE ty in ...
But the free-variable finder had not caught up with this
fact. This patch catches up.
simonpj@microsoft.com [Sun, 14 Sep 2008 11:33:24 +0000 (11:33 +0000)]
Don't try to float type-lets
A type let shouldn't really occur in SetLevels, but if it does,
this patch makes sure it is left alone.
Ross Paterson [Mon, 15 Sep 2008 10:47:57 +0000 (10:47 +0000)]
add refs and fix a bug (noted by Peter Gammie) in docs of arrow notation
Thomas Schilling [Mon, 15 Sep 2008 08:57:38 +0000 (08:57 +0000)]
Generalise type of 'withExtendedLinkEnv'.
Thomas Schilling [Mon, 15 Sep 2008 08:56:33 +0000 (08:56 +0000)]
Use 'GhcMonad' in ghci/InteractiveUI.
Thomas Schilling [Mon, 15 Sep 2008 08:49:22 +0000 (08:49 +0000)]
Use 'GhcMonad' in ghci/GhciTags.
Thomas Schilling [Mon, 15 Sep 2008 08:47:38 +0000 (08:47 +0000)]
Use 'GhcMonad' in ghci/Debugger.
Thomas Schilling [Mon, 15 Sep 2008 08:46:46 +0000 (08:46 +0000)]
Use 'GhcMonad' in ghci/GhciMonad.
Thomas Schilling [Sun, 14 Sep 2008 23:29:57 +0000 (23:29 +0000)]
Use 'GhcMonad' in ghc/Main.
Thomas Schilling [Sun, 14 Sep 2008 23:26:42 +0000 (23:26 +0000)]
Require PatternSignatures for bootstrapping compiler.
Thomas Schilling [Sun, 14 Sep 2008 23:24:54 +0000 (23:24 +0000)]
Use 'GhcMonad' in InteractiveEval.
Thomas Schilling [Sun, 14 Sep 2008 23:20:44 +0000 (23:20 +0000)]
Use 'GhcMonad' in GHC and split up checkModule into phases.
I'm not sure I covered all the ways of throwing errors in the code.
Some functions throw ProgramErrors, some error messages. It's still
quite a mess, but we're getting closer. The missing cases are mostly
errors that cannot be fixed by the API client either or are a result
of wrong usage, so are in any case fatal.
One function, 'getModuleInfo', still returns a 'Maybe', but the
documentation suggests it should always succeed. So I may change that
soon.
The spit-up of of 'checkModule' has pros and cons. The various forms
of 'checkModule*' now become:
checkAndLoadModule ms False ~~>
loadModule =<< typecheckModule =<< parseModule (ms_mod_name ms)
checkAndLoadModule ms True ~~>
loadModule =<< desugarModule =<< typecheckModule =<< parseModule (ms_mod_name ms)
checkModule mn False ~~>
typecheckModule =<< parseModule mn
checkModule mn True ~~>
desugarModule =<< typecheckModule =<< parseModule mn
The old APIs cannot easily be provided, since the result type would be
different depending on the second argument. However, a more
convenient API can be modelled on top of these four functions
({parse,typecheck,desugar,load}Module).
Thomas Schilling [Sun, 14 Sep 2008 22:06:28 +0000 (22:06 +0000)]
Use 'GhcMonad' in DriverPipeline. Also haddockify a bit while we're at it.
Thomas Schilling [Sun, 14 Sep 2008 21:36:55 +0000 (21:36 +0000)]
Use 'GhcMonad' in HscMain.
Thomas Schilling [Sun, 14 Sep 2008 21:21:13 +0000 (21:21 +0000)]
Use 'GhcMonad' in DriverMkDepend.
Thomas Schilling [Sun, 14 Sep 2008 21:17:18 +0000 (21:17 +0000)]
Haddockify DynFlags (partial).
Thomas Schilling [Sun, 14 Sep 2008 21:00:16 +0000 (21:00 +0000)]
Haddockify 'IE'.
Thomas Schilling [Sun, 14 Sep 2008 20:58:11 +0000 (20:58 +0000)]
Provide accessors for 'ImportDecl'.
Thomas Schilling [Sun, 14 Sep 2008 20:56:29 +0000 (20:56 +0000)]
Start haddockifying 'HsBindLR'.
Thomas Schilling [Sun, 14 Sep 2008 20:53:16 +0000 (20:53 +0000)]
Document 'parseStaticFlags'.
Thomas Schilling [Sun, 14 Sep 2008 20:49:30 +0000 (20:49 +0000)]
Introduce 'GhcMonad' class and two default implementations 'Ghc' and 'GhcT'.
This monad will be required by most public API calls.
Thomas Schilling [Sun, 14 Sep 2008 17:39:04 +0000 (17:39 +0000)]
Give the "Failing due to -Werror" message a name.
Thomas Schilling [Sun, 14 Sep 2008 17:32:28 +0000 (17:32 +0000)]
Make typechecker top-level functions also return messages instead of
printing them.
Thomas Schilling [Sun, 14 Sep 2008 17:27:11 +0000 (17:27 +0000)]
Reflect changes of desugarer error reporting in VectMonad.
Thomas Schilling [Sun, 14 Sep 2008 17:24:04 +0000 (17:24 +0000)]
Generalise 'handleGhcException' to work with any 'ExceptionMonad'.
Thomas Schilling [Sun, 14 Sep 2008 17:21:54 +0000 (17:21 +0000)]
Introduce an 'ExceptionMonad' class.
This monad provides variants of 'catch', 'bracket', and 'finally', so
exceptions can be handled in monads that wrap IO. The latter two
methods need to be part of the class definition, because GHC uses
'block' and 'unblock' which are used in the definition of those two
methods for the IO monad. A perhaps better class interface would
consist of 'gcatch', 'gblock', and 'gunblock' and let the latter two
default to 'id' like is done for non-GHC implementations of 'bracket'
and 'finally'.
Thomas Schilling [Sun, 14 Sep 2008 16:42:45 +0000 (16:42 +0000)]
Provide default MonadIO instance for IO.
Thomas Schilling [Sun, 14 Sep 2008 16:36:41 +0000 (16:36 +0000)]
Return instead of print warnings and errors in desugarer.
Thomas Schilling [Sun, 14 Sep 2008 16:26:44 +0000 (16:26 +0000)]
Return parser errors and warnings instead of dying.
Thomas Schilling [Sun, 14 Sep 2008 16:03:37 +0000 (16:03 +0000)]
Add aliases for bags of warnings and errors.
Tim Chevalier [Mon, 15 Sep 2008 08:06:50 +0000 (08:06 +0000)]
Slightly more helpful panic message in DynFlags
Tim Chevalier [Sun, 14 Sep 2008 20:36:45 +0000 (20:36 +0000)]
Comments only: ".core" => ".hcr"
Ian Lynagh [Sat, 13 Sep 2008 15:31:42 +0000 (15:31 +0000)]
We need to tell ghc-pkg to --force if we've only built a profiling library
Ian Lynagh [Sat, 13 Sep 2008 14:48:20 +0000 (14:48 +0000)]
If we're profiling GHC, don't bother building the GHC package the vanilla way
Ian Lynagh [Sat, 13 Sep 2008 14:44:13 +0000 (14:44 +0000)]
Remove the duplicate show rule in libraries/Makefile
Ian Lynagh [Sat, 13 Sep 2008 14:13:12 +0000 (14:13 +0000)]
Move the "show" target from target.mk to boilerplate.mk
target.mk isn't included everywhere, but show is always handy
Ian Lynagh [Sat, 13 Sep 2008 10:46:58 +0000 (10:46 +0000)]
Change how we detect if we are using the bootstrapping compiler or not
I think looking for $(GHC_COMPILER_DIR_ABS) was failing on the Windows
buildbot due to different path separators. Now we just look for
"inplace".
Ian Lynagh [Fri, 12 Sep 2008 13:59:32 +0000 (13:59 +0000)]
wibble the distrib Makefile
We now need to install driver after ghc
Ian Lynagh [Fri, 12 Sep 2008 11:36:19 +0000 (11:36 +0000)]
Reinstate the driver/ghc directory, to create a versioned GHC program
e.g. $(bindir)/ghc-6.9.
20080911
Ian Lynagh [Fri, 12 Sep 2008 11:03:16 +0000 (11:03 +0000)]
If USE_NEW_MKDEPEND_FLAGS is YES then don't use the deprecated -optdep flags
Ian Lynagh [Fri, 12 Sep 2008 01:28:55 +0000 (01:28 +0000)]
Use --force-local when calling tar in bindisttest/
Otherwise it thinks that c:/foo is a remote file
Simon Marlow [Fri, 12 Sep 2008 13:04:04 +0000 (13:04 +0000)]
Fix #2586, bug in THUNK_SELECTORs (again)
This time, we had forgetten the write barrier in one place.
Simon Marlow [Fri, 12 Sep 2008 11:25:44 +0000 (11:25 +0000)]
Fix crash in biographical heap profiling (#2576)
Simon Marlow [Fri, 12 Sep 2008 11:06:43 +0000 (11:06 +0000)]
Fix retainer profiling (#2576)
Simon Marlow [Fri, 12 Sep 2008 10:01:40 +0000 (10:01 +0000)]
Fix some bugs in the stack-reducing code (#2571)
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.
Tim Chevalier [Fri, 12 Sep 2008 03:45:15 +0000 (03:45 +0000)]
ext-core library: expose some more modules
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...)
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.
Tim Chevalier [Fri, 12 Sep 2008 03:14:52 +0000 (03:14 +0000)]
ext-core library: Extend Core preprocessor
See comments for details.
Tim Chevalier [Fri, 12 Sep 2008 02:56:15 +0000 (02:56 +0000)]
ext-core library: Export a bunch more stuff from the parser
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.
Tim Chevalier [Fri, 12 Sep 2008 02:38:42 +0000 (02:38 +0000)]
ext-core library: Remove some cruft
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.
Ian Lynagh [Thu, 11 Sep 2008 15:38:27 +0000 (15:38 +0000)]
Use OSThreadProcAttr for workerStart
Ian Lynagh [Thu, 11 Sep 2008 14:05:19 +0000 (14:05 +0000)]
Include docs in the bindists
Ian Lynagh [Thu, 11 Sep 2008 12:54:22 +0000 (12:54 +0000)]
Don't install pwd
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
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
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.
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
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
Ian Lynagh [Tue, 9 Sep 2008 11:35:43 +0000 (11:35 +0000)]
Link to core.pdf, not core.ps.gz
simonpj@microsoft.com [Wed, 10 Sep 2008 14:20:42 +0000 (14:20 +0000)]
Fix debug message formatting on Windows
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.
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!
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.
simonpj@microsoft.com [Wed, 10 Sep 2008 08:23:13 +0000 (08:23 +0000)]
Fix Trac #2573; and explanatory comment
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.)
simonpj@microsoft.com [Wed, 10 Sep 2008 08:19:13 +0000 (08:19 +0000)]
Add newDictOcc, newDictOccs
simonpj@microsoft.com [Wed, 10 Sep 2008 08:18:15 +0000 (08:18 +0000)]
Layout and type synonyms only
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.
simonpj@microsoft.com [Wed, 10 Sep 2008 08:15:10 +0000 (08:15 +0000)]
Rename a variable
simonpj@microsoft.com [Wed, 10 Sep 2008 06:50:30 +0000 (06:50 +0000)]
Comments only
simonpj@microsoft.com [Wed, 10 Sep 2008 07:35:29 +0000 (07:35 +0000)]
Simplify the type signature for tcPolyBinds
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.)
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.
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.
Simon Marlow [Tue, 9 Sep 2008 14:51:22 +0000 (14:51 +0000)]
when a memory leak is detected, report which blocks are unreachable
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
Simon Marlow [Tue, 9 Sep 2008 13:43:02 +0000 (13:43 +0000)]
un-disable warnings in some modules
Simon Marlow [Tue, 9 Sep 2008 13:42:47 +0000 (13:42 +0000)]
Fix warnings
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.
Simon Marlow [Tue, 9 Sep 2008 13:34:53 +0000 (13:34 +0000)]
Move checkGlobalTSOList() call from GarbageCollect() to checkSanity()
Simon Marlow [Tue, 9 Sep 2008 13:33:07 +0000 (13:33 +0000)]
small bugfix in traverseBlackHoleQueue()
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.
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
berthold@mathematik.uni-marburg.de [Tue, 19 Aug 2008 15:18:42 +0000 (15:18 +0000)]
Capability stopping when waiting for GC
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.
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.
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.