ghc-hetmet.git
12 years agoMinor refactoring
simonpj@microsoft.com [Fri, 30 Oct 2009 17:59:07 +0000 (17:59 +0000)]
Minor refactoring

MkCore.mkCoreTupTy moves to TysWiredIn, where it is called mkBoxedTupleTy

12 years agoRemove unused DYNAMIC_RTS var from rts/ghc.mk
Ben.Lippmeier@anu.edu.au [Tue, 6 Oct 2009 07:25:39 +0000 (07:25 +0000)]
Remove unused DYNAMIC_RTS var from rts/ghc.mk

12 years agoUse __PIC__ and ming32_TARGET_OS to turn on windows DLL support, not ENABLE_WIN32_DLL...
Ben.Lippmeier@anu.edu.au [Tue, 6 Oct 2009 05:40:32 +0000 (05:40 +0000)]
Use __PIC__ and ming32_TARGET_OS to turn on windows DLL support, not ENABLE_WIN32_DLL_SUPPORT

12 years agoUse C syntax for casting. 'stgCast' appears to have gone away.
Ben.Lippmeier@anu.edu.au [Tue, 6 Oct 2009 05:34:14 +0000 (05:34 +0000)]
Use C syntax for casting. 'stgCast' appears to have gone away.

12 years agoHandle deps with numbers in them, like 'wsock32'.
Ben.Lippmeier@anu.edu.au [Tue, 6 Oct 2009 05:26:16 +0000 (05:26 +0000)]
Handle deps with numbers in them, like 'wsock32'.

12 years agoDefine BootingFromHc in bindists; fixes #3617
Ian Lynagh [Sat, 31 Oct 2009 08:44:26 +0000 (08:44 +0000)]
Define BootingFromHc in bindists; fixes #3617
This variable is tested when deciding whether or not to add debug to
the list of RTS ways, so it needs to be correctly defined.

12 years agoAdd ghc-cabal dependencies; fixes #3494
Ian Lynagh [Fri, 30 Oct 2009 21:19:28 +0000 (21:19 +0000)]
Add ghc-cabal dependencies; fixes #3494

12 years agoTurn an ASSERT into a WARN
simonpj@microsoft.com [Fri, 30 Oct 2009 18:00:51 +0000 (18:00 +0000)]
Turn an ASSERT into a WARN

This is to do with SPECIALISE pragmas in instance declarations,
which I need to think more about

12 years agoBe less noisy in a debug trace (Arity decrease)
simonpj@microsoft.com [Fri, 30 Oct 2009 17:59:43 +0000 (17:59 +0000)]
Be less noisy in a debug trace (Arity decrease)

12 years agoFix build with DEBUG on
simonpj@microsoft.com [Fri, 30 Oct 2009 17:57:15 +0000 (17:57 +0000)]
Fix build with DEBUG on

12 years agoCure an assert failure by gathering the right set of free variables
simonpj@microsoft.com [Fri, 30 Oct 2009 17:56:52 +0000 (17:56 +0000)]
Cure an assert failure by gathering the right set of free variables

12 years agoFix the build with GHC 6.8
Ian Lynagh [Fri, 30 Oct 2009 16:09:08 +0000 (16:09 +0000)]
Fix the build with GHC 6.8

12 years agoImprove coercion optimisation
simonpj@microsoft.com [Fri, 30 Oct 2009 10:00:34 +0000 (10:00 +0000)]
Improve coercion optimisation

* Remove trace from optCoercion

* Use simplCoercion for type arguments in the Simplifier
  (because they might be coercions)

12 years agoDeprecate the ImpredicativeTypes feature
simonpj@microsoft.com [Fri, 30 Oct 2009 09:59:29 +0000 (09:59 +0000)]
Deprecate the ImpredicativeTypes feature

GHC has had an experimental implementation of impredicative
polymorphism for a year or two now (flag -XImpredicativeTypes).
But

  a) The implementation is ridiculously complicated, and the complexity
     is pervasive (in the type checker) rather than localized.
     I'm very unhappy about this, especially as we add more stuff to
     the type checker for type families.

  b) The specification (type system) is well-defined [1], but is also pretty
     complicated, and it's just too hard to predict which programs will
     typecheck and which will not.

So it's time for a re-think.  I propose to deprecate it in 6.12, and
remove it altogether in 6.14.  We may by then have something else to
put in its place.  (There is no lack of candidates [2,3,4]!)

[1] http://research.microsoft.com/en-us/um/people/simonpj/papers/boxy/
[2] http://research.microsoft.com/en-us/um/people/crusso/qml/
[3] http://research.microsoft.com/en-us/um/people/daan/pubs.html
[4] http://gallium.inria.fr/~remy/mlf/

12 years agoFix Trac #3626: TH should reject unboxed tuples
simonpj@microsoft.com [Fri, 30 Oct 2009 09:19:28 +0000 (09:19 +0000)]
Fix Trac #3626: TH should reject unboxed tuples

This was just a missing test in DsMeta

12 years agofix and enable coercion optimization
tom.schrijvers@cs.kuleuven.be [Wed, 28 Oct 2009 19:53:59 +0000 (19:53 +0000)]
fix and enable coercion optimization

