10 years agoUse "on the spot" solving for fundeps [Thu, 17 Feb 2011 14:09:21 +0000 (14:09 +0000)]
Use "on the spot" solving for fundeps

When we spot an equality arising from a functional dependency,
we now use that equality (a "wanted") to rewrite the work-item
constraint right away.  This avoids two dangers

 Danger 1: If we send the original constraint on down the pipeline
           it may react with an instance declaration, and in delicate
   situations (when a Given overlaps with an instance) that
   may produce new insoluble goals: see Trac #4952

 Danger 2: If we don't rewrite the constraint, it may re-react
           with the same thing later, and produce the same equality
           again --> termination worries.

To achieve this required some refactoring of FunDeps.lhs (nicer

This patch also contains a couple of unrelated improvements

* A bad bug in TcSMonad.nestImplicTcS whereby the Tcs tyvars
  of an outer implication were not untouchable inside

* Improved logging machinery for the type constraint solver;
  use -ddump-cs-trace (probably with a wider default line width
  -dppr-cols=200 or something)

10 years agoIncrease exprIsDupable threshold a bit [Tue, 15 Feb 2011 14:39:21 +0000 (14:39 +0000)]
Increase exprIsDupable threshold a bit

Now that exprIsDupable is less aggressive, test MethSharing wasn't
doing enough inlining.  Increasing the threshold fixes the problem
but the real fix is in Trac #4960.

10 years agoEnsure exprIsCheap/exprIsExpandable deal with Cast properly [Tue, 15 Feb 2011 14:36:55 +0000 (14:36 +0000)]
Ensure exprIsCheap/exprIsExpandable deal with Cast properly

This bug was causing a Lint error on the stable branch. For some
reason it doesn't show up in HEAD, but it's still worth fixing.

The point is that ((f `cast` co) a) is cheap if f has arity>1.
This was being gratuitously missed before.

10 years agoDo not treat absentError specially [Tue, 15 Feb 2011 14:35:04 +0000 (14:35 +0000)]
Do not treat absentError specially

(This was part of an experiment I abandoned.)

10 years agoFix exprIsDupable [Mon, 14 Feb 2011 11:15:12 +0000 (11:15 +0000)]
Fix exprIsDupable

It turns out that exprIsDupable would return True for an expression of
*arbitrary* size, provide it was a nested bunch of applications in
which no function had more than three arguments.  That was never the
intention, and could give rise to massive code duplication.

This patch makes it much less aggressive.

10 years agoBetter case-of-case transformation [Mon, 14 Feb 2011 11:11:51 +0000 (11:11 +0000)]
Better case-of-case transformation

The ThunkSplitting idea in WorkWrap wasn't working at all,
leading to Trac #4957.  The culprit is really the simplifier
which was combining the wrong case continuations. See
Note [Fusing case continuations] in Simplify.

10 years agoCleaned up Expr and Vectorise [Tue, 15 Feb 2011 01:44:34 +0000 (01:44 +0000)]
Cleaned up Expr and Vectorise

10 years agoFixed two syntax errors [Mon, 14 Feb 2011 02:05:31 +0000 (02:05 +0000)]
Fixed two syntax errors

10 years agoHandling of recursive scalar functions in isScalarLam [Mon, 14 Feb 2011 00:29:45 +0000 (00:29 +0000)]
Handling of recursive scalar functions in isScalarLam

10 years agoAdded handling of non-recursive module global functions to isScalar check [Wed, 9 Feb 2011 04:28:55 +0000 (04:28 +0000)]
Added handling of non-recursive module global functions to isScalar check

10 years ago(no commit message) [Wed, 2 Feb 2011 05:14:08 +0000 (05:14 +0000)]

10 years agoRemoved minor bug [Wed, 2 Feb 2011 04:08:26 +0000 (04:08 +0000)]
Removed minor bug

10 years agoadded handling of data constructors to vectLam [Tue, 1 Feb 2011 04:28:07 +0000 (04:28 +0000)]
added handling of data constructors to vectLam

10 years agopruneSparkQueue: check for tagged pointers
Simon Marlow [Mon, 14 Feb 2011 12:38:58 +0000 (12:38 +0000)]
pruneSparkQueue: check for tagged pointers
This was a bug in 6.12.3.  I think the problem no longer occurs due to
the way sparks are treated as weak pointers, but it doesn't hurt to
test for tagged pointers anyway: better to do the test than have a
subtle invariant.

10 years agoFix Trac #4953: local let binders can have IdInfo with free names [Mon, 14 Feb 2011 14:03:34 +0000 (14:03 +0000)]
Fix Trac #4953: local let binders can have IdInfo with free names

Local let binders in IfaceExpr never used to have unfoldings,
but lately they can (becuase they can have an INLINE pragma).
We must take account of the variables mentioned in the pragma
when computing the fingerprint.

10 years agoComments only [Mon, 14 Feb 2011 09:07:03 +0000 (09:07 +0000)]
Comments only

10 years agoLLVM: Huge improvement to mangler speed.
David Terei [Sun, 13 Feb 2011 01:44:06 +0000 (01:44 +0000)]
LLVM: Huge improvement to mangler speed.

The old llvm mangler was horrible! Very slow
due to bad design and code. New version is
linear complexity as it should be and far
lower coefficients. This fixes trac 4838.

10 years agoFix platform detection in bindists
Ian Lynagh [Fri, 11 Feb 2011 18:42:44 +0000 (18:42 +0000)]
Fix platform detection in bindists
In a bindist, we generate files like the hsc2hs wrapper.
This means we need to have the right values for the variables like
CONF_GCC_LINKER_OPTS_STAGE1 which in turn means we need to know what
platform we're on.

10 years agoNew plan: push unsolved wanteds inwards [Fri, 11 Feb 2011 17:40:58 +0000 (17:40 +0000)]
New plan: push unsolved wanteds inwards

This fixes Trac #4935.  See Note [Preparing inert set for implications].
Lots of comments, but not a lot of code is changed!

10 years agoRemove unnecessary import, plus white space [Fri, 11 Feb 2011 17:39:25 +0000 (17:39 +0000)]
Remove unnecessary import, plus white space

10 years agoFix small but egregious error: using un-zonked constraints in simplifyRule [Fri, 11 Feb 2011 17:38:35 +0000 (17:38 +0000)]
Fix small but egregious error: using un-zonked constraints in simplifyRule

This resulted in double unifications.  Fix is trivial.

10 years agomakeSolvedByInst is only called on wanteds [Fri, 11 Feb 2011 17:34:15 +0000 (17:34 +0000)]
makeSolvedByInst is only called on wanteds

This patch just adds an assert error.

10 years agoEnable DTrace on Solaris; based on a patch from Karel Gardas
Ian Lynagh [Thu, 10 Feb 2011 15:52:17 +0000 (15:52 +0000)]
Enable DTrace on Solaris; based on a patch from Karel Gardas

10 years agoUse DTrace whenever it's available
Ian Lynagh [Thu, 10 Feb 2011 15:33:00 +0000 (15:33 +0000)]
Use DTrace whenever it's available
Now that we've stopped trying to support 64bit OS X 10.5, the DTrace
problems there don't matter.

11 years agoreplace C++ comments with C comments (Solaris' DTrace fails on C++ comments)
Karel Gardas [Wed, 12 Jan 2011 05:18:29 +0000 (05:18 +0000)]
replace C++ comments with C comments (Solaris' DTrace fails on C++ comments)

10 years agoFix #4867, ghci displays negative floats incorrectly [Wed, 9 Feb 2011 22:24:23 +0000 (22:24 +0000)]
Fix #4867, ghci displays negative floats incorrectly

This patch fixes the erroneous relocations that caused
the bug in ticket #4867.  External addresses and global
offset table entries were relocated correctly, but all other
relocations were incorrectly calculated.  This caused, for
example, bad references to constants stored in the __const
section of the __TEXT segment.

This bug only affected OS X on 64-bit platforms.

10 years agoFix Array sizeof primops to use the correct offset (which happens to be 0, so it...
Daniel Peebles [Tue, 1 Feb 2011 06:30:17 +0000 (06:30 +0000)]
Fix Array sizeof primops to use the correct offset (which happens to be 0, so it worked before anyway). Makes us more future-proof, at least

11 years agoAdd sizeof(Mutable)Array# primitives
Daniel Peebles [Wed, 26 Jan 2011 05:15:54 +0000 (05:15 +0000)]
Add sizeof(Mutable)Array# primitives

10 years agofix TRY_ACQUIRE_LOCK on Windows.
Simon Marlow [Thu, 10 Feb 2011 15:00:35 +0000 (15:00 +0000)]
fix TRY_ACQUIRE_LOCK on Windows.

10 years agoconstant fold (a + N) - M and (a - N) + M
Simon Marlow [Thu, 10 Feb 2011 11:56:08 +0000 (11:56 +0000)]
constant fold  (a + N) - M  and  (a - N) + M

10 years agoRecursively call cmmMachOpFold on divides that we turned into shifts
Simon Marlow [Tue, 8 Feb 2011 10:43:45 +0000 (10:43 +0000)]
Recursively call cmmMachOpFold on divides that we turned into shifts
There might be more simplification to do.

10 years agoAdd unboxed tuple support to Template Haskell
Ian Lynagh [Thu, 10 Feb 2011 13:45:28 +0000 (13:45 +0000)]
Add unboxed tuple support to Template Haskell

10 years agoAllow TH brackets to contain things of any kind
Ian Lynagh [Wed, 9 Feb 2011 18:44:59 +0000 (18:44 +0000)]
Allow TH brackets to contain things of any kind
You can now quasi-quote things with unboxed types, and unboxed tuples.

10 years agoSimpify constraints from a TH bracket eagerly [Wed, 9 Feb 2011 17:50:03 +0000 (17:50 +0000)]
Simpify constraints from a TH bracket eagerly

See Trac #4949, where having a TH bracket implication
was messing things up.  Better to get rid of it right away.

10 years agoTypo in comment [Wed, 9 Feb 2011 17:49:14 +0000 (17:49 +0000)]
Typo in comment

10 years agoCall the final build system phase "final" rather than ""
Ian Lynagh [Mon, 7 Feb 2011 14:20:46 +0000 (14:20 +0000)]
Call the final build system phase "final" rather than ""

10 years agoFix bug introduced in "Implement fuzzy matching for the Finder"
Simon Marlow [Tue, 8 Feb 2011 09:01:21 +0000 (09:01 +0000)]
Fix bug introduced in "Implement fuzzy matching for the Finder"
The finder was reporting a hidden package when it meant a hidden
module, and vice versa (looks like a typo).

10 years agoFix Trac #4945: another SpecConstr infelicity [Mon, 7 Feb 2011 10:25:37 +0000 (10:25 +0000)]
Fix Trac #4945: another SpecConstr infelicity

Well, more a plain bug really, which led to SpecConstr
missing some obvious opportunities for specialisation.

Thanks to Max Bolingbroke for spotting this.

10 years agoadd missing initialisation of ws->todo_large_objects
Simon Marlow [Fri, 4 Feb 2011 09:31:48 +0000 (09:31 +0000)]
add missing initialisation of ws->todo_large_objects
Found-by: Valgrind.  Thanks Julian!

10 years agoAdd -XNondecreasingIndentation to -XHaskell98 for backwards compatibility.
Simon Marlow [Fri, 4 Feb 2011 08:42:26 +0000 (08:42 +0000)]
Add -XNondecreasingIndentation to -XHaskell98 for backwards compatibility.
The final straw was when I learned today that Happy broke.

10 years agoonly the GHC repo is in git for now; add hoopl
Simon Marlow [Thu, 3 Feb 2011 20:57:05 +0000 (20:57 +0000)]
only the GHC repo is in git for now; add hoopl

10 years agoFix typo in SpecConstr that made it not work at all [Thu, 3 Feb 2011 17:27:56 +0000 (17:27 +0000)]
Fix typo in SpecConstr that made it not work at all

There was a terrible typo in this patch; I wrote "env"
instead of "env1".

   Mon Jan 31 11:35:29 GMT 2011
     * Improve Simplifier and SpecConstr behaviour

Anyway, this fix is essential to make it work properly.
Thanks to Max for spotting the problem (again).

10 years agofix compacting GC
Simon Marlow [Wed, 2 Feb 2011 17:00:36 +0000 (17:00 +0000)]
fix compacting GC

10 years agofix warning
Simon Marlow [Wed, 2 Feb 2011 16:04:15 +0000 (16:04 +0000)]
fix warning

10 years agoGC refactoring and cleanup
Simon Marlow [Wed, 2 Feb 2011 15:49:55 +0000 (15:49 +0000)]
GC refactoring and cleanup
Now we keep any partially-full blocks in the gc_thread[] structs after
each GC, rather than moving them to the generation.  This should give
us slightly better locality (though I wasn't able to measure any

Also in this patch: better sanity checking with THREADED.

10 years agoavoid adding HPC ticks to arrow constructs (fixes #1333)
Ross Paterson [Wed, 2 Feb 2011 21:14:25 +0000 (21:14 +0000)]
avoid adding HPC ticks to arrow constructs (fixes #1333)

10 years agoFix the profiling build
Simon Marlow [Wed, 2 Feb 2011 13:22:57 +0000 (13:22 +0000)]
Fix the profiling build

10 years agoA small GC optimisation
Simon Marlow [Wed, 2 Feb 2011 12:30:49 +0000 (12:30 +0000)]
A small GC optimisation
Store the *number* of the destination generation in the Bdescr struct,
so that in evacuate() we don't have to deref gen to get it.
This is another improvement ported over from my GC branch.

10 years agoscheduleProcessInbox: use non-blocking acquire, and take the whole queue
Simon Marlow [Wed, 2 Feb 2011 11:49:07 +0000 (11:49 +0000)]
scheduleProcessInbox: use non-blocking acquire, and take the whole queue
This is an improvement from my GC branch, that helps performance for
intensive message-passing communication between Capabilities.

10 years agodo a bit of by-hand CSE
Simon Marlow [Wed, 2 Feb 2011 11:44:17 +0000 (11:44 +0000)]
do a bit of by-hand CSE

10 years agoadd a const
Simon Marlow [Wed, 2 Feb 2011 11:43:45 +0000 (11:43 +0000)]
add a const

10 years agoadd TRY_ACQUIRE_LOCK()
Simon Marlow [Wed, 2 Feb 2011 11:32:42 +0000 (11:32 +0000)]

10 years agoRemove the per-generation mutable lists
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.

10 years ago+RTS -qw hasn't done anything since 7.0.1; remove the implementation & docs
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.

10 years agocomments
Simon Marlow [Tue, 1 Feb 2011 08:58:30 +0000 (08:58 +0000)]

11 years agoAnnotate thread stop events with the owner of the black hole
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.

11 years agoupdate debugging code for fragmentation
Simon Marlow [Tue, 25 Jan 2011 11:10:11 +0000 (11:10 +0000)]
update debugging code for fragmentation

10 years agoFix type checker error message [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.

10 years agoSome refactoring of SpecConstr [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.

10 years agoDon't make join points when the case has only one non-bottom alternative [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

10 years agoImprove Simplifier and SpecConstr behaviour [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.

10 years agofix warning
Simon Marlow [Mon, 31 Jan 2011 13:59:51 +0000 (13:59 +0000)]
fix warning

11 years ago32-bit fix
Simon Marlow [Wed, 13 Oct 2010 15:42:00 +0000 (15:42 +0000)]
32-bit fix

11 years agoupdate to mingw gcc 4.5.2
Simon Marlow [Wed, 19 Jan 2011 13:50:53 +0000 (13:50 +0000)]
update to mingw gcc 4.5.2

11 years agocount fizzled and GC'd sparks separately
Simon Marlow [Thu, 11 Nov 2010 13:27:27 +0000 (13:27 +0000)]
count fizzled and GC'd sparks separately

11 years agocount "dud" sparks (expressions that were already evaluated when sparked)
Simon Marlow [Mon, 1 Nov 2010 12:41:43 +0000 (12:41 +0000)]
count "dud" sparks (expressions that were already evaluated when sparked)

11 years agofix some shutdown memory leaks
Simon Marlow [Fri, 20 Aug 2010 09:31:33 +0000 (09:31 +0000)]
fix some shutdown memory leaks

10 years agofix DEBUG build
Simon Marlow [Mon, 31 Jan 2011 12:34:33 +0000 (12:34 +0000)]
fix DEBUG build

10 years agoFix formatting glitch in documentation [Fri, 28 Jan 2011 11:54:00 +0000 (11:54 +0000)]
Fix formatting glitch in documentation

10 years agoFix warnings
Simon Marlow [Fri, 28 Jan 2011 10:36:39 +0000 (10:36 +0000)]
Fix warnings

11 years agoMerge in new code generator branch.
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

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 <>
   - John Dias <>
   - David Terei <>

Edward Z. Yang <> merged in further changes from GHC HEAD
and fixed a few bugs.

10 years agoFix an egregious strictness analyser bug (Trac #4924) [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.

11 years agoRefine incomplete-pattern checks (Trac #4905) [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

11 years agoFix "make 1" etc following the build system changes
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/ rather than being duplicated in
ghc/Makefile and compiler/Makefile.

11 years agoFix vectorisation of recursive types
Roman Leshchinskiy [Wed, 26 Jan 2011 23:18:43 +0000 (23:18 +0000)]
Fix vectorisation of recursive types

11 years agoFix dependencies among specialisations for imported Ids [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.

11 years agoFix bug in roughTopNames [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).

11 years agoComments only, plus a tiny bit of debug printing [Wed, 26 Jan 2011 17:12:55 +0000 (17:12 +0000)]
Comments only, plus a tiny bit of debug printing

11 years agoComments only [Wed, 26 Jan 2011 17:12:35 +0000 (17:12 +0000)]
Comments only

11 years agoLook through type synonyms when computing orphans [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.

11 years agoBleat a bit more informatively in unionLists [Wed, 26 Jan 2011 17:10:30 +0000 (17:10 +0000)]
Bleat a bit more informatively in unionLists

11 years agoKeep separate linker flags, for when we want to link with gcc or ld
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

11 years agoFix validate on OS X 64
Ian Lynagh [Mon, 24 Jan 2011 18:36:18 +0000 (18:36 +0000)]
Fix validate on OS X 64

11 years agoSplit main/GHC into GHC and GhcMake [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.

11 years agoComments only [Tue, 25 Jan 2011 13:11:15 +0000 (13:11 +0000)]
Comments only

11 years agoFix Trac #3717 by making exprOkForSpeculation a bit cleverer [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.

11 years agoImprove dataToTag# magic [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

11 years agoFix Trac #4917: try a bit harder to unify on-the-fly [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.

11 years agoDPH options updated
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.)

11 years agoAdd build system profiling to build system
Ian Lynagh [Sun, 23 Jan 2011 15:14:08 +0000 (15:14 +0000)]
Add build system profiling to build system

11 years agoFix ghci in stage3
Ian Lynagh [Sun, 23 Jan 2011 12:02:32 +0000 (12:02 +0000)]
Fix ghci in stage3

11 years agoRemove use of non-existent $$(dir) variable in the rts
Ian Lynagh [Sun, 23 Jan 2011 02:18:15 +0000 (02:18 +0000)]
Remove use of non-existent $$(dir) variable in the rts

11 years agoAdd some missing dependencies
Ian Lynagh [Sun, 23 Jan 2011 00:42:08 +0000 (00:42 +0000)]
Add some missing dependencies

11 years agoTweak some deps to avoid multiple $(wildcard ...)s
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.

11 years agoUse := when assigning the result of $(wildcard ...)
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

11 years agoSimplify the build system, and remove 2 phases
Ian Lynagh [Sat, 22 Jan 2011 19:09:28 +0000 (19:09 +0000)]
Simplify the build system, and remove 2 phases

Phase 0:
    Includes: 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
    Builds: 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.

11 years agoManually control more of the Cabal flags for the compiler and ghc packages
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.

11 years agoRemove some hardcoded makefile settings
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.

11 years agotweak newArray# documentation again
Simon Marlow [Wed, 19 Jan 2011 14:06:33 +0000 (14:06 +0000)]
tweak newArray# documentation again

11 years agoFix OSTYPE test
Ian Lynagh [Thu, 20 Jan 2011 00:03:08 +0000 (00:03 +0000)]
Fix OSTYPE test