ghc-hetmet.git
12 years agoFix an nasty black hole, concerning computation of isRecursiveTyCon
simonpj@microsoft.com [Mon, 30 Mar 2009 08:49:12 +0000 (08:49 +0000)]
Fix an nasty black hole, concerning computation of isRecursiveTyCon

Fixing #246 (pattern-match order in record patterns) made GHC go into
a black hole, by changing the order of patterm matching in
TyCon.isProductTyCon!  It turned out that GHC had been avoiding the
black hole only by the narrowest of margins up to now!

The black hole concerned the computation of which type constructors
are recursive, in TcTyDecls.calcRecFlags.  We now refrain from using
isProductTyCon there, since it triggers the black hole (very
indirectly).  See the "YUK YUK" comment in the body of calcRecFlags.

As it turns out, the fact that TyCon.isProductTyCon matched on the
algTcRec field was quite redundant, so I removed that too.  However,
without the fix to calcRecFlags, this wouldn't fix the black hole
because of the use of isRecursiveTyCon in BuildTyCl.mkNewTyConRhs.

Anyway, it's fine now.

12 years agoAdd an extra print to -ddump-tc-trace
simonpj@microsoft.com [Mon, 30 Mar 2009 08:48:35 +0000 (08:48 +0000)]
Add an extra print to -ddump-tc-trace

12 years agoRemove dead code (dataConsStupidTheta)
simonpj@microsoft.com [Mon, 30 Mar 2009 08:47:39 +0000 (08:47 +0000)]
Remove dead code (dataConsStupidTheta)

12 years agoFix Trac #246: order of matching in record patterns
simonpj@microsoft.com [Mon, 30 Mar 2009 08:37:36 +0000 (08:37 +0000)]
Fix Trac #246: order of matching in record patterns

