Simon Marlow [Wed, 2 Feb 2011 11:32:42 +0000 (11:32 +0000)]
add TRY_ACQUIRE_LOCK()
Simon Marlow [Wed, 2 Feb 2011 11:26:46 +0000 (11:26 +0000)]
Remove the per-generation mutable lists
Now that we use the per-capability mutable lists exclusively.
Simon Marlow [Tue, 1 Feb 2011 16:37:27 +0000 (16:37 +0000)]
+RTS -qw hasn't done anything since 7.0.1; remove the implementation & docs
It is still (silently) accepted for backwards compatibility.
Simon Marlow [Tue, 1 Feb 2011 08:58:30 +0000 (08:58 +0000)]
comments
Simon Marlow [Thu, 27 Jan 2011 16:42:26 +0000 (16:42 +0000)]
Annotate thread stop events with the owner of the black hole
So we can now get these in ThreadScope:
19487000: cap 1: stopping thread 6 (blocked on black hole owned by thread 4)
Note: needs an update to ghc-events. Older ThreadScopes will just
ignore the new information.
Simon Marlow [Tue, 25 Jan 2011 11:10:11 +0000 (11:10 +0000)]
update debugging code for fragmentation
simonpj@microsoft.com [Tue, 1 Feb 2011 12:29:20 +0000 (12:29 +0000)]
Fix type checker error message
See Trac #4940. We had a message
The lambda expression `\ x -> x' has one argument one argument,
repeating the "one argument" part. Easy fix.
simonpj@microsoft.com [Tue, 1 Feb 2011 12:28:41 +0000 (12:28 +0000)]
Some refactoring of SpecConstr
This was originally to improve the case when SpecConstr generated a
function with an unused argument (see Trac #4941), but I ended up
giving up on that. But the refactoring is still an improvement.
In particular I got rid of BothOcc, which was unused.
simonpj@microsoft.com [Tue, 1 Feb 2011 12:26:37 +0000 (12:26 +0000)]
Don't make join points when the case has only one non-bottom alternative
This fixes Trac #4930. See Note [Bottom alternatives] in Simplify.lhs
simonpj@microsoft.com [Mon, 31 Jan 2011 11:35:29 +0000 (11:35 +0000)]
Improve Simplifier and SpecConstr behaviour
Trac #4908 identified a case where SpecConstr wasn't "seeing" a
specialisation it should easily get. The solution was simple: see
Note [Add scrutinee to ValueEnv too] in SpecConstr.
Then it turned out that there was an exactly analogous infelicity in
the mighty Simplifer too; see Note [Add unfolding for scrutinee] in
Simplify. This fix is good for Simplify even in the absence of the
SpecConstr change. (It arose when I moved the binder- swap stuff to
OccAnall, not realising that it *remains* valuable to record info
about the scrutinee of a case expression. The Note says why.
Together these two changes are unconditionally good. Better
simplification, better specialisation. Thank you Max.
Simon Marlow [Mon, 31 Jan 2011 13:59:51 +0000 (13:59 +0000)]
fix warning
Simon Marlow [Wed, 13 Oct 2010 15:42:00 +0000 (15:42 +0000)]
32-bit fix
Simon Marlow [Wed, 19 Jan 2011 13:50:53 +0000 (13:50 +0000)]
update to mingw gcc 4.5.2
Simon Marlow [Thu, 11 Nov 2010 13:27:27 +0000 (13:27 +0000)]
count fizzled and GC'd sparks separately
Simon Marlow [Mon, 1 Nov 2010 12:41:43 +0000 (12:41 +0000)]
count "dud" sparks (expressions that were already evaluated when sparked)
Simon Marlow [Fri, 20 Aug 2010 09:31:33 +0000 (09:31 +0000)]
fix some shutdown memory leaks
Simon Marlow [Mon, 31 Jan 2011 12:34:33 +0000 (12:34 +0000)]
fix DEBUG build
simonpj@microsoft.com [Fri, 28 Jan 2011 11:54:00 +0000 (11:54 +0000)]
Fix formatting glitch in documentation
Simon Marlow [Fri, 28 Jan 2011 10:36:39 +0000 (10:36 +0000)]
Fix warnings
Simon Marlow [Mon, 24 Jan 2011 12:16:50 +0000 (12:16 +0000)]
Merge in new code generator branch.
This changes the new code generator to make use of the Hoopl package
for dataflow analysis. Hoopl is a new boot package, and is maintained
in a separate upstream git repository (as usual, GHC has its own
lagging darcs mirror in http://darcs.haskell.org/packages/hoopl).
During this merge I squashed recent history into one patch. I tried
to rebase, but the history had some internal conflicts of its own
which made rebase extremely confusing, so I gave up. The history I
squashed was:
- Update new codegen to work with latest Hoopl
- Add some notes on new code gen to cmm-notes
- Enable Hoopl lag package.
- Add SPJ note to cmm-notes
- Improve GC calls on new code generator.
Work in this branch was done by:
- Milan Straka <fox@ucw.cz>
- John Dias <dias@cs.tufts.edu>
- David Terei <davidterei@gmail.com>
Edward Z. Yang <ezyang@mit.edu> merged in further changes from GHC HEAD
and fixed a few bugs.
simonpj@microsoft.com [Fri, 28 Jan 2011 08:07:48 +0000 (08:07 +0000)]
Fix an egregious strictness analyser bug (Trac #4924)
The "virgin" flag was being threaded rather than treated
like an environment. As a result, the second and subsequent
recursive definitions in a module were not getting a
correctly-initialised fixpoint loop, causing much worse
strictness analysis results. Indeed the symptoms in
Trac #4924 were quite bizarre.
Anyway, it's easily fixed. Merge to stable branch.
simonpj@microsoft.com [Thu, 27 Jan 2011 13:13:04 +0000 (13:13 +0000)]
Refine incomplete-pattern checks (Trac #4905)
The changes are:
* New flag -fwarn-incomplete-uni-patterns, which checks for
incomplete patterns in (a) lambdas, (b) pattern bindings
* New flag is not implied by -W or -Wall (too noisy; and many
libraries use incomplete pattern bindings)
* Actually do the incomplete-pattern check for pattern bindings
(previously simply omitted)
* Documentation for new flag
Ian Lynagh [Thu, 27 Jan 2011 00:17:39 +0000 (00:17 +0000)]
Fix "make 1" etc following the build system changes
The logic is now in mk/compiler-ghc.mk rather than being duplicated in
ghc/Makefile and compiler/Makefile.
Roman Leshchinskiy [Wed, 26 Jan 2011 23:18:43 +0000 (23:18 +0000)]
Fix vectorisation of recursive types
simonpj@microsoft.com [Wed, 26 Jan 2011 17:21:12 +0000 (17:21 +0000)]
Fix dependencies among specialisations for imported Ids
This was a subtle one (Trac #4903). See
Note [Glom the bindings if imported functions are specialised]
in Speclialise.
Fundamentally, a specialised binding for an imported Id was being
declared non-recursive, whereas in fact it can become recursive
via a RULE. Once it's specified non-recurive the OccAnal pass
treats that as gospel -- and that in turn led to infinite inlining.
Easily fixed by glomming all the specialised bindings in a Rec;
now the OccAnal will sort them out correctly.
simonpj@microsoft.com [Wed, 26 Jan 2011 17:18:03 +0000 (17:18 +0000)]
Fix bug in roughTopNames
roughTopNames was returning a name that in fact might be
"looked though" by the rule matcher. Result: a rule
that should match was being pre-emptively discarded.
See Note [Care with roughTopName].
Fixes a bug noticed by Pedro (Trac #4918).
simonpj@microsoft.com [Wed, 26 Jan 2011 17:12:55 +0000 (17:12 +0000)]
Comments only, plus a tiny bit of debug printing
simonpj@microsoft.com [Wed, 26 Jan 2011 17:12:35 +0000 (17:12 +0000)]
Comments only
simonpj@microsoft.com [Wed, 26 Jan 2011 17:12:29 +0000 (17:12 +0000)]
Look through type synonyms when computing orphans
I renamed functions tyClsNamesOfTypes to oprhNamesOfType,
because it's only used in that capacity, and we therefore
want to look through type synonyms. Similarly exprOrphNames.
This fixes Trac #4912.
simonpj@microsoft.com [Wed, 26 Jan 2011 17:10:30 +0000 (17:10 +0000)]
Bleat a bit more informatively in unionLists
Ian Lynagh [Mon, 24 Jan 2011 23:31:21 +0000 (23:31 +0000)]
Keep separate linker flags, for when we want to link with gcc or ld
Ian Lynagh [Mon, 24 Jan 2011 18:36:18 +0000 (18:36 +0000)]
Fix validate on OS X 64
simonpj@microsoft.com [Tue, 25 Jan 2011 16:16:32 +0000 (16:16 +0000)]
Split main/GHC into GHC and GhcMake
There are two things going on in main/GHC.hs.
* It's the root module of the GHC package
* It contains lots of stuff for --make
It is also gigantic (2.7k lines)
This patch splits it into two
* GHC.hs is the root module for the GHC package
(1.3k lines)
* GhcMake.hs contains the stuff for --make
(1.4k lines)
Happily the functional split divided it almost
exactly in half.
This is a pure refactoring. There should be no
behavioural change.
simonpj@microsoft.com [Tue, 25 Jan 2011 13:11:15 +0000 (13:11 +0000)]
Comments only
simonpj@microsoft.com [Tue, 25 Jan 2011 11:05:25 +0000 (11:05 +0000)]
Fix Trac #3717 by making exprOkForSpeculation a bit cleverer
The main change here is to do with dropping redundant seqs.
See Note [exprOkForSpeculation: case expressions] in CoreUtils.
simonpj@microsoft.com [Tue, 25 Jan 2011 11:04:18 +0000 (11:04 +0000)]
Improve dataToTag# magic
dataToTag# is a bit unsatisfactory because it requires
its argument to be evaluated, and we don't have a good
way to enforce that. This patch adds some comments, and
makes exprOkForSpeculation a bit less picky in the case
of dataToTag# (since the argument may, in fact, not be
eval'd).
simonpj@microsoft.com [Tue, 25 Jan 2011 11:01:12 +0000 (11:01 +0000)]
Fix Trac #4917: try a bit harder to unify on-the-fly
This is generally a modest improvement but, more important,
it fixes a "unify-under-forall" problem. See Note [Avoid deferring].
There's still a lurking unsatisfactory-ness in that we can't
defer arbitrary constraints that are trapped under a forall.
Manuel M T Chakravarty [Mon, 24 Jan 2011 04:36:17 +0000 (04:36 +0000)]
DPH options updated
- '-Odph' is now '-O2 -fsimplifier-phases=3 -fsimplifier-iterations=20'
- The new option '-fdph-none' is the default; it indicates that no DPH
backend is selected and is the only valid option if the DPH libraries
are not installed. If vectorisation is attempted with -fdph-none a
suitable error message is generated.
- Hence, '-fdph-par' (or '-fdph-seq') needs to be explicitly selected
when using vectorisation and when linking vectorised code. (There
seems to be no elegant way to avoid that.)
Ian Lynagh [Sun, 23 Jan 2011 15:14:08 +0000 (15:14 +0000)]
Add build system profiling to build system
Ian Lynagh [Sun, 23 Jan 2011 12:02:32 +0000 (12:02 +0000)]
Fix ghci in stage3
Ian Lynagh [Sun, 23 Jan 2011 02:18:15 +0000 (02:18 +0000)]
Remove use of non-existent $$(dir) variable in the rts ghc.mk
Ian Lynagh [Sun, 23 Jan 2011 00:42:08 +0000 (00:42 +0000)]
Add some missing dependencies
Ian Lynagh [Sun, 23 Jan 2011 00:10:45 +0000 (00:10 +0000)]
Tweak some deps to avoid multiple $(wildcard ...)s
Note that some things depending on the rts/includes header files now
depend on more files: They used to include depend on includes/*.h, but
now they also depend on header files in subdirectories. As far as I can
see this was a bug.
Ian Lynagh [Sat, 22 Jan 2011 22:45:32 +0000 (22:45 +0000)]
Use := when assigning the result of $(wildcard ...)
Avoids repeated evaluations of things that need system calls etc
Ian Lynagh [Sat, 22 Jan 2011 19:09:28 +0000 (19:09 +0000)]
Simplify the build system, and remove 2 phases
From
http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture/Idiom/PhaseOrdering
Phase 0:
Includes: package-data.mk files for things built by the
bootstrapping compiler.
Builds: the dependency files for hsc2hs and genprimopcode. We need
to do this now, as hsc2hs needs to be buildable in phase 1's
includes (so that we can make the hpc library's .hs source
files, which in turn is necessary for making its dependency
files), and genprimopcode needs to be buildable in phase 1's
includes (so that we can make the primop-*.hs-incl files,
which are sources for the stage1 compiler library, and thus
necessary for making its dependency files).
Phase 1:
Includes: dependency files for things built by the bootstrapping
compiler.
Builds: package-data.mk files for everything else. Note that this
requires configuring the packages, which means telling cabal
which ghc to use, and thus the stage1 compiler gets built
during this phase.
Phase "":
Includes: dependency files for everything else.
Builds: Everything else.
Ian Lynagh [Fri, 21 Jan 2011 23:05:52 +0000 (23:05 +0000)]
Manually control more of the Cabal flags for the compiler and ghc packages
For some reason the Windows HEAD builder has started thinking the ghci
flag should be on in stage 1. This should fix it, and generally make
things a little more resilient.
Ian Lynagh [Fri, 21 Jan 2011 23:02:45 +0000 (23:02 +0000)]
Remove some hardcoded makefile settings
Now that we used cabal to configure the ghc-bin package they are no
longer needed.
Simon Marlow [Wed, 19 Jan 2011 14:06:33 +0000 (14:06 +0000)]
tweak newArray# documentation again
Ian Lynagh [Thu, 20 Jan 2011 00:03:08 +0000 (00:03 +0000)]
Fix OSTYPE test
simonpj@microsoft.com [Wed, 19 Jan 2011 22:22:47 +0000 (22:22 +0000)]
Comments only
simonpj@microsoft.com [Thu, 13 Jan 2011 15:50:23 +0000 (15:50 +0000)]
Add OSTYPE build-system variable, and use it
The use is in install.mk.in, where we need to know when
we're on Cygwin.
This fixes the build on my Windows box, where I have
both Msys and Cygwin.
Ian Lynagh [Wed, 19 Jan 2011 22:23:59 +0000 (22:23 +0000)]
Remove an extraneous comma that stopped ghc-cabal from building
Ian Lynagh [Wed, 19 Jan 2011 22:15:45 +0000 (22:15 +0000)]
Move some make variables around
Ian Lynagh [Wed, 19 Jan 2011 20:33:05 +0000 (20:33 +0000)]
Remove a debugging 'info'
Ian Lynagh [Wed, 19 Jan 2011 20:32:29 +0000 (20:32 +0000)]
Move the PACKAGE_MAGIC evaluation inside package-data.mk
Ian Lynagh [Wed, 19 Jan 2011 17:23:10 +0000 (17:23 +0000)]
Fix libraries/index.html's haddock dependency on Windows
Ian Lynagh [Wed, 19 Jan 2011 13:06:29 +0000 (13:06 +0000)]
Add configure phases for the stage 3 compiler
Marco Silva [Tue, 18 Jan 2011 22:23:52 +0000 (22:23 +0000)]
Include kfreebsdgnu in the list of Target Platforms.
Edward Z. Yang [Tue, 18 Jan 2011 22:18:34 +0000 (22:18 +0000)]
Fix documentation bug: newArray# accepts word count, not byte count.
Ian Lynagh [Tue, 18 Jan 2011 16:42:25 +0000 (16:42 +0000)]
Update the location of libffi.dll.a
As far as I can see this has been wrong for some time, but only bit
recently.
Ian Lynagh [Mon, 17 Jan 2011 21:46:32 +0000 (21:46 +0000)]
Update the generics docs; pointed out by Christian Maeder
Ian Lynagh [Mon, 17 Jan 2011 18:48:33 +0000 (18:48 +0000)]
ghc-cabal now adds the language flag being used
This means we get -XHaskell98 added to the list of flags, just like we
would if we were building with Cabal.
Ian Lynagh [Mon, 17 Jan 2011 20:05:40 +0000 (20:05 +0000)]
Reinstate the OS X flags in the LDFLAGS etc variables
I expect this will fix:
http://www.haskell.org/pipermail/cvs-ghc/2011-January/059098.html
Ian Lynagh [Mon, 17 Jan 2011 20:04:27 +0000 (20:04 +0000)]
Add NondecreasingIndentation extension to ghc-bin
Ian Lynagh [Mon, 17 Jan 2011 19:17:14 +0000 (19:17 +0000)]
Change an "if ... else return ()" into a "when"
Ian Lynagh [Mon, 17 Jan 2011 19:06:10 +0000 (19:06 +0000)]
Add NondecreasingIndentation to the list of extensions in ghc-pkg
Ian Lynagh [Mon, 17 Jan 2011 19:04:04 +0000 (19:04 +0000)]
Add NondecreasingIndentation to the list of extensions in the ghc package
Ian Lynagh [Mon, 17 Jan 2011 17:30:10 +0000 (17:30 +0000)]
Fix deps on the ghc package
The standard libraries/$depname scheme doesn't apply, so we need to
handle it specially.
Ian Lynagh [Mon, 17 Jan 2011 12:11:55 +0000 (12:11 +0000)]
Tidy up gmp cleaning
Ian Lynagh [Sun, 16 Jan 2011 19:49:19 +0000 (19:49 +0000)]
Remove redundant libraries/cabal-bin.hs
Ian Lynagh [Sun, 16 Jan 2011 18:03:06 +0000 (18:03 +0000)]
Turn off dtrace unless you override USE_DTRACE
There are problems with dtrace on 64bit 10.5. For now at least, we
just turn dtrace off unless you override USE_DTRACE
Ian Lynagh [Sun, 16 Jan 2011 17:52:18 +0000 (17:52 +0000)]
Simplify a bit of makefile
Ian Lynagh [Sun, 16 Jan 2011 17:34:59 +0000 (17:34 +0000)]
Tweak Windows phase ordering
Ian Lynagh [Sun, 16 Jan 2011 15:56:27 +0000 (15:56 +0000)]
Handle dependencies of programs on libraries correctly
Ian Lynagh [Sun, 16 Jan 2011 15:12:30 +0000 (15:12 +0000)]
It's not clear if LDFLAGS flags will be given to gcc or ld,
and they accept different flags, so for now do nothing
Ian Lynagh [Sun, 16 Jan 2011 15:09:01 +0000 (15:09 +0000)]
Fix cross-package dependency generation on Windows
Ian Lynagh [Sun, 16 Jan 2011 15:08:26 +0000 (15:08 +0000)]
Add some Windows-only CONFIGURE_PHASEs
Ian Lynagh [Sun, 16 Jan 2011 02:00:35 +0000 (02:00 +0000)]
Simplify, and future-proof, a dependency in the build system
Ian Lynagh [Sun, 16 Jan 2011 01:59:43 +0000 (01:59 +0000)]
Remove an unnecessary phase, and some unnecessary deps
now that cross-package deps are tracked correctly.
Ian Lynagh [Sun, 16 Jan 2011 01:57:14 +0000 (01:57 +0000)]
We can now pass -include-pkg-deps to the bootstrapping compiler
Ian Lynagh [Sun, 16 Jan 2011 00:31:54 +0000 (00:31 +0000)]
Remove some flags that are redundant now GHC gets configured by Cabal
Ian Lynagh [Sun, 16 Jan 2011 00:31:04 +0000 (00:31 +0000)]
Change some HC_OPTS var handling
In particular, this means ghc gets built with -rtsopt, -threaded, etc again.
Ian Lynagh [Sun, 16 Jan 2011 00:28:03 +0000 (00:28 +0000)]
Remove some unnecessary workarounds
We can now rely on cross-package deps working properly, as we require
GHC 6.12.
Ian Lynagh [Sun, 16 Jan 2011 00:11:21 +0000 (00:11 +0000)]
Tidy up a bit
Ian Lynagh [Sat, 15 Jan 2011 23:19:27 +0000 (23:19 +0000)]
Build system improvements
We no longer use dummy-ghc; instead we don't configure most packages
until the stage1 compiler is available.
We also now use Cabal for building the ghc-bin package.
There are a couple more sanity checks too.
Ian Lynagh [Sat, 15 Jan 2011 21:41:49 +0000 (21:41 +0000)]
Whitespace tweak
Ian Lynagh [Sat, 15 Jan 2011 20:21:04 +0000 (20:21 +0000)]
Fix libffi build rules
Fixes a rare race when both libHSffi.a and libHSffi_p.a were being built
at the same time:
"cp" libffi/dist-install/build/libffi.a libffi/dist-install/build/libHSffi.a
"cp" libffi/dist-install/build/libffi.a libffi/dist-install/build/libHSffi.a
"cp" libffi/dist-install/build/libffi.so libffi/dist-install/build/libHSffi-ghc7.1.
20110115.so
cp: cannot create regular file `libffi/dist-install/build/libHSffi.a': File exists
simonpj@microsoft.com [Fri, 14 Jan 2011 16:32:27 +0000 (16:32 +0000)]
Fix Trac #4874: specialisation of INLINABLE things
Johan discovered that when INLINABLE things are specialised
bad things can happen. This patch implements a hack -- but
it's a simple hack and it solves the problem.
See Note [Inline specialisations].
The hack part is that really INLINABLE should not cause *any* loss
optimisation, and it does; see Note [Don't w/w INLINABLE things] in
WorkWrap.
simonpj@microsoft.com [Fri, 14 Jan 2011 16:29:59 +0000 (16:29 +0000)]
Comments only
simonpj@microsoft.com [Fri, 14 Jan 2011 16:29:27 +0000 (16:29 +0000)]
Fix a buglet in postInlineUnconditionally
Under obscure circumstances (actually only shown up when fixing something
else) it was possible for a variable binding to be discarded although
it was still used. See Note [Top level and postInlineUnconditionally]
Simon Marlow [Fri, 14 Jan 2011 14:24:06 +0000 (14:24 +0000)]
cope with empty libraries/stamp directory (in git repo)
Simon Marlow [Fri, 14 Jan 2011 14:23:53 +0000 (14:23 +0000)]
add .gitignore
Edward Z. Yang [Thu, 13 Jan 2011 13:06:54 +0000 (13:06 +0000)]
Fix longstanding bug in C-- inlining for functions calls.
Simon Marlow [Thu, 13 Jan 2011 13:11:47 +0000 (13:11 +0000)]
fix for remote repos without -r
Simon Marlow [Thu, 13 Jan 2011 11:17:33 +0000 (11:17 +0000)]
add a version of packages that stores all the repos in git
Simon Marlow [Thu, 13 Jan 2011 11:16:54 +0000 (11:16 +0000)]
add the -r flag from darcs-all
simonpj@microsoft.com [Thu, 13 Jan 2011 11:14:21 +0000 (11:14 +0000)]
Make Template Haskell classInstances function return [ClassInstance]
This is a recently-introduce function, which was returning
a [Name], being the names of the dfuns. But what you really
want (obviously!) is the ClassInstances, and we have a TH type
for that.
This is an API change, so don't merge into GHC 7.0. But it's
a new part of TH which is still settling down.
Fixes Trac #4863.
simonpj@microsoft.com [Thu, 13 Jan 2011 11:12:33 +0000 (11:12 +0000)]
Improve the finder's error messages
I'd done all the work to add fuzzy-match suggestions, but they
weren't really being used! Here's what you get now
module Foo where
import Data.Lst
Foo.hs:3:1:
Failed to load interface for `Data.Lst'
Perhaps you meant
Data.List (from base)
Data.List (needs flag -package haskell2010-1.0.0.0)
Data.Int (needs flag -package haskell2010-1.0.0.0)
Use -v to see a list of the files searched for.
simonpj@microsoft.com [Thu, 13 Jan 2011 09:39:31 +0000 (09:39 +0000)]
White space only
simonpj@microsoft.com [Wed, 12 Jan 2011 17:07:19 +0000 (17:07 +0000)]
Produce an error message, not a crash, for HsOpApp with non-var operator
Fixes Trac #4877.