12 years agoDon't dump Core after every simplifier iteration with -dverbose-core2core
Roman Leshchinskiy [Fri, 30 Oct 2009 02:09:03 +0000 (02:09 +0000)]
Don't dump Core after every simplifier iteration with -dverbose-core2core

This just restores the behaviour from before the inline patch.

12 years agoAdapt vectoriser to new inlining mechanism
Roman Leshchinskiy [Fri, 30 Oct 2009 00:41:37 +0000 (00:41 +0000)]
Adapt vectoriser to new inlining mechanism

12 years agoUse packByTag instead of pack in the vectoriser
Roman Leshchinskiy [Fri, 30 Oct 2009 00:30:11 +0000 (00:30 +0000)]
Use packByTag instead of pack in the vectoriser

12 years agoThe Big INLINE Patch: totally reorganise way that INLINE pragmas work
simonpj@microsoft.com [Thu, 29 Oct 2009 14:30:51 +0000 (14:30 +0000)]
The Big INLINE Patch: totally reorganise way that INLINE pragmas work

This patch has been a long time in gestation and has, as a
result, accumulated some extra bits and bobs that are only
loosely related.  I separated the bits that are easy to split
off, but the rest comes as one big patch, I'm afraid.

Note that:
 * It comes together with a patch to the 'base' library
 * Interface file formats change slightly, so you need to
   recompile all libraries

The patch is mainly giant tidy-up, driven in part by the
particular stresses of the Data Parallel Haskell project. I don't
expect a big performance win for random programs.  Still, here are the
nofib results, relative to the state of affairs without the patch

        Program           Size    Allocs   Runtime   Elapsed
--------------------------------------------------------------------------------
            Min         -12.7%    -14.5%    -17.5%    -17.8%
            Max          +4.7%    +10.9%     +9.1%     +8.4%
 Geometric Mean          +0.9%     -0.1%     -5.6%     -7.3%

The +10.9% allocation outlier is rewrite, which happens to have a
very delicate optimisation opportunity involving an interaction
of CSE and inlining (see nofib/Simon-nofib-notes). The fact that
the 'before' case found the optimisation is somewhat accidental.
Runtimes seem to go down, but I never kno wwhether to really trust
this number.  Binary sizes wobble a bit, but nothing drastic.

The Main Ideas are as follows.

InlineRules
~~~~~~~~~~~
When you say
      {-# INLINE f #-}
      f x = <rhs>
you intend that calls (f e) are replaced by <rhs>[e/x] So we
should capture (\x.<rhs>) in the Unfolding of 'f', and never meddle
with it.  Meanwhile, we can optimise <rhs> to our heart's content,
leaving the original unfolding intact in Unfolding of 'f'.

So the representation of an Unfolding has changed quite a bit
(see CoreSyn).  An INLINE pragma gives rise to an InlineRule
unfolding.

Moreover, it's only used when 'f' is applied to the
specified number of arguments; that is, the number of argument on
the LHS of the '=' sign in the original source definition.
For example, (.) is now defined in the libraries like this
   {-# INLINE (.) #-}
   (.) f g = \x -> f (g x)
so that it'll inline when applied to two arguments. If 'x' appeared
on the left, thus
   (.) f g x = f (g x)
it'd only inline when applied to three arguments.  This slightly-experimental
change was requested by Roman, but it seems to make sense.

Other associated changes

* Moving the deck chairs in DsBinds, which processes the INLINE pragmas

* In the old system an INLINE pragma made the RHS look like
   (Note InlineMe <rhs>)
  The Note switched off optimisation in <rhs>.  But it was quite
  fragile in corner cases. The new system is more robust, I believe.
  In any case, the InlineMe note has disappeared

* The workerInfo of an Id has also been combined into its Unfolding,
  so it's no longer a separate field of the IdInfo.

* Many changes in CoreUnfold, esp in callSiteInline, which is the critical
  function that decides which function to inline.  Lots of comments added!

* exprIsConApp_maybe has moved to CoreUnfold, since it's so strongly
  associated with "does this expression unfold to a constructor application".
  It can now do some limited beta reduction too, which Roman found
  was an important.

Instance declarations
~~~~~~~~~~~~~~~~~~~~~
It's always been tricky to get the dfuns generated from instance
declarations to work out well.  This is particularly important in
the Data Parallel Haskell project, and I'm now on my fourth attempt,
more or less.

There is a detailed description in TcInstDcls, particularly in
Note [How instance declarations are translated].   Roughly speaking
we now generate a top-level helper function for every method definition
in an instance declaration, so that the dfun takes a particularly
stylised form:
  dfun a d1 d2 = MkD (op1 a d1 d2) (op2 a d1 d2) ...etc...

In fact, it's *so* stylised that we never need to unfold a dfun.
Instead ClassOps have a special rewrite rule that allows us to
short-cut dictionary selection.  Suppose dfun :: Ord a -> Ord [a]
                                            d :: Ord a
Then
    compare (dfun a d)  -->   compare_list a d
in one rewrite, without first inlining the 'compare' selector
and the body of the dfun.

To support this
a) ClassOps have a BuiltInRule (see MkId.dictSelRule)
b) DFuns have a special form of unfolding (CoreSyn.DFunUnfolding)
   which is exploited in CoreUnfold.exprIsConApp_maybe

Implmenting all this required a root-and-branch rework of TcInstDcls
and bits of TcClassDcl.