While I was looking at the desugaring of pattern matching (fixing
Trac #3126) I finally got around to fixing another long-standing bug:
when matching in a record pattern, GHC should match left-to-right in
the programmer-specfied order, *not* left-to-right positionally in
the original record declaration.

Needless to say, that requires a little more code.
See Note [Record patterns] in MatchCon.lhs

12 years agoFix Trac #3126: matching overloaded literals
simonpj@microsoft.com [Mon, 30 Mar 2009 08:34:35 +0000 (08:34 +0000)]
Fix Trac #3126: matching overloaded literals

Claus Reinke uncovered a long-standing bug in GHC, whereby we were
combining the pattern-match on overloaded literals, missing the fact
that an intervening pattern (for a different literal) might also
match.  (If someone had a very odd implementation of fromInteger!)

See Note [Grouping overloaded literal patterns] in Match.lhs

If this merges smoothly to 6.10, go for it, but it's very much
a corner case.

Thank you Claus!

12 years agoWhite space cosmetics only
simonpj@microsoft.com [Mon, 30 Mar 2009 08:31:03 +0000 (08:31 +0000)]
White space cosmetics only

12 years agoImprove mkDupableCont; and fix Trac #3116
simonpj@microsoft.com [Wed, 25 Mar 2009 09:52:05 +0000 (09:52 +0000)]
Improve mkDupableCont; and fix Trac #3116

It turns out that, as a result of a change I made a few months ago to
the representation of SimplCont, it's easy to solve the optimisation
challenge posed by Trac #3116.  Hurrah.

Extensive comments in Note [Duplicating StrictArg].

12 years agoAvoid quadratic complexity in occurrence analysis (fix Trac #1969)
simonpj@microsoft.com [Mon, 23 Mar 2009 10:38:26 +0000 (10:38 +0000)]
Avoid quadratic complexity in occurrence analysis (fix Trac #1969)

  The occurrence analyser could go out to lunch in bad cases, because
  of its clever loop-breaking algorithm. This patch makes it bale out
  in bad cases.  Somewhat ad-hoc: a nicer solution would be welcome.

  See Note [Complexity of loop breaking] for the details.

12 years agoImprove arity propagation in the specialiser
simonpj@microsoft.com [Mon, 23 Mar 2009 10:16:14 +0000 (10:16 +0000)]
Improve arity propagation in the specialiser

This patch makes the specialiser propagate arities a bit more
eagerly, which avoids a spurious warning in the simplifier.

See Note [Arity decrease] in Simplify.lhs

12 years agocheck for ThreadRelocated in checkBlackHoles()
Simon Marlow [Thu, 26 Mar 2009 14:03:43 +0000 (14:03 +0000)]
check for ThreadRelocated in checkBlackHoles()

12 years agosyb no longer needs to be wired in
Ian Lynagh [Thu, 26 Mar 2009 13:05:17 +0000 (13:05 +0000)]
syb no longer needs to be wired in

12 years agoTemplate Haskell: added bang patterns
Manuel M T Chakravarty [Thu, 26 Mar 2009 10:02:08 +0000 (10:02 +0000)]
Template Haskell: added bang patterns

12 years agoTemplate Haskell: support for kind annotations
Manuel M T Chakravarty [Thu, 26 Mar 2009 08:55:20 +0000 (08:55 +0000)]
Template Haskell: support for kind annotations

12 years agoupdate list of C math functions
Bertram Felgenhauer [Mon, 23 Mar 2009 18:36:30 +0000 (18:36 +0000)]
update list of C math functions
Fix via C compilation of modules that import, say, log1p from math.h (#3117)

The list is based on preprocessing Stg.h with glibc 2.6.1 headers, and
cross-checked with the ISO C 99 standard (draft).

12 years agoTemplate Haskell: make reify aware of type families
Manuel M T Chakravarty [Wed, 25 Mar 2009 03:34:47 +0000 (03:34 +0000)]
Template Haskell: make reify aware of type families
- Reifying a type family returns a TH family declaration
- Reifying a data constructor from a data instance attributes that
  constructor to the family (not the representation tycon)
- Ideally, we should have facilities to reify all type/data instances of a
  given family (and the same for instances of a class).  I haven't added that
  here as it involves some API design.

12 years agoTemplate Haskell: support for INLINE and SPECIALISE pragmas
Manuel M T Chakravarty [Tue, 24 Mar 2009 23:29:40 +0000 (23:29 +0000)]
Template Haskell: support for INLINE and SPECIALISE pragmas

12 years agofix an fprintf that should be fputs (quiets gcc)
Simon Marlow [Sun, 22 Mar 2009 19:54:41 +0000 (19:54 +0000)]
fix an fprintf that should be fputs (quiets gcc)

12 years agocheck return value of write (quiets gcc)
Simon Marlow [Sun, 22 Mar 2009 19:53:19 +0000 (19:53 +0000)]
check return value of write (quiets gcc)

12 years agoFix locking in evacuate_large() (FIX openfile008(threaded2))
Simon Marlow [Mon, 23 Mar 2009 09:29:53 +0000 (09:29 +0000)]
Fix locking in evacuate_large() (FIX openfile008(threaded2))

12 years agoPlease the -Wall police by moving a variable declaration; really FIX getNumberOfProce...
Austin Seipp [Fri, 20 Mar 2009 12:48:46 +0000 (12:48 +0000)]
Please the -Wall police by moving a variable declaration; really FIX getNumberOfProcessors() for MacOS X

12 years agowibble in setExecutable
Austin Seipp [Fri, 20 Mar 2009 12:00:43 +0000 (12:00 +0000)]
wibble in setExecutable

12 years agoFIX getNumberOfProcessors() on MacOS X
Austin Seipp [Wed, 18 Mar 2009 02:31:27 +0000 (02:31 +0000)]
FIX getNumberOfProcessors() on MacOS X

This checks if darwin_HOST_OS is defined and, if so, we call
sysctlbyname() on the "hw.ncpu" property to get the processor count.

12 years agoWork around Solaris's grep not supporting -q
Ian Lynagh [Thu, 19 Mar 2009 17:15:01 +0000 (17:15 +0000)]
Work around Solaris's grep not supporting -q

12 years agoSome wording wibbles from Thorkil
Ian Lynagh [Thu, 19 Mar 2009 16:59:16 +0000 (16:59 +0000)]
Some wording wibbles from Thorkil

12 years agoFix bug in setThreadAffinity() (Linux)
Simon Marlow [Fri, 20 Mar 2009 10:04:46 +0000 (10:04 +0000)]
Fix bug in setThreadAffinity() (Linux)

12 years agoImplement setThreadAffinity for Mac OS X (from 10.5)
Manuel M T Chakravarty [Fri, 20 Mar 2009 07:13:47 +0000 (07:13 +0000)]
Implement setThreadAffinity for Mac OS X (from 10.5)

12 years agoFix warnings with older versions of gcc (3.4.5)
Simon Marlow [Thu, 19 Mar 2009 12:49:32 +0000 (12:49 +0000)]
Fix warnings with older versions of gcc (3.4.5)

12 years agowibble for getNumberOfProcessors
Simon Marlow [Wed, 18 Mar 2009 16:59:36 +0000 (16:59 +0000)]
wibble for getNumberOfProcessors

12 years agoSet thread affinity with +RTS -qa (only on Linux so far)
Simon Marlow [Wed, 18 Mar 2009 15:47:19 +0000 (15:47 +0000)]
Set thread affinity with +RTS -qa (only on Linux so far)

12 years agoTemplate Haskell support for equality constraints
Manuel M T Chakravarty [Thu, 19 Mar 2009 13:23:47 +0000 (13:23 +0000)]
Template Haskell support for equality constraints

12 years agoadd missing case in ENTER() (fixes readwrite002(profasm) crash)
Simon Marlow [Thu, 19 Mar 2009 10:21:26 +0000 (10:21 +0000)]
add missing case in ENTER() (fixes readwrite002(profasm) crash)

12 years agoFIX unregisterised build
Simon Marlow [Thu, 19 Mar 2009 10:09:54 +0000 (10:09 +0000)]
FIX unregisterised build

12 years agoTemplate Haskell: support for type family declarations
Manuel M T Chakravarty [Thu, 19 Mar 2009 08:43:06 +0000 (08:43 +0000)]
Template Haskell: support for type family declarations

12 years agoComment explaining use of seq in DFMonad
dias@eecs.tufts.edu [Wed, 18 Mar 2009 21:01:38 +0000 (21:01 +0000)]
Comment explaining use of seq in DFMonad

12 years agoFIX unregisterised target by #ifdefing targetPlatform stuff
Simon Marlow [Wed, 18 Mar 2009 15:12:55 +0000 (15:12 +0000)]
FIX unregisterised target by #ifdefing targetPlatform stuff
I'm not sure if this is the correct fix.  If targetPlatform is really
NCG-specific, then maybe we should call it asmTargetPlatform or
something.

12 years agoRemoved a trace
dias@eecs.tufts.edu [Wed, 18 Mar 2009 15:13:43 +0000 (15:13 +0000)]
Removed a trace

12 years agoCalling convention bug and cleanup
dias@eecs.tufts.edu [Tue, 17 Mar 2009 20:42:38 +0000 (20:42 +0000)]
Calling convention bug and cleanup
- yet another wrong calling convention; this one was a special case for returning one
  value.

12 years agoInconsistent type and arguments in safe foreign calls...
dias@eecs.tufts.edu [Mon, 16 Mar 2009 21:46:54 +0000 (21:46 +0000)]
Inconsistent type and arguments in safe foreign calls...
- The function argument was stripped from the argument list but not from the type.
  Now they're both stripped.

12 years agostack overflows and out of memory's
dias@eecs.tufts.edu [Mon, 16 Mar 2009 21:35:06 +0000 (21:35 +0000)]
stack overflows and out of memory's
1. Stack overflow fixed by making dataflow monad strict in the state.
2. Out of memory fixed by "forgetting" lastoutfacts in the dataflow monad
   where we should. We were creating an unnecessarily long list that grew
   exponentially...

12 years agoAdd the notion of "constructor-like" Ids for rule-matching
simonpj@microsoft.com [Wed, 18 Mar 2009 10:59:11 +0000 (10:59 +0000)]
Add the notion of "constructor-like" Ids for rule-matching

This patch adds an optional CONLIKE modifier to INLINE/NOINLINE pragmas,
   {-# NOINLINE CONLIKE [1] f #-}
The effect is to allow applications of 'f' to be expanded in a potential
rule match.  Example
  {-# RULE "r/f" forall v. r (f v) = f (v+1) #-}

Consider the term
     let x = f v in ..x...x...(r x)...
Normally the (r x) would not match the rule, because GHC would be scared
about duplicating the redex (f v). However the CONLIKE modifier says to
treat 'f' like a constructor in this situation, and "look through" the
unfolding for x.  So (r x) fires, yielding (f (v+1)).

The main changes are:
  - Syntax

  - The inlinePragInfo field of an IdInfo has a RuleMatchInfo
    component, which records whether or not the Id is CONLIKE.
    Of course, this needs to be serialised in interface files too.

  - The occurrence analyser (OccAnal) and simplifier (Simplify) treat
    CONLIKE thing like constructors, by ANF-ing them

  - New function coreUtils.exprIsExpandable is like exprIsCheap, but
    additionally spots applications of CONLIKE functions

  - A CoreUnfolding has a field that caches exprIsExpandable

  - The rule matcher consults this field.  See
    Note [Expanding variables] in Rules.lhs.

On the way I fixed a lurking variable bug in the way variables are
expanded.  See Note [Do not expand locally-bound variables] in
Rule.lhs.  I also did a bit of reformatting and refactoring in
Rules.lhs, so the module has more lines changed than are really
different.

12 years agoFixes to "Retract Hp *before* checking for HpLim==0"
Simon Marlow [Wed, 18 Mar 2009 11:18:47 +0000 (11:18 +0000)]
Fixes to "Retract Hp *before* checking for HpLim==0"

12 years agoAdd fast event logging
Simon Marlow [Tue, 17 Mar 2009 16:42:14 +0000 (16:42 +0000)]
Add fast event logging

Generate binary log files from the RTS containing a log of runtime
events with timestamps.  The log file can be visualised in various
ways, for investigating runtime behaviour and debugging performance
problems.  See for example the forthcoming ThreadScope viewer.

New GHC option:

  -eventlog   (link-time option) Enables event logging.

  +RTS -l     (runtime option) Generates <prog>.eventlog with
              the binary event information.

This replaces some of the tracing machinery we already had in the RTS:
e.g. +RTS -vg  for GC tracing (we should do this using the new event
logging instead).

Event logging has almost no runtime cost when it isn't enabled, though
in the future we might add more fine-grained events and this might
change; hence having a link-time option and compiling a separate
version of the RTS for event logging.  There's a small runtime cost
for enabling event-logging, for most programs it shouldn't make much
difference.

(Todo: docs)

12 years agoFIX biographical profiling (#3039, probably #2297)
Simon Marlow [Tue, 17 Mar 2009 14:49:39 +0000 (14:49 +0000)]
FIX biographical profiling (#3039, probably #2297)
Since we introduced pointer tagging, we no longer always enter a
closure to evaluate it.  However, the biographical profiler relies on
closures being entered in order to mark them as "used", so we were
getting spurious amounts of data attributed to VOID.  It turns out
there are various places that need to be fixed, and I think at least
one of them was also wrong before pointer tagging (CgCon.cgReturnDataCon).

12 years agoAdd getNumberOfProcessors(), FIX MacOS X build problem (hopefully)
Simon Marlow [Tue, 17 Mar 2009 09:33:09 +0000 (09:33 +0000)]
Add getNumberOfProcessors(), FIX MacOS X build problem (hopefully)
Somebody needs to implement getNumberOfProcessors() for MacOS X,
currently it will return 1.

12 years agoFIX #3093: stub filenames when using -osuf
Simon Marlow [Mon, 16 Mar 2009 20:34:37 +0000 (20:34 +0000)]
FIX #3093: stub filenames when using -osuf
Also remove some unused cruft

12 years agoDon't call processHeapClosureForDead on pinned blocks
Simon Marlow [Mon, 16 Mar 2009 16:05:34 +0000 (16:05 +0000)]
Don't call processHeapClosureForDead on pinned blocks
Fixes heapprof001(prof_hp) after fix for #2917

12 years agoRetract Hp *before* checking for HpLim==0
Simon Marlow [Mon, 16 Mar 2009 16:05:00 +0000 (16:05 +0000)]
Retract Hp *before* checking for HpLim==0
Fixes heapprof001(prof_hp) following the recent HpLim patch, which
depended on the lack of slop in the heap.

12 years agoeliminate some not-quite-duplicate code
Simon Marlow [Fri, 13 Mar 2009 15:56:19 +0000 (15:56 +0000)]
eliminate some not-quite-duplicate code

12 years agostart finalizers on the current Capability rather than last_free_capability
Simon Marlow [Fri, 13 Mar 2009 15:56:02 +0000 (15:56 +0000)]
start finalizers on the current Capability rather than last_free_capability

12 years agocope with ThreadRelocated on the sleeping_queue
Simon Marlow [Tue, 17 Feb 2009 13:27:57 +0000 (13:27 +0000)]
cope with ThreadRelocated on the sleeping_queue

12 years agoFix Trac #3095, and make RdrHsSyn warning-clean
simonpj@microsoft.com [Mon, 16 Mar 2009 17:47:06 +0000 (17:47 +0000)]
Fix Trac #3095, and make RdrHsSyn warning-clean

12 years agoLayout only
simonpj@microsoft.com [Mon, 16 Mar 2009 16:46:19 +0000 (16:46 +0000)]
Layout only

12 years agoReject foralls in constructor args in 'deriving', except for Functor etc
simonpj@microsoft.com [Mon, 16 Mar 2009 16:45:02 +0000 (16:45 +0000)]
Reject foralls in constructor args in 'deriving', except for Functor etc

12 years agoFix Trac #3092
simonpj@microsoft.com [Mon, 16 Mar 2009 16:40:49 +0000 (16:40 +0000)]
Fix Trac #3092

We were't checking that a 'data/type instance' was extending a family
type constructor.

Merge to 6.10 if we ever release 6.10.3 (or do it for 6.10.2).

12 years agoEnsure the orientation of var-var equalities is correct for instatiation
Manuel M T Chakravarty [Sun, 15 Mar 2009 06:57:09 +0000 (06:57 +0000)]
Ensure the orientation of var-var equalities is correct for instatiation
- During fianlisation we use to occasionally swivel variable-variable equalities
- Now, normalisation ensures that they are always oriented as appropriate for
  instantation.
- Also fixed #1899 properly; the previous fix fixed a symptom, not the cause.

12 years agoUse work-stealing for load-balancing in the GC
Simon Marlow [Fri, 13 Mar 2009 13:51:16 +0000 (13:51 +0000)]
Use work-stealing for load-balancing in the GC

New flag: "+RTS -qb" disables load-balancing in the parallel GC
(though this is subject to change, I think we will probably want to do
something more automatic before releasing this).

To get the "PARGC3" configuration described in the "Runtime support
for Multicore Haskell" paper, use "+RTS -qg0 -qb -RTS".

The main advantage of this is that it allows us to easily disable
load-balancing altogether, which turns out to be important in parallel
programs.  Maintaining locality is sometimes more important that
spreading the work out in parallel GC.  There is a side benefit in
that the parallel GC should have improved locality even when
load-balancing, because each processor prefers to take work from its
own queue before stealing from others.

12 years agoFix Trac #3087: derived Data now defines dataCast1/2
simonpj@microsoft.com [Fri, 13 Mar 2009 13:44:36 +0000 (13:44 +0000)]
Fix Trac #3087: derived Data now defines dataCast1/2

This patch generates code in deriving(Data) for dataCast1 or 2 as
appropriate.

While I was there I did some refactoring (of course), pulling out
the TcDeriv.inferConstraints as a separate function.

I don't think it's worth merging this to 6.10.2, even though it's a bugfix,
because it modifies code that I added in the HEAD only (for deriving Functor)
so the merge will be sligtly awkward.  And there's an easy workaround.

12 years agoAdjust error message slightly to make it clearer
simonpj@microsoft.com [Fri, 13 Mar 2009 13:44:02 +0000 (13:44 +0000)]
Adjust error message slightly to make it clearer

12 years agojust comment formatting
Simon Marlow [Fri, 13 Mar 2009 13:23:39 +0000 (13:23 +0000)]
just comment formatting

12 years agoAdd "+RTS -N" to determine the -N value automatically (see #1741)
Simon Marlow [Fri, 13 Mar 2009 11:46:46 +0000 (11:46 +0000)]
Add "+RTS -N" to determine the -N value automatically (see #1741)

12 years agotidy up "missing symbol" error message
Simon Marlow [Fri, 13 Mar 2009 10:13:34 +0000 (10:13 +0000)]
tidy up "missing symbol" error message

12 years agoFix sanity checking after fix to #2917
Simon Marlow [Thu, 12 Mar 2009 09:38:55 +0000 (09:38 +0000)]
Fix sanity checking after fix to #2917

12 years agoInstead of a separate context-switch flag, set HpLim to zero
Simon Marlow [Fri, 13 Mar 2009 10:45:16 +0000 (10:45 +0000)]
Instead of a separate context-switch flag, set HpLim to zero
This reduces the latency between a context-switch being triggered and
the thread returning to the scheduler, which in turn should reduce the
cost of the GC barrier when there are many cores.

We still retain the old context_switch flag which is checked at the
end of each block of allocation.  The idea is that setting HpLim may
fail if the the target thread is modifying HpLim at the same time; the
context_switch flag is a fallback.  It also allows us to "context
switch soon" without forcing an immediate switch, which can be costly.

12 years agoFIX #3079, dodgy parsing of LANGUAGE pragmas 2009-03-13
Simon Marlow [Thu, 12 Mar 2009 14:11:03 +0000 (14:11 +0000)]
FIX #3079, dodgy parsing of LANGUAGE pragmas
I ended up rewriting this horrible bit of code, using (yikes) lazy I/O
to slurp in the source file a chunk at a time.  The old code tried to
read the file a chunk at a time, but failed with LANGUAGE pragmas
because the parser for LANGUAGE has state and the state wasn't being
saved between chunks.  We're still closing the Handle eagerly, so
there shouldn't be any problems here.

12 years agoavoid a crash: don't return unless the run queue has some threads in it
Simon Marlow [Wed, 11 Mar 2009 15:45:59 +0000 (15:45 +0000)]
avoid a crash: don't return unless the run queue has some threads in it

12 years agoAllocate the right number of words in new*PinnedByteArrayzh_fast
Ian Lynagh [Wed, 11 Mar 2009 16:06:15 +0000 (16:06 +0000)]
Allocate the right number of words in new*PinnedByteArrayzh_fast

12 years agoFIX #2816 (correct unicode output for :type/:kind)
Simon Marlow [Wed, 11 Mar 2009 11:23:11 +0000 (11:23 +0000)]
FIX #2816 (correct unicode output for :type/:kind)
This is just a hack, since we don't have correct unicode output for
Handles in general, I just fixed a couple of places where we were not
converting to UTF-8 for output.

12 years agoFix #2992: don't create a named event
Simon Marlow [Wed, 11 Mar 2009 09:42:08 +0000 (09:42 +0000)]
Fix #2992: don't create a named event
Evidently I misread the docs for CreateEvent: if you pass a name to
CreateEvent, then it creates a single shared system-wide Event with
that name.  So all Haskell processes on the machine were sharing the
same Event object.  duh.

12 years agoFIX #2832: Setting SplitObjs=NO doesn't disable -split-objs in GHC
Simon Marlow [Wed, 11 Mar 2009 11:00:58 +0000 (11:00 +0000)]
FIX #2832: Setting SplitObjs=NO doesn't disable -split-objs in GHC
Now ghc --info reports whether-split-objs is supported, rather than
whether the libraries were built using -split-objs.

12 years agoFIX #2976: fix buggy implementation of shadowing in GHC.getBindings
Simon Marlow [Wed, 11 Mar 2009 10:20:07 +0000 (10:20 +0000)]
FIX #2976: fix buggy implementation of shadowing in GHC.getBindings

12 years agoDon't put a trailing / on the mingw include path
Ian Lynagh [Tue, 10 Mar 2009 17:22:42 +0000 (17:22 +0000)]
Don't put a trailing / on the mingw include path

12 years agoFix a bug which sometimes caused extra major GCs to be performed
Simon Marlow [Mon, 9 Mar 2009 14:00:04 +0000 (14:00 +0000)]
Fix a bug which sometimes caused extra major GCs to be performed
A long-running GC would cause the timer signal to declare the system
to be idle, which would cause a major GC immediately following the
current GC.  This only happened with +RTS -N2 or greater.

12 years agoRedesign 64-bit HEAP_ALLOCED (FIX #2934 at the same time)
Simon Marlow [Mon, 9 Mar 2009 12:13:00 +0000 (12:13 +0000)]
Redesign 64-bit HEAP_ALLOCED (FIX #2934 at the same time)

After much experimentation, I've found a formulation for HEAP_ALLOCED
that (a) improves performance, and (b) doesn't have any race
conditions when used concurrently.  GC performance on x86_64 should be
improved slightly.  See extensive comments in MBlock.h for the
details.

12 years agoPartial fix for #2917
Simon Marlow [Fri, 6 Mar 2009 10:00:18 +0000 (10:00 +0000)]
Partial fix for #2917

 - add newAlignedPinnedByteArray# for allocating pinned BAs with
   arbitrary alignment

 - the old newPinnedByteArray# now aligns to 16 bytes

Foreign.alloca will use newAlignedPinnedByteArray#, and so might end
up wasting less space than before (we used to align to 8 by default).
Foreign.allocaBytes and Foreign.mallocForeignPtrBytes will get 16-byte
aligned memory, which is enough to avoid problems with SSE
instructions on x86, for example.

There was a bug in the old newPinnedByteArray#: it aligned to 8 bytes,
but would have failed if the header was not a multiple of 8
(fortunately it always was, even with profiling).  Also we
occasionally wasted some space unnecessarily due to alignment in
allocatePinned().

I haven't done anything about Foreign.malloc/mallocBytes, which will
give you the same alignment guarantees as malloc() (8 bytes on
Linux/x86 here).

12 years agoDon't force HSCOLOUR_SRCS = YES when validating
Ian Lynagh [Sun, 8 Mar 2009 17:16:33 +0000 (17:16 +0000)]
Don't force HSCOLOUR_SRCS = YES when validating
This removes a burden from developers, and I can't remember an
occasion where it would have caught a regression.

12 years agoAdd CONTRACT to the pragmas that we recognise.
Ian Lynagh [Fri, 6 Mar 2009 19:48:26 +0000 (19:48 +0000)]
Add CONTRACT to the pragmas that we recognise.
It's used by ESC/Haskell.

12 years agoGenerate lots of __inline_me during vectorisation
Roman Leshchinskiy [Sat, 7 Mar 2009 13:56:52 +0000 (13:56 +0000)]
Generate lots of __inline_me during vectorisation

12 years agoSpecial-case desugaring of simple parallel array comprehensions
Roman Leshchinskiy [Sat, 7 Mar 2009 13:40:49 +0000 (13:40 +0000)]
Special-case desugaring of simple parallel array comprehensions

12 years agoMake LDV_FILL_SLOP use a forwards loop rather than a backwards loop
Ian Lynagh [Fri, 6 Mar 2009 15:51:24 +0000 (15:51 +0000)]
Make LDV_FILL_SLOP use a forwards loop rather than a backwards loop

12 years agoFix warning
Roman Leshchinskiy [Fri, 6 Mar 2009 12:36:45 +0000 (12:36 +0000)]
Fix warning

12 years agoTry not to avoid vectorising purely scalar functions
Roman Leshchinskiy [Fri, 6 Mar 2009 11:55:08 +0000 (11:55 +0000)]
Try not to avoid vectorising purely scalar functions

12 years agoPackage dph needs to be cleaned in stage=1, too
Manuel M T Chakravarty [Fri, 6 Mar 2009 03:16:28 +0000 (03:16 +0000)]
Package dph needs to be cleaned in stage=1, too

12 years agoAdd --version to runghc. Trac #2757.
Ian Lynagh [Thu, 5 Mar 2009 16:20:45 +0000 (16:20 +0000)]
Add --version to runghc. Trac #2757.
We use the GHC version number, as the old runghc one doesn't seem very
useful.

12 years agoadd final newlines
Simon Marlow [Thu, 5 Mar 2009 14:00:14 +0000 (14:00 +0000)]
add final newlines
My Windows build has started complaining about lacking final newlines,
I'm not entirely sure why.

12 years agoremove foo.exe.manifest when --embed-manifest is on
Simon Marlow [Thu, 5 Mar 2009 11:27:26 +0000 (11:27 +0000)]
remove foo.exe.manifest when --embed-manifest is on

12 years agoadd --with-ld=c:/mingw/bin/ld
Simon Marlow [Thu, 5 Mar 2009 11:26:18 +0000 (11:26 +0000)]
add --with-ld=c:/mingw/bin/ld

12 years agoDocument -fwarn-unrecognised-pragmas; fixes trac #3031
Ian Lynagh [Thu, 5 Mar 2009 14:31:28 +0000 (14:31 +0000)]
Document -fwarn-unrecognised-pragmas; fixes trac #3031

12 years agoOn OS X/x86, tell gcc to generate instructions for i686. Fixes trac #2983.
Ian Lynagh [Thu, 5 Mar 2009 14:20:50 +0000 (14:20 +0000)]
On OS X/x86, tell gcc to generate instructions for i686. Fixes trac #2983.
By default, gcc on OS X will generate SSE instructions, which need
things 16-byte aligned, but we don't 16-byte align things. Thus drop
back to generic i686 compatibility.

12 years agoBy default, only HsColour the docs if we find HsColour. Fixes trac #3004.
Ian Lynagh [Thu, 5 Mar 2009 13:27:23 +0000 (13:27 +0000)]
By default, only HsColour the docs if we find HsColour. Fixes trac #3004.
If you manually set HSCOLOUR_SRCS=YES then the build will fail if
HsColour wasn't found.

12 years agoMake -fdicts-cheap cope with implication constraints
simonpj@microsoft.com [Thu, 5 Mar 2009 13:44:47 +0000 (13:44 +0000)]
Make -fdicts-cheap cope with implication constraints

See the Note [Dictionary-like types] in TcType for the full story here
Should only affect programs that use -fdicts-cheap, for
which you'll get better arities

12 years agoFinally fix Trac #3066
simonpj@microsoft.com [Thu, 5 Mar 2009 09:09:35 +0000 (09:09 +0000)]
Finally fix Trac #3066

This is a fix to
  Tue Mar  3 17:42:58 GMT 2009  simonpj@microsoft.com
    * Fix Trac #3066: checking argument types in foreign calls
which I embarassingly got wrong.

Have to be careful when expanding recursive newtypes.

Pls merge.

12 years agoFix a broken link. Spotted by Norman Ramsey in trac #3068.
Ian Lynagh [Wed, 4 Mar 2009 16:53:51 +0000 (16:53 +0000)]
Fix a broken link. Spotted by Norman Ramsey in trac #3068.

12 years agoFix spelling (Trac#3069)
simonpj@microsoft.com [Wed, 4 Mar 2009 09:22:32 +0000 (09:22 +0000)]
Fix spelling (Trac#3069)

12 years agoLayout only
simonpj@microsoft.com [Wed, 4 Mar 2009 09:19:56 +0000 (09:19 +0000)]
Layout only

12 years agoFix a long-standing latent bug (and the build): check res_ty not sig_ty
simonpj@microsoft.com [Wed, 4 Mar 2009 09:19:13 +0000 (09:19 +0000)]
Fix a long-standing latent bug (and the build): check res_ty not sig_ty

12 years agoFix #3067: GHCi panics with 'initTc:LIE' while :stepping on code with funny types
pepe iborra [Tue, 3 Mar 2009 19:37:06 +0000 (19:37 +0000)]
Fix #3067: GHCi panics with 'initTc:LIE' while :stepping on code with funny types

The problem is that calls to boxyUnify would panic if the types involved
contained type functions.
It looks like one should wrap these calls with getLIE, although I don't
really know what I am doing here

12 years agoFix Trac #3066: checking argument types in foreign calls
simonpj@microsoft.com [Tue, 3 Mar 2009 17:42:58 +0000 (17:42 +0000)]
Fix Trac #3066: checking argument types in foreign calls

When checking argument types in a foreign call we were stupidly
looking through foralls.  The fix is easy.

Merge to 6.10.2

12 years agoFix Trac #3057 in deriving Functor
simonpj@microsoft.com [Tue, 3 Mar 2009 17:06:12 +0000 (17:06 +0000)]
Fix Trac #3057 in deriving Functor

The universal type variables of a data constructor are not necessarily
identical to those of its parent type constructor, especially if the
data type is imported.

While I was at it, I did a significant refactoring to make all this
traversal of types more comprehensible, by adding the data type
FFoldType.

12 years agofix assertion failure with -debug non-threaded RTS (by deleting code!)
Simon Marlow [Tue, 3 Mar 2009 14:39:42 +0000 (14:39 +0000)]
fix assertion failure with -debug non-threaded RTS (by deleting code!)

12 years agoimprovements: generate LaTeX tables for more than one run
Simon Marlow [Tue, 3 Mar 2009 14:13:46 +0000 (14:13 +0000)]
improvements: generate LaTeX tables for more than one run