10 years agotake newCAF() out from sm_mutex; use the capability-local mut list instead
Simon Marlow [Thu, 31 Dec 2009 16:02:23 +0000 (16:02 +0000)] 
take newCAF() out from sm_mutex; use the capability-local mut list instead

10 years agoUse local mut lists in UPD_IND(), also clean up Updates.h
Simon Marlow [Thu, 31 Dec 2009 11:34:35 +0000 (11:34 +0000)] 
Use local mut lists in UPD_IND(), also clean up Updates.h

10 years agouse local mut lists rather than global mut lists in sequential GC
Simon Marlow [Thu, 31 Dec 2009 11:31:18 +0000 (11:31 +0000)] 
use local mut lists rather than global mut lists in sequential GC

10 years agoAllow throwTo() to be called without a source thread
Simon Marlow [Fri, 18 Dec 2009 16:32:00 +0000 (16:32 +0000)] 
Allow throwTo() to be called without a source thread
Returns false if the exception could not be thrown becuase the tartget
thread was running.  Not used yet, but might come in handy later.

10 years agoIf ACTIVITY_INACTIVE is set, wait for GC before resetting it
Simon Marlow [Sun, 13 Dec 2009 20:12:46 +0000 (20:12 +0000)] 
If ACTIVITY_INACTIVE is set, wait for GC before resetting it
I don't think this fixes any real bugs, but there's a small
possibility that when the RTS is woken up for an idle-time GC, the IO
manager thread might be pre-empted which would prevent the idle GC
from happening; this change ensures that the idle GC happens anyway.

10 years agoFix rules/ on OS X
Ian Lynagh [Wed, 30 Dec 2009 18:52:39 +0000 (18:52 +0000)] 
Fix rules/ on OS X
Also more comments on why we have the sed rules that we do.

10 years agoCopying Simon M's fix for 650 to the new codegen [Tue, 22 Dec 2009 22:20:17 +0000 (22:20 +0000)] 
Copying Simon M's fix for 650 to the new codegen

10 years agoBetter error checking and code cleanup [Tue, 22 Dec 2009 22:19:46 +0000 (22:19 +0000)] 
Better error checking and code cleanup

10 years agoAdd comments to darcs-all [Mon, 21 Dec 2009 16:05:11 +0000 (16:05 +0000)] 
Add comments to darcs-all

The comments explain how darcs-all decides what repo to use

10 years agoFix Trac #3772: dict funs for single-field classes [Mon, 21 Dec 2009 16:04:31 +0000 (16:04 +0000)] 
Fix Trac #3772: dict funs for single-field classes

This patch fixes a bug that meant that INLINE pragamas on
a method of a single-field class didn't work properly.

See Note [Single-method classes] in TcInstDcls, and Trac #3772

10 years agoComments only (about implementing SPECIALISE pragmas) [Mon, 21 Dec 2009 15:57:45 +0000 (15:57 +0000)] 
Comments only (about implementing SPECIALISE pragmas)

10 years agoA bit of refactoring, plus a sanity check [Mon, 21 Dec 2009 15:56:32 +0000 (15:56 +0000)] 
A bit of refactoring, plus a sanity check

Check that a bottoming rhs does indeed get exposed with bottoming strictness
Almost all the changed lines reflect some refactoring of tidyTopIdInfo.

10 years agoFix Trac #3776 [Mon, 21 Dec 2009 15:55:09 +0000 (15:55 +0000)] 
Fix Trac #3776

An easy fix.  See Note [Usage for sub-bndrs] in RnEnv.

10 years agoMove all the CoreToDo stuff into CoreMonad [Fri, 18 Dec 2009 16:45:21 +0000 (16:45 +0000)] 
Move all the CoreToDo stuff into CoreMonad

This patch moves a lot of code around, but has zero functionality change.
The idea is that the types



    the main core-to-core pipeline construction

belong in simplCore/, and *not* in DynFlags.

10 years agoAlways expose the unfolding of something with an InlineRule [Fri, 18 Dec 2009 16:43:16 +0000 (16:43 +0000)] 
Always expose the unfolding of something with an InlineRule