Default methods
~~~~~~~~~~~~~~~
If you give an INLINE pragma to a default method, it should be just
as if you'd written out that code in each instance declaration, including
the INLINE pragma.  I think that it now *is* so.  As a result, library
code can be simpler; less duplication.

The CONLIKE pragma
~~~~~~~~~~~~~~~~~~
In the DPH project, Roman found cases where he had

   p n k = let x = replicate n k
           in ...(f x)...(g x)....

   {-# RULE f (replicate x) = f_rep x #-}

Normally the RULE would not fire, because doing so involves
(in effect) duplicating the redex (replicate n k).  A new
experimental modifier to the INLINE pragma, {-# INLINE CONLIKE
replicate #-}, allows you to tell GHC to be prepared to duplicate
a call of this function if it allows a RULE to fire.

See Note [CONLIKE pragma] in BasicTypes

Join points
~~~~~~~~~~~
See Note [Case binders and join points] in Simplify

Other refactoring
~~~~~~~~~~~~~~~~~
* I moved endPass from CoreLint to CoreMonad, with associated jigglings

* Better pretty-printing of Core

* The top-level RULES (ones that are not rules for locally-defined things)
  are now substituted on every simplifier iteration.  I'm not sure how
  we got away without doing this before.  This entails a bit more plumbing
  in SimplCore.

* The necessary stuff to serialise and deserialise the new
  info across interface files.

* Something about bottoming floats in SetLevels
      Note [Bottoming floats]

* substUnfolding has moved from SimplEnv to CoreSubs, where it belongs

--------------------------------------------------------------------------------
        Program           Size    Allocs   Runtime   Elapsed
--------------------------------------------------------------------------------
           anna          +2.4%     -0.5%      0.16      0.17
           ansi          +2.6%     -0.1%      0.00      0.00
           atom          -3.8%     -0.0%     -1.0%     -2.5%
         awards          +3.0%     +0.7%      0.00      0.00
         banner          +3.3%     -0.0%      0.00      0.00
     bernouilli          +2.7%     +0.0%     -4.6%     -6.9%
          boyer          +2.6%     +0.0%      0.06      0.07
         boyer2          +4.4%     +0.2%      0.01      0.01
           bspt          +3.2%     +9.6%      0.02      0.02
      cacheprof          +1.4%     -1.0%    -12.2%    -13.6%
       calendar          +2.7%     -1.7%      0.00      0.00
       cichelli          +3.7%     -0.0%      0.13      0.14
        circsim          +3.3%     +0.0%     -2.3%     -9.9%
       clausify          +2.7%     +0.0%      0.05      0.06
  comp_lab_zift          +2.6%     -0.3%     -7.2%     -7.9%
       compress          +3.3%     +0.0%     -8.5%     -9.6%
      compress2          +3.6%     +0.0%    -15.1%    -17.8%
    constraints          +2.7%     -0.6%    -10.0%    -10.7%
   cryptarithm1          +4.5%     +0.0%     -4.7%     -5.7%
   cryptarithm2          +4.3%    -14.5%      0.02      0.02
            cse          +4.4%     -0.0%      0.00      0.00
          eliza          +2.8%     -0.1%      0.00      0.00
          event          +2.6%     -0.0%     -4.9%     -4.4%
         exp3_8          +2.8%     +0.0%     -4.5%     -9.5%
         expert          +2.7%     +0.3%      0.00      0.00
            fem          -2.0%     +0.6%      0.04      0.04
            fft          -6.0%     +1.8%      0.05      0.06
           fft2          -4.8%     +2.7%      0.13      0.14
       fibheaps          +2.6%     -0.6%      0.05      0.05
           fish          +4.1%     +0.0%      0.03      0.04
          fluid          -2.1%     -0.2%      0.01      0.01
         fulsom          -4.8%     +9.2%     +9.1%     +8.4%
         gamteb          -7.1%     -1.3%      0.10      0.11
            gcd          +2.7%     +0.0%      0.05      0.05
    gen_regexps          +3.9%     -0.0%      0.00      0.00
         genfft          +2.7%     -0.1%      0.05      0.06
             gg          -2.7%     -0.1%      0.02      0.02
           grep          +3.2%     -0.0%      0.00      0.00
         hidden          -0.5%     +0.0%    -11.9%    -13.3%
            hpg          -3.0%     -1.8%     +0.0%     -2.4%
            ida          +2.6%     -1.2%      0.17     -9.0%
          infer          +1.7%     -0.8%      0.08      0.09
        integer          +2.5%     -0.0%     -2.6%     -2.2%
      integrate          -5.0%     +0.0%     -1.3%     -2.9%
        knights          +4.3%     -1.5%      0.01      0.01
           lcss          +2.5%     -0.1%     -7.5%     -9.4%
           life          +4.2%     +0.0%     -3.1%     -3.3%
           lift          +2.4%     -3.2%      0.00      0.00
      listcompr          +4.0%     -1.6%      0.16      0.17
       listcopy          +4.0%     -1.4%      0.17      0.18
       maillist          +4.1%     +0.1%      0.09      0.14
         mandel          +2.9%     +0.0%      0.11      0.12
        mandel2          +4.7%     +0.0%      0.01      0.01
        minimax          +3.8%     -0.0%      0.00      0.00
        mkhprog          +3.2%     -4.2%      0.00      0.00
     multiplier          +2.5%     -0.4%     +0.7%     -1.3%
       nucleic2          -9.3%     +0.0%      0.10      0.10
           para          +2.9%     +0.1%     -0.7%     -1.2%
      paraffins         -10.4%     +0.0%      0.20     -1.9%
         parser          +3.1%     -0.0%      0.05      0.05
        parstof          +1.9%     -0.0%      0.00      0.01
            pic          -2.8%     -0.8%      0.01      0.02
          power          +2.1%     +0.1%     -8.5%     -9.0%
         pretty         -12.7%     +0.1%      0.00      0.00
         primes          +2.8%     +0.0%      0.11      0.11
      primetest          +2.5%     -0.0%     -2.1%     -3.1%
         prolog          +3.2%     -7.2%      0.00      0.00
         puzzle          +4.1%     +0.0%     -3.5%     -8.0%
         queens          +2.8%     +0.0%      0.03      0.03
        reptile          +2.2%     -2.2%      0.02      0.02
        rewrite          +3.1%    +10.9%      0.03      0.03
           rfib          -5.2%     +0.2%      0.03      0.03
            rsa          +2.6%     +0.0%      0.05      0.06
            scc          +4.6%     +0.4%      0.00      0.00
          sched          +2.7%     +0.1%      0.03      0.03
            scs          -2.6%     -0.9%     -9.6%    -11.6%
         simple          -4.0%     +0.4%    -14.6%    -14.9%
          solid          -5.6%     -0.6%     -9.3%    -14.3%
        sorting          +3.8%     +0.0%      0.00      0.00
         sphere          -3.6%     +8.5%      0.15      0.16
         symalg          -1.3%     +0.2%      0.03      0.03
            tak          +2.7%     +0.0%      0.02      0.02
      transform          +2.0%     -2.9%     -8.0%     -8.8%
       treejoin          +3.1%     +0.0%    -17.5%    -17.8%
      typecheck          +2.9%     -0.3%     -4.6%     -6.6%
        veritas          +3.9%     -0.3%      0.00      0.00
           wang          -6.2%     +0.0%      0.18     -9.8%
      wave4main         -10.3%     +2.6%     -2.1%     -2.3%
   wheel-sieve1          +2.7%     -0.0%     +0.3%     -0.6%
   wheel-sieve2          +2.7%     +0.0%     -3.7%     -7.5%
           x2n1          -4.1%     +0.1%      0.03      0.04
--------------------------------------------------------------------------------
            Min         -12.7%    -14.5%    -17.5%    -17.8%
            Max          +4.7%    +10.9%     +9.1%     +8.4%
 Geometric Mean          +0.9%     -0.1%     -5.6%     -7.3%

12 years agoComments and -ddump-tc-trace wibbles only
simonpj@microsoft.com [Thu, 29 Oct 2009 12:22:27 +0000 (12:22 +0000)]
Comments and -ddump-tc-trace wibbles only

12 years agoWhite space only
simonpj@microsoft.com [Thu, 29 Oct 2009 12:19:22 +0000 (12:19 +0000)]
White space only

12 years agoComments and variable naming only
simonpj@microsoft.com [Thu, 29 Oct 2009 12:18:31 +0000 (12:18 +0000)]
Comments and variable naming only

12 years agoAdd static flag -funfolding-dict-discount (plus layout changes)
simonpj@microsoft.com [Thu, 29 Oct 2009 12:17:58 +0000 (12:17 +0000)]
Add static flag -funfolding-dict-discount (plus layout changes)

12 years agoTidy up pretty-printing (use ppUnless)
simonpj@microsoft.com [Thu, 29 Oct 2009 12:16:01 +0000 (12:16 +0000)]
Tidy up pretty-printing (use ppUnless)

12 years agoA small refactoring in the code for desugaring explicit lists
simonpj@microsoft.com [Thu, 29 Oct 2009 12:14:34 +0000 (12:14 +0000)]
A small refactoring in the code for desugaring explicit lists

12 years agoWhite space layout only
simonpj@microsoft.com [Thu, 29 Oct 2009 12:04:09 +0000 (12:04 +0000)]
White space layout only

12 years agoMake `consBag` infixr, and `snocBag` infixl
simonpj@microsoft.com [Thu, 29 Oct 2009 12:02:37 +0000 (12:02 +0000)]
Make `consBag` infixr, and `snocBag` infixl

12 years agoAdd Outputable.blankLine and use it
simonpj@microsoft.com [Thu, 29 Oct 2009 12:01:55 +0000 (12:01 +0000)]
Add Outputable.blankLine and use it

12 years agoComments only
simonpj@microsoft.com [Thu, 29 Oct 2009 11:55:39 +0000 (11:55 +0000)]
Comments only

12 years agoAdd support for NoSpecConstr annotation
Roman Leshchinskiy [Thu, 29 Oct 2009 14:47:43 +0000 (14:47 +0000)]
Add support for NoSpecConstr annotation

Annotating a type with NoSpecConstr will prevent SpecConstr from specialising
on arguments of that type. The syntax is

import SpecConstr
{-# ANN type T NoSpecConstr #-}

12 years agoUtility functions for annotations
Roman Leshchinskiy [Thu, 29 Oct 2009 14:32:19 +0000 (14:32 +0000)]
Utility functions for annotations

12 years agoDocument -fstrictness-before
Roman Leshchinskiy [Thu, 29 Oct 2009 14:16:51 +0000 (14:16 +0000)]
Document -fstrictness-before

12 years agoAdd new dynamic flag -fstrictness-before
Roman Leshchinskiy [Thu, 29 Oct 2009 14:15:14 +0000 (14:15 +0000)]
Add new dynamic flag -fstrictness-before

With -fstrictness-before=n, GHC runs an additional strictness analysis pass
before simplifier phase n.

12 years agoTidy VectInfo in tidyProgram
Roman Leshchinskiy [Sat, 17 Oct 2009 04:10:43 +0000 (04:10 +0000)]
Tidy VectInfo in tidyProgram

12 years agoFix bug in data type vectorisation
Roman Leshchinskiy [Fri, 16 Oct 2009 10:44:07 +0000 (10:44 +0000)]
Fix bug in data type vectorisation

12 years agoFix a dynamic linker bug that killed ghci on Snow Leopard
Manuel M T Chakravarty [Thu, 29 Oct 2009 12:41:59 +0000 (12:41 +0000)]
Fix a dynamic linker bug that killed ghci on Snow Leopard

12 years agoImprovements to the gcc wrapper
Ian Lynagh [Thu, 29 Oct 2009 11:58:31 +0000 (11:58 +0000)]
Improvements to the gcc wrapper
Add some comments and better error reporting

12 years agoFix formatting and wording in documentation of DoRec
simonpj@microsoft.com [Thu, 29 Oct 2009 11:47:26 +0000 (11:47 +0000)]
Fix formatting and wording in documentation of DoRec

12 years agoAdd some &&s to configure
Ian Lynagh [Thu, 29 Oct 2009 01:01:25 +0000 (01:01 +0000)]
Add some &&s to configure
so if the "cd" fails we don't charge on regardless.

12 years agoDon't "set -e" in configure.ac
Ian Lynagh [Thu, 29 Oct 2009 01:00:31 +0000 (01:00 +0000)]
Don't "set -e" in configure.ac
On some systems (bash 4?) configure fails because of it when
"gcc -V" fails.

12 years agoDrop unused import
simonpj@microsoft.com [Wed, 28 Oct 2009 17:59:02 +0000 (17:59 +0000)]
Drop unused import

12 years agoTidy up the parsing of comprehensions and improve locations
simonpj@microsoft.com [Wed, 28 Oct 2009 13:36:53 +0000 (13:36 +0000)]
Tidy up the parsing of comprehensions and improve locations

While I was dealing with 'rec' statements I did this tidy-up

12 years agoAdd 'rec' to stmts in a 'do', and deprecate 'mdo'
simonpj@microsoft.com [Wed, 28 Oct 2009 13:35:54 +0000 (13:35 +0000)]
Add 'rec' to stmts in a 'do', and deprecate 'mdo'

The change is this (see Trac #2798).  Instead of writing

  mdo { a <- getChar
      ; b <- f c
      ; c <- g b
      ; putChar c
      ; return b }

you would write

  do { a <- getChar
     ; rec { b <- f c
           ; c <- g b }
     ; putChar c
     ; return b }

That is,
  * 'mdo' is eliminated
  * 'rec' is added, which groups a bunch of statements
    into a single recursive statement

This 'rec' thing is already present for the arrow notation, so it
makes the two more uniform.  Moreover, 'rec' lets you say more
precisely where the recursion is (if you want to), whereas 'mdo' just
says "there's recursion here somewhere".  Lastly, all this works with
rebindable syntax (which mdo does not).

Currently 'mdo' is enabled by -XRecursiveDo.  So we now deprecate this
flag, with another flag -XDoRec to enable the 'rec' keyword.

Implementation notes:
  * Some changes in Lexer.x
  * All uses of RecStmt now use record syntax

I'm still not really happy with the "rec_ids" and "later_ids" in the
RecStmt constructor, but I don't dare change it without consulting Ross
about the consequences for arrow syntax.

12 years agoRemove a redundant parameter for mkTupleTy (the arity)
simonpj@microsoft.com [Wed, 28 Oct 2009 13:27:12 +0000 (13:27 +0000)]
Remove a redundant parameter for mkTupleTy (the arity)

12 years agoTrivial improvement to mkForAllTy
simonpj@microsoft.com [Wed, 28 Oct 2009 13:16:34 +0000 (13:16 +0000)]
Trivial improvement to mkForAllTy

12 years agoWrap gcc on Windows, to provide the -B flags
Ian Lynagh [Tue, 27 Oct 2009 20:25:03 +0000 (20:25 +0000)]
Wrap gcc on Windows, to provide the -B flags

12 years agoAdd a coercion optimiser, to reduce the size of coercion terms
simonpj@microsoft.com [Mon, 26 Oct 2009 09:47:56 +0000 (09:47 +0000)]
Add a coercion optimiser, to reduce the size of coercion terms

Coercion terms can get big (see Trac #2859 for example), so this
patch puts the infrastructure in place to optimise them:

  * Adds Coercion.optCoercion :: Coercion -> Coercion

  * Calls optCoercion in Simplify.lhs

The optimiser doesn't work right at the moment, so it is
commented out, but Tom is going to work on it.

12 years agoComments only
simonpj@microsoft.com [Fri, 23 Oct 2009 16:17:52 +0000 (16:17 +0000)]
Comments only

12 years agoAdd restrictVarEnv :: VarEnv a -> VarSet -> VarEnv a
simonpj@microsoft.com [Fri, 23 Oct 2009 16:17:35 +0000 (16:17 +0000)]
Add restrictVarEnv :: VarEnv a -> VarSet -> VarEnv a

I needed it, and then didn't need it, so it's not currently
called, but its generally useful kind of thing.

12 years agoUse braces rather than angle-brackets in debug-printing for Bags
simonpj@microsoft.com [Fri, 23 Oct 2009 16:16:31 +0000 (16:16 +0000)]
Use braces rather than angle-brackets in debug-printing for Bags

12 years agoFix Trac #3591: very tricky specialiser bug
simonpj@microsoft.com [Fri, 23 Oct 2009 16:15:51 +0000 (16:15 +0000)]
Fix Trac #3591: very tricky specialiser bug

There was a subtle bug in the interation of specialisation and floating,
described in Note [Specialisation of dictionary functions].

The net effect was to create a loop where none existed before; plain wrong.

In fixing it, I did quite a bit of house-cleaning in the specialiser, and
added a lot more comments.  It's tricky, alas.

12 years agoFix Trac #3590: a nasty type-checker bug in left/right sections
simonpj@microsoft.com [Tue, 20 Oct 2009 15:55:40 +0000 (15:55 +0000)]
Fix Trac #3590: a nasty type-checker bug in left/right sections

The bug related to the fact that boxyUnify (now) returns a coercion,
which was simply being ignored.  (TcExpr is clearly not warning-free
wrt the unused-monadic-bind thing!)

Anyway, it's fine now.  I added a test case to the test suite.

MERGE to 6.12 please.

12 years agoAllow -ticky and -prof together
simonpj@microsoft.com [Tue, 20 Oct 2009 15:52:01 +0000 (15:52 +0000)]
Allow -ticky and -prof together

The two used to be incompatible, but they aren't any longer.

In fact, -ticky should not be a 'way' any more, and doing that
is on Simon M's todo list, but this patch takes us a little
step closer.

I'm not sure this is worth merging to the 6.12 branch.

12 years agoEscape some $s in makefiles for consistency
Ian Lynagh [Sun, 25 Oct 2009 13:26:25 +0000 (13:26 +0000)]
Escape some $s in makefiles for consistency

12 years agoRemove readline license info from OS X package
Ian Lynagh [Sat, 24 Oct 2009 20:28:58 +0000 (20:28 +0000)]
Remove readline license info from OS X package
We no longer ship readline

12 years agoAdd a test to the unpulled patches in darcs-all
Ian Lynagh [Fri, 23 Oct 2009 18:15:21 +0000 (18:15 +0000)]
Add a test to the unpulled patches in darcs-all

12 years agoExplain why we check for LICENSE, not _darcs, in boot
Ian Lynagh [Fri, 23 Oct 2009 17:47:48 +0000 (17:47 +0000)]
Explain why we check for LICENSE, not _darcs, in boot

12 years agoMake a mingw tree from mingw tarballs
Ian Lynagh [Fri, 23 Oct 2009 17:44:43 +0000 (17:44 +0000)]
Make a mingw tree from mingw tarballs

12 years agoDon't build PS/PDF docs when validating
Ian Lynagh [Fri, 23 Oct 2009 14:35:12 +0000 (14:35 +0000)]
Don't build PS/PDF docs when validating
dblatex with miktex under msys/mingw can't build the PS and PDF docs,
and just building the HTML docs is sufficient to check that the
markup is correct, so we turn off PS and PDF doc building when
validating.

12 years agoDo "set -e" in configure.ac
Ian Lynagh [Fri, 23 Oct 2009 13:41:22 +0000 (13:41 +0000)]
Do "set -e" in configure.ac
So if something configure does fails, so does the whole configur script

12 years agoStop creating $(INPLACE_LIB)/perl.exe
Ian Lynagh [Tue, 20 Oct 2009 21:56:27 +0000 (21:56 +0000)]
Stop creating $(INPLACE_LIB)/perl.exe
We now use an msys/mingw perl tarball

12 years agoCheck for failure when running wget
Ian Lynagh [Tue, 20 Oct 2009 20:25:16 +0000 (20:25 +0000)]
Check for failure when running wget

12 years agoAdd tarball syncing to darcs-all
Ian Lynagh [Wed, 14 Oct 2009 16:29:48 +0000 (16:29 +0000)]
Add tarball syncing to darcs-all
We now use it for libffi and the mingw tarballs

12 years agoRemove libffi tarball from the repo
Ian Lynagh [Wed, 14 Oct 2009 13:58:07 +0000 (13:58 +0000)]
Remove libffi tarball from the repo

12 years agoFix a regression introduced in "overlap checking of the black hole queue..."
Simon Marlow [Tue, 20 Oct 2009 11:50:20 +0000 (11:50 +0000)]
Fix a regression introduced in "overlap checking of the black hole queue..."
We weren't checking the black-hole queue in the non-threaded RTS.

12 years agoTidy up TcSplice, especially runMeta and friends
simonpj@microsoft.com [Tue, 20 Oct 2009 07:44:35 +0000 (07:44 +0000)]
Tidy up TcSplice, especially runMeta and friends

I wanted to see the TH syntax produced by a splice, before its conversion
back into HsSyn.  Doing so involved some refactoring.  This only affects
deubbging code (-ddump-tc-trace).

12 years agoAdd flags -fno-specialise, -fno-float-in, and document them
simonpj@microsoft.com [Tue, 20 Oct 2009 07:42:29 +0000 (07:42 +0000)]
Add flags -fno-specialise, -fno-float-in, and document them

It turned out that we lacked flags to switch off these two passes,
so I added them.

12 years agoFix cross-reference
simonpj@microsoft.com [Tue, 20 Oct 2009 07:42:13 +0000 (07:42 +0000)]
Fix cross-reference

12 years agoFix Trac #3600: Template Haskell bug in Convert
simonpj@microsoft.com [Tue, 20 Oct 2009 07:26:16 +0000 (07:26 +0000)]
Fix Trac #3600: Template Haskell bug in Convert

This bug was introduced when I added an optimisation, described in
Note [Converting strings] in Convert.lhs.  It was treating *all*
empty lists as strings, not just string-typed ones!

The fix is easy.  Pls MERGE to stable branch.

12 years agoTweak to the way per-source-file options are specified
Simon Marlow [Thu, 15 Oct 2009 12:22:25 +0000 (12:22 +0000)]
Tweak to the way per-source-file options are specified

12 years agoAdd some manual dependencies, and -fforce-recomp for Constants and PrimOps
Simon Marlow [Thu, 15 Oct 2009 11:51:20 +0000 (11:51 +0000)]
Add some manual dependencies, and -fforce-recomp for Constants and PrimOps
GHC's recompilation checker doesn't take into account #included files,
which is really a bug.  We work around it here by adding dependencies
and using -fforce-recomp in a couple of places.

12 years agoFix Trac #959: a long-standing bug in instantiating otherwise-unbound type variables
simonpj@microsoft.com [Thu, 15 Oct 2009 12:28:10 +0000 (12:28 +0000)]
Fix Trac #959: a long-standing bug in instantiating otherwise-unbound type variables

   DO NOT MERGE TO GHC 6.12 branch
   (Reason: interface file format change.)

The typechecker needs to instantiate otherwise-unconstraint type variables to
an appropriately-kinded constant type, but we didn't have a supply of
arbitrarily-kinded tycons for this purpose.  Now we do.

The details are described in Note [Any types] in TysPrim.  The
fundamental change is that there is a new sort of TyCon, namely
AnyTyCon, defined in TyCon.

Ter's a small change to interface-file binary format, because the new
AnyTyCons have to be serialised.

I tided up the handling of uniques a bit too, so that mkUnique is not
exported, so that we can see all the different name spaces in one module.

12 years agoFix several missing dependencies in ifFreeNames
simonpj@microsoft.com [Thu, 15 Oct 2009 12:01:59 +0000 (12:01 +0000)]
Fix several missing dependencies in ifFreeNames

These missing dependencies led to:
  ghc-stage1: panic! (the 'impossible' happened)
  (GHC version 6.13 for x86_64-unknown-linux):
urk! lookup local fingerprint ghc-6.13:CgBindery.CgBindings{tc r4Z}

Simon and I don't quite understand why I've encountered these while
no one else has, but they are certainly bugs, and this patch certainly
fixes them.

Merge to 6.12 branch

12 years agoCorrect comment
simonpj@microsoft.com [Thu, 15 Oct 2009 11:55:46 +0000 (11:55 +0000)]
Correct comment

12 years agoFix Trac #3263: don't print Hpc tick stuff unless -dppr-debug is on
simonpj@microsoft.com [Thu, 15 Oct 2009 11:44:37 +0000 (11:44 +0000)]
Fix Trac #3263: don't print Hpc tick stuff unless -dppr-debug is on

In general, when pretty-printing HsSyn, we omit the extra info added by GHC
(type appplications and abstractions, etc) when printing stuff for the user.
But we weren't applying that guideline to the HsTick stuff for Hpc.  This
patch adds the necessary tests.

12 years agoAdd events to show when GC threads are idle/working
Simon Marlow [Thu, 15 Oct 2009 10:02:12 +0000 (10:02 +0000)]
Add events to show when GC threads are idle/working

12 years agooverlap checking of the black hole queue with waiting for GC threads
Simon Marlow [Thu, 15 Oct 2009 09:07:56 +0000 (09:07 +0000)]
overlap checking of the black hole queue with waiting for GC threads

12 years agoFix warnings
Roman Leshchinskiy [Thu, 15 Oct 2009 07:01:47 +0000 (07:01 +0000)]
Fix warnings

12 years agoDon't hardwire PA and PR dfuns in the vectoriser
Roman Leshchinskiy [Thu, 15 Oct 2009 05:37:40 +0000 (05:37 +0000)]
Don't hardwire PA and PR dfuns in the vectoriser

Instead, we simply find all available PA and PR instances and get our dfuns
from those.

12 years agoPA and PR from dph are now type classes
Roman Leshchinskiy [Thu, 15 Oct 2009 03:08:05 +0000 (03:08 +0000)]
PA and PR from dph are now type classes

This is a fairly big change to the vectoriser in preparation to Simon's inline
patch.

12 years agoFix FFI declaration checks
Simon Marlow [Wed, 14 Oct 2009 14:01:28 +0000 (14:01 +0000)]
Fix FFI declaration checks
For GHCi, foreign labels should be allowed, but foreign export should
be disallowed; both were previously wrong.

12 years agomicro-opt: replace stmGetEnclosingTRec() with a field access
Simon Marlow [Wed, 14 Oct 2009 13:17:27 +0000 (13:17 +0000)]
micro-opt: replace stmGetEnclosingTRec() with a field access
While fixing #3578 I noticed that this function was just a field
access to StgTRecHeader, so I inlined it manually.

12 years agoFix #3578: return a dummy result when an STM transaction is aborted
Simon Marlow [Wed, 14 Oct 2009 13:16:19 +0000 (13:16 +0000)]
Fix #3578: return a dummy result when an STM transaction is aborted
(see comment for details)

12 years agoFixes for cross-compiling to a different word size
Simon Marlow [Wed, 14 Oct 2009 13:06:12 +0000 (13:06 +0000)]
Fixes for cross-compiling to a different word size
This patch eliminates a couple of places where we were assuming that
the host word size is the same as the target word size.

Also a little refactoring: Constants now exports the types TargetInt
and TargetWord corresponding to the Int/Word type on the target
platform, and I moved the definitions of tARGET_INT_MAX and friends
from Literal to Constants.

Thanks to Barney Stratford <barney_stratford@fastmail.fm> for helping
track down the problem and fix it.  We now know that GHC can
successfully cross-compile from 32-bit to 64-bit.

12 years agoFix #3579: avoid clashing with names of implicit bindings
Simon Marlow [Wed, 14 Oct 2009 09:51:53 +0000 (09:51 +0000)]
Fix #3579: avoid clashing with names of implicit bindings

12 years agoNew flag -dsuppress-coercions to avoid printing coercions in Core dumps
Roman Leshchinskiy [Wed, 14 Oct 2009 00:30:58 +0000 (00:30 +0000)]
New flag -dsuppress-coercions to avoid printing coercions in Core dumps

12 years agoFix install when various DOC variables are empty
Ian Lynagh [Tue, 13 Oct 2009 10:15:30 +0000 (10:15 +0000)]
Fix install when various DOC variables are empty

12 years agoFix install when INSTALL_LIBEXEC_SCRIPTS = ""
Ian Lynagh [Tue, 13 Oct 2009 09:52:43 +0000 (09:52 +0000)]
Fix install when INSTALL_LIBEXEC_SCRIPTS = ""

12 years agoFix install when INSTALL_LIBEXECS = ""
Ian Lynagh [Tue, 13 Oct 2009 09:39:17 +0000 (09:39 +0000)]
Fix install when INSTALL_LIBEXECS = ""
This is the case on Windows (as we have no shell wrappers), and mingw's
shell doesn't like an empty list of things in a "for" command.

12 years agoDocument that lazy I/O now throws exceptions
Simon Marlow [Mon, 12 Oct 2009 15:42:13 +0000 (15:42 +0000)]
Document that lazy I/O now throws exceptions

12 years agofindSpark: exit if there's a returning foreign call
Simon Marlow [Fri, 9 Oct 2009 15:29:20 +0000 (15:29 +0000)]
findSpark: exit if there's a returning foreign call

12 years agoThe -e flag now has a "SepArg" argument; fixes #3568
Ian Lynagh [Mon, 12 Oct 2009 13:49:23 +0000 (13:49 +0000)]
The -e flag now has a "SepArg" argument; fixes #3568
This means -e must be separated from its argument by a space.
It therefore doesn't try to parse "-exclude-module" as
"execute xclude-module".

12 years agoPrint warnings after doMkDependHS
Ian Lynagh [Mon, 12 Oct 2009 13:26:11 +0000 (13:26 +0000)]
Print warnings after doMkDependHS
We weren't printing any warning for a commandline like
    ghc -M Foo.hs -optdep--exclude-module=Bar -fffi
but the last 2 flags are both deprecated.

12 years agoremove duplicate entry for -fwarn-unused-do-bind (#3576)
Simon Marlow [Mon, 12 Oct 2009 11:02:16 +0000 (11:02 +0000)]
remove duplicate entry for -fwarn-unused-do-bind (#3576)

12 years agofix markup
Simon Marlow [Mon, 12 Oct 2009 08:36:56 +0000 (08:36 +0000)]
fix markup

12 years agoRetry pulling from our own spark pool if there was a collision
Simon Marlow [Wed, 7 Oct 2009 12:50:31 +0000 (12:50 +0000)]
Retry pulling from our own spark pool if there was a collision

12 years agoInstall libHSffi_p.a
Ian Lynagh [Mon, 12 Oct 2009 10:19:52 +0000 (10:19 +0000)]
Install libHSffi_p.a

12 years agoMore README updates
Ian Lynagh [Mon, 12 Oct 2009 09:51:42 +0000 (09:51 +0000)]
More README updates

12 years agoUpdate the README instructions for getting the source
Ian Lynagh [Mon, 12 Oct 2009 09:43:25 +0000 (09:43 +0000)]
Update the README instructions for getting the source