simonpj@microsoft.com [Thu, 19 Nov 2009 12:41:27 +0000 (12:41 +0000)]
Try harder not to make DFuns into loop breakers
See Note [DFuns should not be loop breakers]
simonpj@microsoft.com [Tue, 17 Nov 2009 13:23:08 +0000 (13:23 +0000)]
Extend the GHCi FAQ slightly
Ian Lynagh [Thu, 19 Nov 2009 14:49:27 +0000 (14:49 +0000)]
Add gnutar to the list of names we use when looking for GNU tar
Ian Lynagh [Thu, 19 Nov 2009 14:08:11 +0000 (14:08 +0000)]
Add support for the man page to the new build system
simonpj@microsoft.com [Thu, 19 Nov 2009 12:37:04 +0000 (12:37 +0000)]
Refactor case-merging and identical-alternative optimisations
These two optimisations were originally done by SimplUtils.mkCase
*after* all the pieces have been simplified. Some while ago I
moved them *before*, so they were done by SimplUtils.prepareAlts.
It think the reason was that I couldn't rely on the dead-binder
information on OutIds, and that info is useful in these optimisations.
However,
(a) Other changes (notably moving case-binder-swap to OccurAnal)
have meant that dead-binder information is accurate in
OutIds
(b) When there is a cascade of case-merges, they happen in
one sweep if you do it after, but in many sweeps if you
do it before. Reason: doing it after means you are looking
at nice simplified Core.
simonpj@microsoft.com [Thu, 19 Nov 2009 11:57:36 +0000 (11:57 +0000)]
Fix a nasty infelicity in the size computation of CoreUnfold
The size computation was treating gigantic case expressions as
practically free, which they really aren't. It was exacerbated by
recent decisions to charge 0 for naked variables and constructors, so
the RHS of the case might look free too. A good example was
Foreign.C.Error.errnoToIOError, which hsa lots of join points
that were getting inlined way to vigorously, so we had:
*** Simplifier Phase 2 [main]:
Result size = 2983
*** Core Linted result of Simplifier mode 2 [main], iteration 1 out of 4:
Result size = 640327
*** Core Linted result of Simplifier mode 2 [main], iteration 2 out of 4:
Result size = 1659
Notice that gigantic intermediate!
This patch adds a small charge for each *alternative*. Of course,
that'll also mean that there's a bit less inling of things involving
case expressions.
simonpj@microsoft.com [Thu, 19 Nov 2009 11:51:22 +0000 (11:51 +0000)]
Comments and white space only
Roman Leshchinskiy [Thu, 19 Nov 2009 10:26:39 +0000 (10:26 +0000)]
Fix splitAppTys
Ben.Lippmeier@anu.edu.au [Thu, 19 Nov 2009 00:02:39 +0000 (00:02 +0000)]
Windows DLLs: Slurp across the actually static version of libffi
Ben.Lippmeier@anu.edu.au [Wed, 18 Nov 2009 11:05:48 +0000 (11:05 +0000)]
Windows DLLs: Don't rely on stg/DLL.h being included in RtsAPI.h
Ben.Lippmeier@anu.edu.au [Wed, 18 Nov 2009 11:05:25 +0000 (11:05 +0000)]
Fix warnings about unused imports
Ben.Lippmeier@anu.edu.au [Wed, 18 Nov 2009 09:01:05 +0000 (09:01 +0000)]
Windows DLLs: stifle more warnings about auto imported symbols
Ben.Lippmeier@anu.edu.au [Wed, 18 Nov 2009 05:15:26 +0000 (05:15 +0000)]
Windows DLLs: stifle warnings about symbols being auto imported from DLLs
Ben.Lippmeier@anu.edu.au [Wed, 18 Nov 2009 04:39:01 +0000 (04:39 +0000)]
Windows DLLs: add #ifdefery to turn off DLL import of libffi when building statically.
Ben.Lippmeier@anu.edu.au [Tue, 17 Nov 2009 05:06:48 +0000 (05:06 +0000)]
Windows DLLs: disable extra shutdownHaskell() when unloading the RTS DLL
Ben.Lippmeier@anu.edu.au [Tue, 17 Nov 2009 04:38:51 +0000 (04:38 +0000)]
Windows DLLs: remove dup symbol from def file
Ben.Lippmeier@anu.edu.au [Tue, 17 Nov 2009 04:37:16 +0000 (04:37 +0000)]
Use opt_PIC not #defined __PIC__ in compiler source.
Ben.Lippmeier@anu.edu.au [Sat, 14 Nov 2009 06:32:40 +0000 (06:32 +0000)]
Windows DLLs: CHARLIKE_closure and INTLIKE_closure aren't defined in this way.
Ben.Lippmeier@anu.edu.au [Sat, 14 Nov 2009 06:31:57 +0000 (06:31 +0000)]
If a comment says "Is this correct?", it's not.
Ben.Lippmeier@anu.edu.au [Sat, 14 Nov 2009 06:30:46 +0000 (06:30 +0000)]
Windows DLLs: gmp is in the integer-gmp package now.
Ben.Lippmeier@anu.edu.au [Sat, 14 Nov 2009 06:15:59 +0000 (06:15 +0000)]
Use DLL aware runIO_closure instead of base_GHCziTopHandler_runIO_closure directly
Ben.Lippmeier@anu.edu.au [Sat, 14 Nov 2009 06:14:45 +0000 (06:14 +0000)]
RTS also uses runSparks_closure from base
Ben.Lippmeier@anu.edu.au [Sat, 14 Nov 2009 06:11:09 +0000 (06:11 +0000)]
Provide extralibs when linking Windows DLLs
Ben.Lippmeier@anu.edu.au [Sat, 14 Nov 2009 06:04:55 +0000 (06:04 +0000)]
Don't share low valued Int and Char closures with Windows DLLs
Ben.Lippmeier@anu.edu.au [Wed, 11 Nov 2009 01:48:21 +0000 (01:48 +0000)]
Windows DLLs: use one import lib for each DLL the RTS needs.
Ben.Lippmeier@anu.edu.au [Tue, 10 Nov 2009 05:12:57 +0000 (05:12 +0000)]
Add autoconf code to locate dlltool on Windows
Ben.Lippmeier@anu.edu.au [Fri, 6 Nov 2009 06:27:32 +0000 (06:27 +0000)]
Break recursive imports between the RTS and base library on Windows.
The file rts/win32/libHSbase.def contains a list of all the
symbols from the base library that the RTS needs.
When building the RTS into a DLL on Windows, we want to link the DLL
for the RTS before we link the DLL for the base library. We use
libHSbase.def to make the "import library" libHSbase.so.a, which
contains stubs for each of the symbols from the base library that
the RTS needs.
Ian Lynagh [Wed, 18 Nov 2009 19:55:23 +0000 (19:55 +0000)]
Add the msysCORE*.tar.gz tarball to the list of tarballs we unpack
Ian Lynagh [Wed, 18 Nov 2009 15:05:08 +0000 (15:05 +0000)]
Put the libffi files to be installed into a dist directory
This meakes it easier to correctly clean libffi
Ian Lynagh [Wed, 18 Nov 2009 13:10:47 +0000 (13:10 +0000)]
Add ghc-tarballs to the list of directories that go into an sdist
Ian Lynagh [Wed, 18 Nov 2009 12:41:02 +0000 (12:41 +0000)]
Remove redundant libffi/tarball directory
We now use the tarball in the ghc-tarballs repo
Ian Lynagh [Tue, 17 Nov 2009 22:35:56 +0000 (22:35 +0000)]
Fix gen_contents_index on MSYS
On MSYS
sed 's/.*[ \t]//'
wasn't matching
version:<tab>1.0
so I've switched to
's/.*[[:space:]]//'
which works on Linux, cygwin and MSYS.
Simon Marlow [Tue, 17 Nov 2009 15:11:33 +0000 (15:11 +0000)]
include the GHC package docs in a bindist
Simon Marlow [Tue, 17 Nov 2009 15:11:23 +0000 (15:11 +0000)]
exclude some haddock-related rules during BINDIST
Simon Marlow [Mon, 16 Nov 2009 12:01:37 +0000 (12:01 +0000)]
Add an install-docs target that emits a helpful diagnostic (#3662)
Simon Marlow [Mon, 16 Nov 2009 11:56:30 +0000 (11:56 +0000)]
fix install_docs dependencies, and add a missing $(INSTALL_DIR)
Simon Marlow [Fri, 13 Nov 2009 12:57:19 +0000 (12:57 +0000)]
Tweak to the directory-building rule
So we don't try to recreate directories just because they are older
than mkdirhier, since mkdirhier won't touch them.
simonpj@microsoft.com [Tue, 17 Nov 2009 12:55:26 +0000 (12:55 +0000)]
exprIsHNF should "look through" lets
I can't quite remember when I spotted this, but exprIsHNF (and
similarly exprIsConLike) should ignore enclosing let-bindings,
since they don't affect termination.
simonpj@microsoft.com [Tue, 17 Nov 2009 12:54:17 +0000 (12:54 +0000)]
Improvement to typecheck higher-rank rules better
See Note [Typechecking rules] in TcRules.
Suggested by Roman
simonpj@microsoft.com [Tue, 17 Nov 2009 10:44:37 +0000 (10:44 +0000)]
Apply RULES to simplified arguments
See Note [RULEs apply to simplified arguments] in Simplify.lhs
A knock-on effect is that rules apply *after* we try inlining
(which uses un-simplified arguments), but that seems fine.
simonpj@microsoft.com [Tue, 17 Nov 2009 10:36:26 +0000 (10:36 +0000)]
Improvements to pretty-printing of Core
Duncan Coutts [Sun, 15 Nov 2009 15:56:17 +0000 (15:56 +0000)]
Fix formatting of module deprecation/warning messages
It was accidentally using list syntax. Fixes #3303 again.
simonpj@microsoft.com [Fri, 13 Nov 2009 14:59:44 +0000 (14:59 +0000)]
Wibble to comment
simonpj@microsoft.com [Fri, 13 Nov 2009 14:57:11 +0000 (14:57 +0000)]
Use eta-expansion to ensure that INLINE things have their expected arity
See Note [Eta-expanding INLINE things] in DsBinds
This is to fix a performance bug that Roman was encountering.
Simon Marlow [Thu, 12 Nov 2009 13:53:39 +0000 (13:53 +0000)]
Switch EventThreadID back to 32 bits.
The log file format was still using 32 bits, this just updates the
header file to match; there should be no functional changes.
Simon Marlow [Fri, 13 Nov 2009 10:45:18 +0000 (10:45 +0000)]
The rest of the #1185 patch (forkProcess and -threaded)
Due to darcs confusion, I managed to leave out part of the patch for
#1185. This should make 1185(threaded1) go through now.
simonpj@microsoft.com [Fri, 13 Nov 2009 11:12:11 +0000 (11:12 +0000)]
Make the new ClassOp/DFun selection mechanism work for single-method classes
I'd forgotten the case of single-method classes! I've also improved
the documentation. See
Note [ClassOp/DFun selection]
Note [Single-method classes]
both in TcInstDcls
simonpj@microsoft.com [Thu, 12 Nov 2009 15:33:32 +0000 (15:33 +0000)]
Comments only
simonpj@microsoft.com [Thu, 12 Nov 2009 14:21:50 +0000 (14:21 +0000)]
Remove old, redundant note
Simon Marlow [Thu, 12 Nov 2009 13:51:20 +0000 (13:51 +0000)]
Fix bug when the combined package DB has duplicate package IDs
Someone on IRC reported that they were encountering a strange missing
module error from GHC, and it turned out that they had mtl-1.1.0.2
installed in both the global and local DB, with the same
InstalledPackageId. The two packages should be interchangeable, but
we were forgetting to eliminate duplicates in part of the
package-processing phase in GHC.
Really I should switch this code over to use the new PackageIndex data
type in Cabal, which ought to make things simpler.
Simon Marlow [Thu, 12 Nov 2009 09:45:14 +0000 (09:45 +0000)]
HC bootstrapping fix: add -I$(GHC_INCLUDE_DIR) to SRC_CC_OPTS
And add a comment explaining why these options are here
Simon Marlow [Thu, 12 Nov 2009 12:58:53 +0000 (12:58 +0000)]
Windows-specific fix for #1185 patch
Simon Marlow [Wed, 11 Nov 2009 14:28:22 +0000 (14:28 +0000)]
Second attempt to fix #1185 (forkProcess and -threaded)
Patch 1/2: second part of the patch is to libraries/base
This time without dynamic linker hacks, instead I've expanded the
existing rts/Globals.c to cache more CAFs, specifically those in
GHC.Conc. We were already using this trick for signal handlers, I
should have realised before.
It's still quite unsavoury, but we can do away with rts/Globals.c in
the future when we switch to a dynamically-linked GHCi.
simonpj@microsoft.com [Thu, 12 Nov 2009 09:29:06 +0000 (09:29 +0000)]
A radical overhaul of the coercion infrastucture
* Core Lint now does full checking of kinds and coercion terms
which picks up kind errors in coercions that were previously
simply not checked for
* Coercion.lhs now provides optCoercion which optimises coercion
terms. It implements all of Dimitrios's rules
* The constructors for coercion terms now make no attempt to be
"smart"; instead we rely solely on the coercion optimiser
* CoercionTyCons in TyCon.lhs always had a "custom" kinding rule
(the coKindFun field of CoercionTyCon) but its type was not
clever enough to do both
(a) *figure out the result kind*, assuming the whole thing
is well-kinded in the first place
(b) *check* the kinds of everything, failing gracefully if
they aren't right.
We need (b) for the new CoreLint stuff. The field now has type
CoTyConKindChecker
which does the job nicely.
simonpj@microsoft.com [Thu, 12 Nov 2009 09:23:23 +0000 (09:23 +0000)]
Improve warning message
simonpj@microsoft.com [Thu, 12 Nov 2009 09:22:54 +0000 (09:22 +0000)]
Add an ID monad to MonadUtils (used in kind checking)
dias@cs.tufts.edu [Thu, 5 Nov 2009 15:15:32 +0000 (15:15 +0000)]
Loop problems in native back ends, update to T3286 fix
The native back ends had difficulties with loops;
in particular the code for branch-chain elimination
could run in infinite loops or drop basic blocks.
The old codeGen didn't expose these problems.
Also, my fix for T3286 in the new codegen was getting
applied to too many (some wrong) cases; a better pattern
match fixed that.
dias@cs.tufts.edu [Fri, 18 Sep 2009 19:29:32 +0000 (19:29 +0000)]
Morguing dead code
dias@cs.tufts.edu [Fri, 18 Sep 2009 19:16:26 +0000 (19:16 +0000)]
More sensible use of -fnew-codegen and less debugging output
dias@cs.tufts.edu [Fri, 18 Sep 2009 19:14:17 +0000 (19:14 +0000)]
Minor refactoring and formatting
Wrote a generic function to extend dataflow results for safe foreign calls.
Should be able to throw it away when we change the representation of safe foreign calls.
dias@cs.tufts.edu [Fri, 18 Sep 2009 19:07:53 +0000 (19:07 +0000)]
Keep Touch'd variables live through the back end
When we used derived pointers into the middle of an object,
we need to keep the pointer to the start of the object live.
We use a "fat machine instruction" with the primitive MO_Touch
to propagate this information through the back end.
dias@cs.tufts.edu [Fri, 18 Sep 2009 18:34:15 +0000 (18:34 +0000)]
Fixed calling convention for unboxed tuples
Apparently, the arguments should be sorted by pointerhood.
While we're at it, I rewrote the code that assigns registers
and stack space to function call and return parameters.
dias@cs.tufts.edu [Fri, 18 Sep 2009 18:31:22 +0000 (18:31 +0000)]
Fix for T3286 in new codegen (related to T3132); plus formatting
If the scrutinee is bottom, the generated Cmm code could have a
type error when the case arm expected an unboxed floating-point
value (even though the arm should never be reached).
Now, we detect this case and avoid producing the type-incorrect
assignment.
Ian Lynagh [Wed, 11 Nov 2009 19:28:21 +0000 (19:28 +0000)]
Add gen_contents_index and prologue.txt to bindists
Ian Lynagh [Tue, 10 Nov 2009 22:36:32 +0000 (22:36 +0000)]
Use relative paths for haddockHTMLs in the inplace package.conf
This means that the docs get built with the correct relative paths.
When installing, the absolute path will still be used.
Ian Lynagh [Sun, 8 Nov 2009 21:07:01 +0000 (21:07 +0000)]
Put docs into versioned directory names; fixes trac #3532
You can now have multiple versions of a package installed, and
gen_contents_index will do the right thing.
Simon Marlow [Wed, 11 Nov 2009 11:32:01 +0000 (11:32 +0000)]
Make "./darcs-all optimize --relink" do the right thing
Simon Marlow [Wed, 11 Nov 2009 11:18:21 +0000 (11:18 +0000)]
Support for DragonFly BSD
Patches from Goetz Isenmann <info@goetz-isenmann.de>, slightly updated
for HEAD (the method for configuring platforms in configure.ac has
changed).
Simon Marlow [Wed, 11 Nov 2009 11:12:25 +0000 (11:12 +0000)]
The RTS needs hs-suffix-rules-srcdir for BootingFromHc
Patch submitted by Matthias Kilian <kili@outback.escape.de>,
re-recorded against HEAD by me, with a comment added.
Simon Marlow [Mon, 9 Nov 2009 13:51:59 +0000 (13:51 +0000)]
Don't try to rebuild compiler/primop-*.hs-incl when BootingFromHc
Patch submitted by Matthias Kilian <kili@outback.escape.de>
simonpj@microsoft.com [Wed, 11 Nov 2009 08:09:57 +0000 (08:09 +0000)]
No CoreLint warnings if -dno-debug-output is on
The Core Lint warnings are new. There's only one at the moment,
namely one to identify recursive INLINE things:
[RHS of $c>>_als :: forall s_afT a_alJ b_alK.
Cpr001_imp.StateTrans s_afT a_alJ
-> Cpr001_imp.StateTrans s_afT b_alK
-> Cpr001_imp.StateTrans s_afT b_alK]
INLINE binder is loop breaker: $c>>_als
This is definitely non-fatal, and typically gets unravelled after
another simplifier run anyway. So I'm suppressing such warnings
for the testsuite, when -dno-debug-output is on.
simonpj@microsoft.com [Tue, 10 Nov 2009 17:23:37 +0000 (17:23 +0000)]
Wibbles to the inline-in-InlineRule stuff
The main change is using SimplUtils.updModeForInlineRules
doesn't overwrite the current setting, it just augments it.
simonpj@microsoft.com [Tue, 10 Nov 2009 17:20:17 +0000 (17:20 +0000)]
Don't inline a loop breaker, even if it has an INLINE pragma
We preserve the InlineRule on loop breakers, in the hope that they'll
stop being a loop breaker later. So don't inline them!
simonpj@microsoft.com [Tue, 10 Nov 2009 17:18:46 +0000 (17:18 +0000)]
Comments only
simonpj@microsoft.com [Tue, 10 Nov 2009 17:17:45 +0000 (17:17 +0000)]
Implement the PushC rule when optimising casts
simonpj@microsoft.com [Tue, 10 Nov 2009 17:16:50 +0000 (17:16 +0000)]
Preserve strictness when floating coercions
See Note [Preserve strictness when floating coercions]
simonpj@microsoft.com [Tue, 10 Nov 2009 17:10:40 +0000 (17:10 +0000)]
Make -dverbose-core2core set verbosity = 2
This ensures that messages coming out with -dshow-passes
also come out with -dverbose-core2core
simonpj@microsoft.com [Tue, 10 Nov 2009 17:09:23 +0000 (17:09 +0000)]
Comments only
tom.schrijvers@cs.kuleuven.be [Sun, 8 Nov 2009 18:51:52 +0000 (18:51 +0000)]
more aggressive optimization of coercion terms
simonpj@microsoft.com [Fri, 6 Nov 2009 17:40:32 +0000 (17:40 +0000)]
Improve debug-printing of the type environment
simonpj@microsoft.com [Fri, 6 Nov 2009 17:38:01 +0000 (17:38 +0000)]
Tidy up coercions, and implement csel1, csel2, cselR
In preparation for implementing the PushC rule for coercion-swizzling
in the Simplifier, I had to inmplement the three new decomposition
operators for coercions, which I've called csel1, csel2, and cselR.
co :: ((s1~t1) => r1) ~ ((s2~t2) => r2)
---------------------------------------
csel1 co :: s1~s2
and similarly csel2, cselR.
On the way I fixed the coercionKind function for types of form
(s1~t2) => r2
which currently are expressed as a forall type.
And I refactored quite a bit to help myself understand what is
going on.
simonpj@microsoft.com [Fri, 6 Nov 2009 14:58:30 +0000 (14:58 +0000)]
Comments in OccurAnal
Manuel M T Chakravarty [Wed, 11 Nov 2009 02:07:12 +0000 (02:07 +0000)]
Barf on unhandled Mach-O relocations in the ghci linker
- It might be worthwhile to MERGE this to 6.12, BUT somebody should validate
it on PPC/Mac OS X first.
Roman Leshchinskiy [Mon, 9 Nov 2009 13:17:46 +0000 (13:17 +0000)]
Track changes to DPH library
simonpj@microsoft.com [Mon, 9 Nov 2009 10:39:32 +0000 (10:39 +0000)]
Remove dead code
simonpj@microsoft.com [Mon, 9 Nov 2009 10:39:20 +0000 (10:39 +0000)]
Allow inlining in "SimplGentle" mode
This change helps to break the mutual recursion generated by
an instance declaration.
See Note [Gentle mode] in SimplUtils
simonpj@microsoft.com [Mon, 9 Nov 2009 10:37:26 +0000 (10:37 +0000)]
Augment panic message
simonpj@microsoft.com [Mon, 9 Nov 2009 10:37:03 +0000 (10:37 +0000)]
Wibble to substituting InlWrappers
See Note [Worker inlining] in CoreSubst
Ben.Lippmeier@anu.edu.au [Fri, 6 Nov 2009 09:08:50 +0000 (09:08 +0000)]
validate fixes
Ben.Lippmeier@anu.edu.au [Fri, 6 Nov 2009 05:08:24 +0000 (05:08 +0000)]
Add missing CgExtCode to ghc.cabal.in
Ben.Lippmeier@anu.edu.au [Fri, 6 Nov 2009 03:05:30 +0000 (03:05 +0000)]
* Refactor CLabel.RtsLabel to CLabel.CmmLabel
The type of the CmmLabel ctor is now
CmmLabel :: PackageId -> FastString -> CmmLabelInfo -> CLabel
- When you construct a CmmLabel you have to explicitly say what
package it is in. Many of these will just use rtsPackageId, but
I've left it this way to remind people not to pretend labels are
in the RTS package when they're not.
- When parsing a Cmm file, labels that are not defined in the
current file are assumed to be in the RTS package.
Labels imported like
import label
are assumed to be in a generic "foreign" package, which is different
from the current one.
Labels imported like
import "package-name" label
are marked as coming from the named package.
This last one is needed for the integer-gmp library as we want to
refer to labels that are not in the same compilation unit, but
are in the same non-rts package.
This should help remove the nasty #ifdef __PIC__ stuff from
integer-gmp/cbits/gmp-wrappers.cmm
Ben.Lippmeier@anu.edu.au [Thu, 22 Oct 2009 01:01:05 +0000 (01:01 +0000)]
Add missing case to externallyVisibleCLabel
Ben.Lippmeier@anu.edu.au [Sun, 18 Oct 2009 10:53:16 +0000 (10:53 +0000)]
Add CLabel.CmmLabel and start refactoring
Ben.Lippmeier@anu.edu.au [Sun, 18 Oct 2009 09:25:04 +0000 (09:25 +0000)]
Haddockify and clean up commenting
Ben.Lippmeier@anu.edu.au [Sun, 18 Oct 2009 08:38:53 +0000 (08:38 +0000)]
Merge RtsLabelInfo.Rts* with RtsLabelInfo.Rts*FS
Ian Lynagh [Sun, 8 Nov 2009 12:02:04 +0000 (12:02 +0000)]
Tell ghc-cabal what strip program to use
Ian Lynagh [Sun, 8 Nov 2009 01:15:46 +0000 (01:15 +0000)]
Remove ext-core
It is now a separately maintained package, available from hackage:
http://hackage.haskell.org/package/extcore
Ian Lynagh [Sat, 7 Nov 2009 22:43:28 +0000 (22:43 +0000)]
Change a use of xargs to "$(XARGS)" $(XARGS_OPTS)
Ian Lynagh [Sat, 7 Nov 2009 22:37:15 +0000 (22:37 +0000)]
Split XARGS into XARGS and XARGS_OPTS
Ian Lynagh [Sat, 7 Nov 2009 21:18:17 +0000 (21:18 +0000)]
Remove unused distrib/Makefile-bin-vars.in file