Previously a bottoming function with a strictness wrapper
had a hidden inlining, and that was Very Bad, because in
    f x = if ... then bot_fun x else x+1
we really want to pass the *unboxed* x to bot_fun. This
happens quite a bit in error handling code, eg for array

10 years agoComments only [Fri, 18 Dec 2009 16:41:19 +0000 (16:41 +0000)] 
Comments only

10 years agoMove loop-breaker info from original function to worker in work/wrap [Fri, 18 Dec 2009 16:41:07 +0000 (16:41 +0000)] 
Move loop-breaker info from original function to worker in work/wrap

When doing a w/w split, if the original function is a loop breaker
then the worker (not the wrapper) becomes one instead.

This isn't very important, because loop breaker information is
recalculated afresh by the occurrence analyser, but it seems more
kosher.  And Lint was bleating piteously about things with InlineRules
that were loop breakers.

10 years agoMake -ddump-inlinings and -ddump-rule-firings less noisy [Fri, 18 Dec 2009 16:37:42 +0000 (16:37 +0000)] 
Make -ddump-inlinings and -ddump-rule-firings less noisy

By default, these two now print *one line* per inlining or rule-firing.

If you want the previous (voluminous) behaviour, use -dverbose-core2core.

10 years agoMake warning printing a bit less noisy [Fri, 18 Dec 2009 16:35:49 +0000 (16:35 +0000)] 
Make warning printing a bit less noisy

Use -dppr-debug to make it noisy again

10 years agoSet fixity (left-assoc) for setIdOccInfo [Fri, 18 Dec 2009 16:35:13 +0000 (16:35 +0000)] 
Set fixity (left-assoc) for setIdOccInfo

10 years agoComments only [Fri, 18 Dec 2009 10:54:34 +0000 (10:54 +0000)] 
Comments only

10 years agoAdd an extra heading in the output for count_lines [Fri, 18 Dec 2009 10:54:03 +0000 (10:54 +0000)] 
Add an extra heading in the output for count_lines

10 years agoFixes to account for the new layout of MUT_ARR_PTRS (see #650)
Simon Marlow [Mon, 21 Dec 2009 11:52:49 +0000 (11:52 +0000)] 
Fixes to account for the new layout of MUT_ARR_PTRS (see #650)

10 years agoPartial support for Haiku (#3727)
Simon Marlow [Mon, 21 Dec 2009 11:02:50 +0000 (11:02 +0000)] 
Partial support for Haiku (#3727)

10 years agoFix #3751, also fix some lexical error SrcLocs
Simon Marlow [Thu, 17 Dec 2009 13:26:58 +0000 (13:26 +0000)] 
Fix #3751, also fix some lexical error SrcLocs

10 years agokill some old GRAN/PARALLEL_HASKELL code
Simon Marlow [Thu, 17 Dec 2009 10:38:16 +0000 (10:38 +0000)] 
kill some old GRAN/PARALLEL_HASKELL code

10 years agoimprove panic messages for srcLocLine, srcLocCol
Simon Marlow [Thu, 17 Dec 2009 10:38:01 +0000 (10:38 +0000)] 
improve panic messages for srcLocLine, srcLocCol

10 years agoTweak the build-dependencies rule, and add comments for it
Ian Lynagh [Sat, 19 Dec 2009 14:58:08 +0000 (14:58 +0000)] 
Tweak the build-dependencies rule, and add comments for it

10 years agoWhen removing $(TOP) with sed, do so case insensitively
Ian Lynagh [Sat, 19 Dec 2009 13:53:39 +0000 (13:53 +0000)] 
When removing $(TOP) with sed, do so case insensitively
This avoids problems on Windows, where drive letters may not be the
case we expect.

10 years agoFix a braino in a comment
Ian Lynagh [Fri, 18 Dec 2009 21:35:41 +0000 (21:35 +0000)] 
Fix a braino in a comment

10 years agoAvoid a failing shell command when cleaning
Ian Lynagh [Fri, 18 Dec 2009 20:11:46 +0000 (20:11 +0000)] 
Avoid a failing shell command when cleaning
It wasn't fatal, but better to avoid it anyway

10 years agoFix another sed problem on Solaris
Ian Lynagh [Thu, 17 Dec 2009 00:04:21 +0000 (00:04 +0000)] 
Fix another sed problem on Solaris

10 years agounused named variables [Fri, 18 Dec 2009 19:54:30 +0000 (19:54 +0000)] 
unused named variables

10 years agomissed a case in a previous fix [Thu, 17 Dec 2009 21:04:43 +0000 (21:04 +0000)] 
missed a case in a previous fix

Here's the obscure problem:
-- However, we also want to allow an assignment to be generated
-- in the case when the types are compatible, because this allows
-- some slightly-dodgy but occasionally-useful casts to be used,
-- such as in RtClosureInspect where we cast an HValue to a MutVar#
-- so we can print out the contents of the MutVar#.  If we generate
-- code that enters the HValue, then we'll get a runtime panic, because
-- the HValue really is a MutVar#.  The types are compatible though,
-- so we can just generate an assignment.

10 years agoFix #650: use a card table to mark dirty sections of mutable arrays
Simon Marlow [Thu, 17 Dec 2009 22:42:28 +0000 (22:42 +0000)] 
Fix #650: use a card table to mark dirty sections of mutable arrays
The card table is an array of bytes, placed directly following the
actual array data.  This means that array reading is unaffected, but
array writing needs to read the array size from the header in order to
find the card table.

We use a bytemap rather than a bitmap, because updating the card table
must be multi-thread safe.  Each byte refers to 128 entries of the
array, but this is tunable by changing the constant
MUT_ARR_PTRS_CARD_BITS in includes/Constants.h.

10 years agoFix build with Solaris sed
Ian Lynagh [Wed, 16 Dec 2009 20:43:54 +0000 (20:43 +0000)] 
Fix build with Solaris sed
Rather than trying to handle tabs with sed portably, we just use tr to
remove them before we start.

10 years agoBuild and install inplace the count_lines and compareSizes utils
Ian Lynagh [Wed, 16 Dec 2009 16:56:08 +0000 (16:56 +0000)] 
Build and install inplace the count_lines and compareSizes utils

10 years agoAdjust Activations for specialise and work/wrap, and better simplify in InlineRules [Wed, 16 Dec 2009 14:52:05 +0000 (14:52 +0000)] 
Adjust Activations for specialise and work/wrap, and better simplify in InlineRules

This patch does two main things:

1. Adjusts the way we set the Activation for

   a) The wrappers generated by the strictness analyser
      See Note [Wrapper activation] in WorkWrap

   b) The RULEs generated by Specialise and SpecConstr
      See Note [Auto-specialisation and RULES] in Specialise
          Note [Transfer activation] in SpecConstr

2. Refines how we set the phase when simplifying the right
   hand side of an InlineRule.  See
   Note [Simplifying inside InlineRules] in SimplUtils.

Most of the extra lines are comments!

The merit of (2) is that a bit more stuff happens inside InlineRules,
and that in turn allows better dead-code elimination.

10 years agoComments only [Wed, 16 Dec 2009 14:49:08 +0000 (14:49 +0000)] 
Comments only

10 years agofix up libm detection and use (#3724)
Simon Marlow [Wed, 16 Dec 2009 11:36:52 +0000 (11:36 +0000)] 
fix up libm detection and use (#3724)

10 years fix libm checks (Trac #3730)
Sergei Trofimovich [Fri, 4 Dec 2009 21:40:12 +0000 (21:40 +0000)] fix libm checks (Trac #3730)

libbfd pulled libm as dependency and broke LIBM= detection.

Patch moves libm in library tests as early as possible.
Thanks to asuffield for suggesting such a simple fix.
Thanks to Roie Kerstein and Renato Gallo for finding
and tracking down the issue.

10 years ago#include <sys/select.h> if we have it (#3760)
Simon Marlow [Wed, 16 Dec 2009 09:55:01 +0000 (09:55 +0000)] 
#include <sys/select.h> if we have it (#3760)

10 years agoadd a couple of assertions
Simon Marlow [Mon, 23 Nov 2009 10:19:18 +0000 (10:19 +0000)] 
add a couple of assertions

10 years agoAdd comments [Wed, 16 Dec 2009 09:03:44 +0000 (09:03 +0000)] 
Add comments

10 years agoRefactor to combine two eqExpr functions [Wed, 16 Dec 2009 08:50:33 +0000 (08:50 +0000)] 
Refactor to combine two eqExpr functions

I'd forgotten that Rules.lhs already has an eqExpr function.  This
patch combines Rules.eqExpr with the (recent) CoreUtils.eqExpr.

I also did a little refactoring by defining CoreSyn.expandUnfolding_maybe
(see Note [Expanding variables] in Rules.lhs), and using it in
     a) CoreUnfold.exprIsConApp_maybe
     b) Rule matching

10 years agoTwo improvements to optCoercion [Wed, 16 Dec 2009 08:47:06 +0000 (08:47 +0000)] 
Two improvements to optCoercion

* Fix a bug that meant that
     (right (inst (forall ty))
  wasn't getting optimised.  This showed up in the
  compiled code for ByteCodeItbls

* Add a substitution to optCoercion, so that it simultaneously
  substitutes and optimises.  Both call sites wanted this, and
  optCoercion itself can use it, so it seems a win all round.

10 years agoComments only [Wed, 16 Dec 2009 08:45:58 +0000 (08:45 +0000)] 
Comments only

10 years agoMake setInlineActivation left-associative [Wed, 16 Dec 2009 08:45:36 +0000 (08:45 +0000)] 
Make setInlineActivation left-associative

10 years agoFix a long-standing infelicity in the type pretty printer [Wed, 16 Dec 2009 08:45:13 +0000 (08:45 +0000)] 
Fix a long-standing infelicity in the type pretty printer

We weren't parenthesising
   List (C Int)
correctly, when (C Int) is a PredTy

10 years agoDeal with warnings in Coercion.lhs [Wed, 16 Dec 2009 08:40:53 +0000 (08:40 +0000)] 
Deal with warnings in Coercion.lhs

10 years agoFix a bug in the in-scope set that led to some lookupIdSubst errors [Tue, 15 Dec 2009 16:02:16 +0000 (16:02 +0000)] 
Fix a bug in the in-scope set that led to some lookupIdSubst errors

10 years agoFix Trac #3717: exprOkForSpeculation should look through case expressions [Tue, 15 Dec 2009 16:01:24 +0000 (16:01 +0000)] 
Fix Trac #3717: exprOkForSpeculation should look through case expressions

See Note [exprOkForSpeculation: case expressions] in CoreUtils

10 years agoAdd a size-comparison util
Ian Lynagh [Tue, 15 Dec 2009 20:26:36 +0000 (20:26 +0000)] 
Add a size-comparison util

10 years agoJust make C dependencies once, rather than each way
Ian Lynagh [Tue, 15 Dec 2009 13:53:50 +0000 (13:53 +0000)] 
Just make C dependencies once, rather than each way
This makes generating C dependencies for the RTS take 3 seconds, rather
than 30.

10 years agoMake addCFileDeps quieter
Ian Lynagh [Tue, 15 Dec 2009 13:40:33 +0000 (13:40 +0000)] 
Make addCFileDeps quieter
Move a comment out of the definition, so it doesn't get printed as
a shell command every time we call the definition

10 years agoDon't make C deps for compiler/parser/cutils.c in stage1
Ian Lynagh [Tue, 15 Dec 2009 12:37:57 +0000 (12:37 +0000)] 
Don't make C deps for compiler/parser/cutils.c in stage1
CPP finds the Rts.h, RtsFlags.h etc from the tree, rather than the
bootstrapping compiler, and then fails because it doesn't think
RtsFlags.h should be used any more.

10 years agoTidy up computation of result discounts in CoreUnfold [Mon, 14 Dec 2009 13:46:47 +0000 (13:46 +0000)] 
Tidy up computation of result discounts in CoreUnfold

Mostly this patch is a tidy-up, but it did reveal one inconsistency
that I fixed.  When computing result discounts for case expressions,
we were *adding* result-discounts for cases on non-arguments, but
*picking the one for the max-size branch* for arguments. I think you
could argue the toss, but it seems neater (and the code is nicer)
to be consistent (ie always add).  See Note [addAltSize result discounts].

The nofib results seem fine

        Program           Size    Allocs   Runtime   Elapsed
          boyer          -0.8%     -4.8%      0.06      0.07
         sphere          -0.7%     -2.5%      0.15      0.16
            Min          -0.8%     -4.8%    -19.1%    -24.8%
            Max          -0.5%     +0.0%     +3.4%   +127.1%
 Geometric Mean          -0.7%     -0.1%     -4.3%     -1.3%

The +127% elapsed is a timing error; I re-ran the same binary and it's
unchanged from the baseline.

10 years agoUse full equality for CSE [Fri, 11 Dec 2009 17:39:20 +0000 (17:39 +0000)] 
Use full equality for CSE

In CSE we were getting lots of apprarently-unequal expressions with
the same hash code.  In fact they were perfectly equal -- but we were
using a cheap-and-cheerful equality tests for CoreExpr that said False
for any lambda expression!

This patch adds a proper equality test for Core, with alpha-renaming.
It's easy to do, and will avoid silly cases of CSE failing to fire.

We should get less of this:
  WARNING: file compiler/simplCore/CSE.lhs line 326
  extendCSEnv: long list, length 18
from a compiler built with -DDEBUG

10 years agoImprove strictness analysis for bottoming functions [Fri, 11 Dec 2009 16:23:24 +0000 (16:23 +0000)] 
Improve strictness analysis for bottoming functions

I found the following results from strictness analyis:
  f x = error (fst x)      -- Strictness U(SA)b
  g x = error ('y':fst x)  -- Strictness Tb

Surely 'g' is no less strict on 'x' than 'f' is!  The fix turned out
be to very nice and simple.  See Note [Bottom demands] in DmdAnal.

10 years agoBottom extraction: float out bottoming expressions to top level [Fri, 11 Dec 2009 16:19:28 +0000 (16:19 +0000)] 
Bottom extraction: float out bottoming expressions to top level

The idea is to float out bottoming expressions to top level,
abstracting them over any variables they mention, if necessary.  This
is good because it makes functions smaller (and more likely to
inline), by keeping error code out of line.

See Note [Bottoming floats] in SetLevels.

On the way, this fixes the HPC failures for cg059 and friends.

I've been meaning to do this for some time.  See Maessen's paper 1999
"Bottom extraction: factoring error handling out of functional
programs" (unpublished I think).

Here are the nofib results:

        Program           Size    Allocs   Runtime   Elapsed
            Min          +0.1%     -7.8%    -14.4%    -32.5%
            Max          +0.5%     +0.2%     +1.6%    +13.8%
 Geometric Mean          +0.4%     -0.2%     -4.9%     -6.7%

Module sizes
        -1 s.d.                -----           -2.6%
        +1 s.d.                -----           +2.3%
        Average                -----           -0.2%

Compile times:
        -1 s.d.                -----          -11.4%
        +1 s.d.                -----           +4.3%
        Average                -----           -3.8%

I'm think program sizes have crept up because the base library
is bigger -- module sizes in nofib decrease very slightly.  In turn
I think that may be because the floating generates a call where
there was no call before.  Anyway I think it's acceptable.

The main changes are:

* SetLevels floats out things that exprBotStrictness_maybe
  identifies as bottom.  Make sure to pin on the right
  strictness info to the newly created Ids, so that the
  info ends up in interface files.

  Since FloatOut is run twice, we have to be careful that we
  don't treat the function created by the first float-out as
  a candidate for the second; this is what worthFloating does.

  See SetLevels Note [Bottoming floats]
                Note [Bottoming floats: eta expansion]

* Be careful not to inline top-level bottoming functions; this
  would just undo what the floating transformation achieves.
  See CoreUnfold Note [Do not inline top-level bottoming functions

  Ensuring this requires a bit of extra plumbing, but nothing drastic..

* Similarly pre/postInlineUnconditionally should be
  careful not to re-inline top-level bottoming things!
  See SimplUtils Note [Top-level botomming Ids]
                 Note [Top level and postInlineUnconditionally]

10 years agoExpose all EventLog events as DTrace probes
Manuel M T Chakravarty [Sat, 12 Dec 2009 10:08:09 +0000 (10:08 +0000)] 
Expose all EventLog events as DTrace probes
- Defines a DTrace provider, called 'HaskellEvent', that provides a probe
  for every event of the eventlog framework.
- In contrast to the original eventlog, the DTrace probes are available in
  all flavours of the runtime system (DTrace probes have virtually no
  overhead if not enabled); when -DTRACING is defined both the regular
  event log as well as DTrace probes can be used.
- Currently, Mac OS X only.  User-space DTrace probes are implemented
  differently on Mac OS X than in the original DTrace implementation.
  Nevertheless, it shouldn't be too hard to enable these probes on other
  platforms, too.
- Documentation is at

10 years agoFix two related bugs in u_tys [Fri, 11 Dec 2009 12:01:22 +0000 (12:01 +0000)] 
Fix two related bugs in u_tys

When we normalise a type family application we must recursively call
uTys, *not* 'go', because the latter loop is only there to look
through type synonyms.  This bug made the type checker generate
ill-typed coercions, which were rejected by Core Lint.

A related bug only affects the size of coercions.  If faced with
  (m a) ~ (F b c)
where F has arity 1, we want to decompose to
   m ~ F Int,  a ~ c
rather than deferring.  The application decomposition was being
tried last, so we were missing this opportunity.

Thanks to Roman for an example that showed all this up.

10 years agoFix spelling in comment [Fri, 11 Dec 2009 11:57:44 +0000 (11:57 +0000)] 
Fix spelling in comment

10 years agoMake -ddump-simpl-stats a bit more informative by default [Tue, 8 Dec 2009 17:54:45 +0000 (17:54 +0000)] 
Make -ddump-simpl-stats a bit more informative by default

This mades -ddump-simpl-stats print out per-rule and per-id
information by default, rather than requiring -dppr-debug.
On the whole that is what you want.  The -dppr-debug flag
now just controls printing of the log.

10 years agoImprove dumping for rules, and documentation of same [Tue, 8 Dec 2009 10:55:56 +0000 (10:55 +0000)] 
Improve dumping for rules, and documentation of same

Inspired by Trac #3703

10 years agoFix #3741, simplifying things in the process
Simon Marlow [Thu, 10 Dec 2009 16:09:09 +0000 (16:09 +0000)] 
Fix #3741, simplifying things in the process
The problem in #3741 was that we had confused column numbers with byte
offsets, which fails in the case of UTF-8 (amongst other things).
Fortunately we're tracking correct column offsets now, so we didn't
have to make a calculation based on a byte offset.  I got rid of two
fields from the PState (last_line_len and last_offs).and one field
from the AI (alex input) constructor.

10 years agoAllow spaces at either end of the C import spec (#3742)
Simon Marlow [Thu, 10 Dec 2009 12:45:37 +0000 (12:45 +0000)] 
Allow spaces at either end of the C import spec (#3742)

10 years agoPut README and INSTALL into bindists
Ian Lynagh [Wed, 9 Dec 2009 17:43:05 +0000 (17:43 +0000)] 
Put README and INSTALL into bindists
Also tidied up the way gets into bindists

10 years agoFix typo
Ian Lynagh [Wed, 9 Dec 2009 15:22:23 +0000 (15:22 +0000)] 
Fix typo

10 years agoFix the stage1 version number munging
Ian Lynagh [Wed, 9 Dec 2009 15:17:15 +0000 (15:17 +0000)] 
Fix the stage1 version number munging
It was munging 6.12.1 into 62

10 years agoAdd a comment about why $(CPP) is defined the way it is in
Ian Lynagh [Wed, 9 Dec 2009 13:19:17 +0000 (13:19 +0000)] 
Add a comment about why $(CPP) is defined the way it is in

10 years agoadd a missing unlockTSO()
Simon Marlow [Wed, 9 Dec 2009 12:41:13 +0000 (12:41 +0000)] 
add a missing unlockTSO()

10 years agoEliminate mkdependC
Ian Lynagh [Wed, 9 Dec 2009 12:39:29 +0000 (12:39 +0000)] 
Eliminate mkdependC
We now just call gcc to get the dependencies directly

10 years agoChange some HC_OPTS to CC_OPTS, so they are used when making dependencies
Ian Lynagh [Tue, 8 Dec 2009 20:03:15 +0000 (20:03 +0000)] 
Change some HC_OPTS to CC_OPTS, so they are used when making dependencies

10 years agoAdd -Iincludes to hp2ps's CC_OPTS
Ian Lynagh [Tue, 8 Dec 2009 17:57:18 +0000 (17:57 +0000)] 
Add -Iincludes to hp2ps's CC_OPTS
Making C deps for hp2ps always failed, but we used to carry on regardless

10 years agoadd locking in mkWeakForeignEnv#
Simon Marlow [Tue, 8 Dec 2009 10:12:29 +0000 (10:12 +0000)] 
add locking in mkWeakForeignEnv#

10 years agodeclare g0 (fixes compilation failure with -fvia-C)
Simon Marlow [Tue, 8 Dec 2009 10:09:25 +0000 (10:09 +0000)] 
declare g0 (fixes compilation failure with -fvia-C)

10 years agosimplify weak pointer processing
Simon Marlow [Tue, 8 Dec 2009 09:48:22 +0000 (09:48 +0000)] 
simplify weak pointer processing

10 years agosimplification/optimisation: update tso->bound->tso when scavenging the TSO
Simon Marlow [Tue, 8 Dec 2009 08:57:39 +0000 (08:57 +0000)] 
simplification/optimisation: update tso->bound->tso when scavenging the TSO

10 years agothreadStackUnderflow: fix recently introduced bug (conc068(threaded1) failure)
Simon Marlow [Mon, 7 Dec 2009 17:01:27 +0000 (17:01 +0000)] 
threadStackUnderflow: fix recently introduced bug (conc068(threaded1) failure)

bug introduced by "threadStackUnderflow: put the new TSO on the mut
list if necessary"

10 years agoneed locking around use of weak_ptr_list in mkWeak#
Simon Marlow [Mon, 7 Dec 2009 14:52:13 +0000 (14:52 +0000)] 
need locking around use of weak_ptr_list in mkWeak#

10 years agoremove global 'total_allocated', seems to be the same as 'GC_tot_alloc'
Simon Marlow [Mon, 7 Dec 2009 11:53:59 +0000 (11:53 +0000)] 
remove global 'total_allocated', seems to be the same as 'GC_tot_alloc'

10 years agoAdd some explanation about overlapping instances [Mon, 7 Dec 2009 15:39:15 +0000 (15:39 +0000)] 
Add some explanation about overlapping instances

Trac #3734 suggested addding some extra guidance about
incoherence and overlap; now done

10 years agoTidy up deriving error messages [Mon, 7 Dec 2009 13:08:50 +0000 (13:08 +0000)] 
Tidy up deriving error messages

I did this in response to a suggestion in Trac #3702

10 years agoFix profiling build
Simon Marlow [Mon, 7 Dec 2009 09:23:14 +0000 (09:23 +0000)] 
Fix profiling build

10 years agoMinor refactoring to remove redundant code [Mon, 7 Dec 2009 08:33:12 +0000 (08:33 +0000)] 
Minor refactoring to remove redundant code

10 years agoFix a nasty (and long-standing) FloatOut performance bug [Mon, 7 Dec 2009 08:32:46 +0000 (08:32 +0000)] 
Fix a nasty (and long-standing) FloatOut performance bug

The effect was that, in deeply-nested applications, FloatOut would
take quadratic time.  A good example was compiling
in which FloatOut had a visible pause of a couple of seconds!
Profiling showed that 40% of the entire compile time was being
consumbed by the single function partitionByMajorLevel.

The bug was that the floating bindings (type FloatBinds) was kept
as a list, which was partitioned at each binding site.  In programs
with deeply nested lists, such as
       e1 : e2 : e3 : .... : e5000 : []
this led to quadratic behaviour.

The solution is to use a proper finite-map representation;
see the new definition of FloatBinds near the bottom of FloatOut.

10 years agoAdd a new to-do to cmm-notes [Mon, 7 Dec 2009 08:11:30 +0000 (08:11 +0000)] 
Add a new to-do to cmm-notes

10 years agoComments only, principally about IfaceDeclExtras [Mon, 7 Dec 2009 08:11:08 +0000 (08:11 +0000)] 
Comments only, principally about IfaceDeclExtras

10 years agoComments only, about RULE plumbing [Mon, 7 Dec 2009 08:04:42 +0000 (08:04 +0000)] 
Comments only, about RULE plumbing

10 years agoAdd splitUFM to UniqFM (used in a forthcoming patch) [Fri, 4 Dec 2009 16:08:20 +0000 (16:08 +0000)] 
Add splitUFM to UniqFM (used in a forthcoming patch)

splitUFM :: Uniquable key => UniqFM elt -> key -> (UniqFM elt, Maybe elt, UniqFM elt)
   -- Splits a UFM into things less than, equal to, and greater than the key

10 years agoAdd lengthBag to Bag (using in forthcoming patch) [Fri, 4 Dec 2009 15:50:55 +0000 (15:50 +0000)] 
Add lengthBag to Bag (using in forthcoming patch)

10 years agoUse addToUFM_Acc where appropriate [Fri, 4 Dec 2009 15:50:36 +0000 (15:50 +0000)] 
Use addToUFM_Acc where appropriate

This way of extending a UniqFM has existed for some time, but
we weren't really using it.

addToUFM_Acc :: Uniquable key =>
      (elt -> elts -> elts) -- Add to existing
   -> (elt -> elts) -- New element
   -> UniqFM elts  -- old
   -> key -> elt  -- new
   -> UniqFM elts -- result

10 years agoAdd comments to "OPTIONS_GHC -fno-warn-orphans" pragmas
Ian Lynagh [Sat, 5 Dec 2009 16:57:21 +0000 (16:57 +0000)] 
Add comments to "OPTIONS_GHC -fno-warn-orphans" pragmas

10 years agoAdd some missing exports back for GHC package users; fixes trac #3715
Ian Lynagh [Sat, 5 Dec 2009 15:35:32 +0000 (15:35 +0000)] 
Add some missing exports back for GHC package users; fixes trac #3715

10 years agoAdd some comments on the alternative layout rule state
Ian Lynagh [Sat, 5 Dec 2009 15:20:39 +0000 (15:20 +0000)] 
Add some comments on the alternative layout rule state

10 years agoTweak layout for alternative layout rule
Ian Lynagh [Thu, 3 Dec 2009 16:44:24 +0000 (16:44 +0000)] 
Tweak layout for alternative layout rule

10 years agoLink all dynamic libraries with the correct install_name on Mac OS/X.
Ian Lynagh [Fri, 4 Dec 2009 14:36:14 +0000 (14:36 +0000)] 
Link all dynamic libraries with the correct install_name on Mac OS/X.
This is a rerecord of
    Stephen Blackheath <>**20090930222855
to avoid conflicts.

10 years agoDocument the new -dylib-install-name option in the user's guide.
Stephen Blackheath [Thu, 1 Oct 2009 05:16:37 +0000 (05:16 +0000)] 
Document the new -dylib-install-name option in the user's guide.

10 years agoAdd -dylib-install-name option to GHC so the install name can be set for dynamic...
Stephen Blackheath [Wed, 30 Sep 2009 22:37:08 +0000 (22:37 +0000)] 
Add -dylib-install-name option to GHC so the install name can be set for dynamic libs on Mac OS/X.