ghc-hetmet.git
14 years agoFix make for libffi again, properly this time
Duncan Coutts [Thu, 30 Apr 2009 22:55:46 +0000 (22:55 +0000)]
Fix make for libffi again, properly this time
No idea how the last patch managed to pass validate.

14 years agoFix parallel make for libffi.
Duncan Coutts [Thu, 30 Apr 2009 13:56:37 +0000 (13:56 +0000)]
Fix parallel make for libffi.
I didn't realise make can invoke the same action multiple
times in parallel if the rule has multiple targets. So go
back to using a build stamp file.

14 years agoFix linking shared libs with parallel make
Duncan Coutts [Thu, 30 Apr 2009 12:37:53 +0000 (12:37 +0000)]
Fix linking shared libs with parallel make
Unlike with static libs, when linking shared libs the dependencies
have to already exist. Add a dependency $1_$2_$3_LIBS : $1_$2_$3_DEPS_LIBS

14 years agoFix building Haskeline on Windows
Ian Lynagh [Thu, 30 Apr 2009 16:16:13 +0000 (16:16 +0000)]
Fix building Haskeline on Windows

14 years agoFix mkdependC: Make it tell cpp to use our temporary filename
Ian Lynagh [Thu, 30 Apr 2009 13:06:38 +0000 (13:06 +0000)]
Fix mkdependC: Make it tell cpp to use our temporary filename

14 years agoFIX build: add dependencies on ghc_boot_platform.h
Simon Marlow [Thu, 30 Apr 2009 10:02:45 +0000 (10:02 +0000)]
FIX build: add dependencies on ghc_boot_platform.h

14 years agoPrevent haddock docs being built when HADDOCK_DOCS=NO
Duncan Coutts [Wed, 29 Apr 2009 16:02:30 +0000 (16:02 +0000)]
Prevent haddock docs being built when HADDOCK_DOCS=NO

14 years agoClean up building of libffi for dynamic lib way
Duncan Coutts [Wed, 29 Apr 2009 15:30:02 +0000 (15:30 +0000)]
Clean up building of libffi for dynamic lib way
And depend on it at the top level when we're using dynamic libs.

14 years agoBuild library packages as shared libs
Duncan Coutts [Wed, 29 Apr 2009 15:15:53 +0000 (15:15 +0000)]
Build library packages as shared libs
when we configure ghc with --enable-shared

14 years agoBuild the rts as a shared lib correctly
Duncan Coutts [Wed, 29 Apr 2009 14:31:31 +0000 (14:31 +0000)]
Build the rts as a shared lib correctly
That is, build it as a .so/.dll rather than as libHSrts_dyn.a

14 years agoDon't actually build ghc itself with -dynamic
Duncan Coutts [Wed, 29 Apr 2009 14:29:40 +0000 (14:29 +0000)]
Don't actually build ghc itself with -dynamic
For now, with --enable-shared we'll build the libs shared,
but ghc itself will still be statically linked.
In any case, we would want to be able to build it both
ways so it's easy to test both.

14 years agoAdd a new $way_libsuf variable for library suffix+extension
Duncan Coutts [Tue, 28 Apr 2009 12:35:29 +0000 (12:35 +0000)]
Add a new $way_libsuf variable for library suffix+extension
This allows the library file type to depend on the way. This is needed
to use .so/.dll libs for the "dyn" way rather than always using .a libs.
For example: thr_debug_dyn_libsuf="_thr_debug-ghc6.11.20090426.so"

14 years agoextend the rules/c-objs macro to take the way as a parameter
Duncan Coutts [Tue, 28 Apr 2009 12:34:52 +0000 (12:34 +0000)]
extend the rules/c-objs macro to take the way as a parameter
Previously we only built library package "cbits" the vanilla way, afterall
C code does not need to be built differently for profiling builds. However
for dynamic libs the C code needs to be built with -fPIC, so we do need
to be able to build package .c (and .s?) files multiple ways.

14 years agoDo not link ghc stage1 using -threaded, only for stage2 or 3
Duncan Coutts [Tue, 28 Apr 2009 10:49:24 +0000 (10:49 +0000)]
Do not link ghc stage1 using -threaded, only for stage2 or 3
We link stage1 using the bootstrapping compiler and there's
no guarantee that it has working support for threaded

14 years agoTweak ghc-cabal
Ian Lynagh [Wed, 29 Apr 2009 18:37:28 +0000 (18:37 +0000)]
Tweak ghc-cabal

14 years agoAdd special support for haskeline
Ian Lynagh [Wed, 29 Apr 2009 18:19:09 +0000 (18:19 +0000)]
Add special support for haskeline
The library uses stuff in Setup.hs to determine whether or not it needs
to use -liconv. This patch replicates that logic in ghc-cabal. This
isn't pretty, and we should find a better way to do it, but it works
for now.

14 years agoIn mkdependC.prl, create temp files properly
Ian Lynagh [Wed, 29 Apr 2009 15:12:15 +0000 (15:12 +0000)]
In mkdependC.prl, create temp files properly
Avoids a race condition, where one run deletes/overwrites the temp file
of another.

14 years agoUse haskeline, rather than editline, for line editing in ghci
Ian Lynagh [Wed, 29 Apr 2009 00:58:38 +0000 (00:58 +0000)]
Use haskeline, rather than editline, for line editing in ghci

14 years agoFix error handling
Ian Lynagh [Tue, 28 Apr 2009 23:28:48 +0000 (23:28 +0000)]
Fix error handling
After the fix to #2500, we could get "Failing due to -Werror." but no
warnings printed. Now we don't fail in that case.

14 years agomove nofib settings here from ghc's config.mk
Simon Marlow [Tue, 28 Apr 2009 12:55:51 +0000 (12:55 +0000)]
move nofib settings here from ghc's config.mk

14 years agoadd missing eventlog subdir
Simon Marlow [Tue, 28 Apr 2009 12:55:28 +0000 (12:55 +0000)]
add missing eventlog subdir

14 years agomove runstdtest into nofib
Simon Marlow [Tue, 28 Apr 2009 12:45:05 +0000 (12:45 +0000)]
move runstdtest into nofib

14 years agoimprove the finalizer callback error message
Simon Marlow [Tue, 28 Apr 2009 08:53:45 +0000 (08:53 +0000)]
improve the finalizer callback error message

14 years agoAdd a header to all build system files:
Simon Marlow [Tue, 28 Apr 2009 08:52:33 +0000 (08:52 +0000)]
Add a header to all build system files:

# -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------

14 years agomore cleaning
Simon Marlow [Tue, 28 Apr 2009 08:49:19 +0000 (08:49 +0000)]
more cleaning

14 years agotodo updates
Simon Marlow [Mon, 27 Apr 2009 15:25:29 +0000 (15:25 +0000)]
todo updates

14 years agoremove commentary that is now in the wiki
Simon Marlow [Mon, 27 Apr 2009 14:47:43 +0000 (14:47 +0000)]
remove commentary that is now in the wiki

14 years agoremove ticket todos
Simon Marlow [Mon, 27 Apr 2009 14:44:06 +0000 (14:44 +0000)]
remove ticket todos

14 years agorequire gcc 3.0+ (see #2770)
Simon Marlow [Mon, 27 Apr 2009 13:43:22 +0000 (13:43 +0000)]
require gcc 3.0+ (see #2770)

14 years agoupdate build order comment
Simon Marlow [Mon, 27 Apr 2009 12:47:11 +0000 (12:47 +0000)]
update build order comment

14 years agoEquality constraint solver is now externally pure
Manuel M T Chakravarty [Mon, 27 Apr 2009 14:03:16 +0000 (14:03 +0000)]
Equality constraint solver is now externally pure
- This patch changes the equality constraint solver such that it does not
  instantiate any type variables that occur in the constraints that are to be
  solved (or in the environment).  Instead, it returns a bag of type bindings.
- If these type bindings (together with the other results of the solver) are
  discarded, solver invocation has no effect (outside the solver) and can be
  repeated (that's imported for TcSimplifyRestricted).
- For the type bindings to take effect, the caller of the solver needs to
  execute them.
- The solver will still instantiate type variables thet were created during
  solving (e.g., skolem flexibles used during type flattening).

  See also http://hackage.haskell.org/trac/ghc/wiki/TypeFunctionsSolving

14 years agoImprove the error message when we find a module in 2 places; trac #3183
Ian Lynagh [Sun, 26 Apr 2009 16:02:04 +0000 (16:02 +0000)]
Improve the error message when we find a module in 2 places; trac #3183

14 years agoRemove a comment (a bug to close, that has now been closed)
Ian Lynagh [Sun, 26 Apr 2009 15:19:42 +0000 (15:19 +0000)]
Remove a comment (a bug to close, that has now been closed)

14 years agoGHC new build system megapatch
Ian Lynagh [Sun, 26 Apr 2009 11:42:15 +0000 (11:42 +0000)]
GHC new build system megapatch

14 years agoFix SPARC build, missing #include
Ben.Lippmeier@anu.edu.au [Sat, 25 Apr 2009 08:33:45 +0000 (08:33 +0000)]
Fix SPARC build, missing #include

14 years agoFix a lint failure when we have a ! (# ... #) pattern in a where clause
Ian Lynagh [Fri, 24 Apr 2009 17:33:13 +0000 (17:33 +0000)]
Fix a lint failure when we have a  ! (# ... #)  pattern in a where clause
This showed up when converting ds057 to follow the new bang pattern rules,
in #2806.

14 years agoDo the second part of #2806: Disallow unlifted types in ~ patterns
Ian Lynagh [Fri, 24 Apr 2009 15:05:19 +0000 (15:05 +0000)]
Do the second part of #2806: Disallow unlifted types in ~ patterns

14 years agoTiny refactor
Ian Lynagh [Fri, 24 Apr 2009 14:02:27 +0000 (14:02 +0000)]
Tiny refactor

14 years agoRequire a bang pattern when unlifted types are where/let bound; #3182
Ian Lynagh [Fri, 24 Apr 2009 12:47:54 +0000 (12:47 +0000)]
Require a bang pattern when unlifted types are where/let bound; #3182
For now we only get a warning, rather than an error, because the alex
and happy templates don't follow the new rules yet.

14 years agoDon't short out top-level indirections if there's a INLINE/NOINLINE pragma
simonpj@microsoft.com [Fri, 24 Apr 2009 12:32:38 +0000 (12:32 +0000)]
Don't short out top-level indirections if there's a INLINE/NOINLINE pragma

The top-level indirection-shorting, done in SimplCore.shortOutIndirections,
was accidentally nuking a NOINLINE pragma.  This patch adopts a slightly
more conservative approach to indirection-shorting, only doing so if
we do not thereby overwrite or lose some user-supplied pragmas.

14 years agoFix #3182: 64 bit FP value returned by C calls was getting trashed
Ben.Lippmeier@anu.edu.au [Fri, 24 Apr 2009 06:50:53 +0000 (06:50 +0000)]
Fix #3182: 64 bit FP value returned by C calls was getting trashed
   movss instruction was being used to move the result into the
   destination register instead of movsd

14 years agoadd missing files (part of #3171 fix)
Simon Marlow [Fri, 24 Apr 2009 09:16:10 +0000 (09:16 +0000)]
add missing files (part of #3171 fix)

14 years agoTiny optimisation to mkInlineMe
simonpj@microsoft.com [Fri, 24 Apr 2009 07:47:33 +0000 (07:47 +0000)]
Tiny optimisation to mkInlineMe

15 years agoAdd EVENT_CREATE_SPARK_THREAD to replace EVENT_SPARK_TO_THREAD
Simon Marlow [Thu, 23 Apr 2009 14:19:40 +0000 (14:19 +0000)]
Add EVENT_CREATE_SPARK_THREAD to replace EVENT_SPARK_TO_THREAD
Also some tidyups and renaming

15 years agoadd getOrSetSignalHandlerStore, much like getOrSetTypeableStore
Simon Marlow [Thu, 23 Apr 2009 11:30:02 +0000 (11:30 +0000)]
add getOrSetSignalHandlerStore, much like getOrSetTypeableStore
Part of the fix for #3171

15 years agodon't overwrite io_manager_pipe if it is already set
Simon Marlow [Thu, 23 Apr 2009 11:29:39 +0000 (11:29 +0000)]
don't overwrite io_manager_pipe if it is already set
Part of the fix for #3171

15 years agoSimplify the placeholder binding for naughty record selectors
simonpj@microsoft.com [Thu, 23 Apr 2009 09:44:01 +0000 (09:44 +0000)]
Simplify the placeholder binding for naughty record selectors

15 years agoFix Trac #3176: intercept naughty record selectors
simonpj@microsoft.com [Thu, 23 Apr 2009 09:42:37 +0000 (09:42 +0000)]
Fix Trac #3176: intercept naughty record selectors

When making record selectors into ordinary functions (rather than
magial implicit Ids) I forgot that they could therefore show up in
the *local* TcEnv, not the global one.  This fixes that problem,
and thereby Trac #3176.

15 years agoBetter pretty-printing for IdDetails
simonpj@microsoft.com [Thu, 23 Apr 2009 09:39:45 +0000 (09:39 +0000)]
Better pretty-printing for IdDetails

15 years agoFIX #3166: include the fixity of classes and type synonyms in their fingerprints
Simon Marlow [Tue, 21 Apr 2009 13:56:24 +0000 (13:56 +0000)]
FIX #3166: include the fixity of classes and type synonyms in their fingerprints

15 years agoFIX #2682: banish silly cases of the "module Foo is not loaded" error
Simon Marlow [Tue, 21 Apr 2009 13:10:38 +0000 (13:10 +0000)]
FIX #2682: banish silly cases of the "module Foo is not loaded" error

In GHCi if you say 'import Foo' meaning to load a package module Foo,
and Foo.hs is found on the search path, then GHCi replies "module Foo
is not loaded", because it knows Foo refers to the source file rather
than the package module, and you haven't loaded that module with
:load.

This is consistent with the usual module-finding semantics.  However,
it isn't particularly useful.  And it leads to silly problems like not
being able to start GHCi when you happen to be sitting in
libraries/base, because GHCi thinks the Prelude hasn't been loaded.

So now I've made a slight change to the way that 'import M' works: if
M is loaded, then it refers to the loaded module, otherwise it looks
for a package module M.  This does what the reporter of #2682 wanted,
and since it turns an error condition into meaningful behaviour it
can't break anything.

The only undesirable consequence is that 'import M' might refer to a
different M than ':load M'.  Hopefully that won't lead to confusion.

15 years agoFIX #2500: Don't log warnings in getHeader
Simon Marlow [Tue, 21 Apr 2009 10:00:39 +0000 (10:00 +0000)]
FIX #2500: Don't log warnings in getHeader

15 years agoadd a DO NOT EDIT comment
Simon Marlow [Tue, 21 Apr 2009 09:46:06 +0000 (09:46 +0000)]
add a DO NOT EDIT comment

15 years agoFIX #3153: we lost an EOF sentinel in the event of a lexical error
Simon Marlow [Tue, 21 Apr 2009 09:45:58 +0000 (09:45 +0000)]
FIX #3153: we lost an EOF sentinel in the event of a lexical error

15 years agoFIX #2845: Allow breakpoints on expressions with unlifted type
Simon Marlow [Mon, 20 Apr 2009 14:25:25 +0000 (14:25 +0000)]
FIX #2845: Allow breakpoints on expressions with unlifted type

It turns out we can easily support breakpoints on expressions with
unlifted types, by translating

  case tick# of _ -> e

into

  let f = \s . case tick# of _ -> e
  in  f realWorld#

instead of just a plain let-binding.  This is the same trick that GHC
uses for abstracting join points of unlifted type.

In #2845, GHC has eta-expanded the tick expression, changing the
result type from IO a to (# State#, a #), which was the reason the
tick was suddenly being ignored.  By supporting ticks on unlifted
expressions we can make it work again, although some confusion might
arise because _result will no longer be available (it now has
unboxed-tuple type, so we can't bind it in the environment).  The
underlying problem here is that GHC does transformations like
eta-expanding the tick expressions, and there's nothing we can do to
prevent that.

15 years agoremove now-unused atomic_modify_mutvar_mutex
Simon Marlow [Fri, 3 Apr 2009 13:27:31 +0000 (13:27 +0000)]
remove now-unused atomic_modify_mutvar_mutex

15 years agoSPARC NCG: Add a comment explaining why we can't used a pinned reg for gct
Ben.Lippmeier@anu.edu.au [Mon, 20 Apr 2009 07:43:35 +0000 (07:43 +0000)]
SPARC NCG: Add a comment explaining why we can't used a pinned reg for gct
Can't use windowed regs because the window moves during a function
call. Can't use the global regs because they're reserved for other purposes.

15 years agoSPARC NCG: validate fixes
Ben.Lippmeier@anu.edu.au [Mon, 20 Apr 2009 03:21:20 +0000 (03:21 +0000)]
SPARC NCG: validate fixes

15 years agoSPARC NCG: Base freeRegs on includes/MachRegs.h again
Ben.Lippmeier@anu.edu.au [Mon, 20 Apr 2009 02:07:00 +0000 (02:07 +0000)]
SPARC NCG: Base freeRegs on includes/MachRegs.h again

15 years agoReally fix Trac #2611 this time
pepe iborra [Sun, 19 Apr 2009 14:22:41 +0000 (14:22 +0000)]
Really fix Trac #2611 this time

My previous patch didn't completely solve the problem.
I believe I got it right this time.

15 years agoFix Trac #2611
pepe iborra [Sat, 18 Apr 2009 21:41:15 +0000 (21:41 +0000)]
Fix Trac #2611

Fix a bug in :print affecting data types with unboxed components

15 years agoFix #3170: Allow coalescing of the same node during register allocation.
Ben.Lippmeier@anu.edu.au [Sat, 18 Apr 2009 08:22:53 +0000 (08:22 +0000)]
Fix #3170: Allow coalescing of the same node during register allocation.
  The x86 code generator sometimes generates nop moves like
  movl %vI_a %vI_a, but we'll just ignore them for coalescing
  purposes instead of emitting an error. It shouldn't hurt anything.

15 years agoFix my previous patch about type parsing
David Waern [Sat, 18 Apr 2009 08:29:27 +0000 (08:29 +0000)]
Fix my previous patch about type parsing

I forgot to record some additional changes.

15 years agoSimplify the type grammar
David Waern [Fri, 17 Apr 2009 14:58:55 +0000 (14:58 +0000)]
Simplify the type grammar

Simon P-J suggested the following simplifications in #3097:

* Allow nested foralls in `ctype` just like in `ctypedoc`.
* Use `gentype` rather than `type` in the LHS of type declarations.
* Inline `type` in `ctype`.
* Rename `gentype` to `type`.

This patch does this. Also, the equivalent thing is done for documented types.

15 years agoRemoved unused function postEventTypeID.
donnie@darthik.com [Mon, 13 Apr 2009 01:17:45 +0000 (01:17 +0000)]
Removed unused function postEventTypeID.
postEventTypeID was used to post event marker IDs, but instead we just
call postWord16 directly; thus, this function is unused.

15 years agoFor consistency, changed access of thread id to be through capability instead of...
donnie@darthik.com [Mon, 13 Apr 2009 01:17:01 +0000 (01:17 +0000)]
For consistency, changed access of thread id to be through capability instead of directly from StgRegTable.

15 years agoAdded new EventLog event: Spark to Thread.
donnie@darthik.com [Mon, 13 Apr 2009 01:14:44 +0000 (01:14 +0000)]
Added new EventLog event: Spark to Thread.

15 years agoChanged postEvent last argument from "nat from" to "StgWord64 other".
donnie@darthik.com [Mon, 13 Apr 2009 01:11:40 +0000 (01:11 +0000)]
Changed postEvent last argument from "nat from" to "StgWord64 other".
StgWord64 other better represents this argument since it can be used as
any particular data, thus "other" and not the "from" capability as it was
previously strictly used.  Also, StgWord64 is normally larger than type
nat to allow for larger data to be passed through the "other" argument.

15 years agoFixed ThreadID to be defined as StgThreadID, not StgWord64. Changed CapabilityNum...
donnie@darthik.com [Mon, 13 Apr 2009 01:07:05 +0000 (01:07 +0000)]
Fixed ThreadID to be defined as StgThreadID, not StgWord64.  Changed CapabilityNum to CapNo.  Added helper functions postCapNo() and postThreadID().
ThreadID was StgWord64, but should have been StgThreadID, which is
currently StgWord32.  Changed name from CapabilityNum to CapNo to better
reflect naming in Capability struct where "no" is the capability number.
Modified EventLog.c to use the helper functions postCapNo() and
postThreadID () for CapNo and ThreadID.

15 years agoFixed error in order of EventTypeDescriptions -- seq and par GC come after start...
donnie@darthik.com [Fri, 3 Apr 2009 03:43:22 +0000 (03:43 +0000)]
Fixed error in order of EventTypeDescriptions -- seq and par GC come after start and finish GC.
EventTypeDescriptions order must be synchronized with the event type
definitions in includes/EventLogFormat.h for the definitions to correctly
index with the matching description.

15 years agoEventlog support for new event type: create spark.
donnie@darthik.com [Fri, 3 Apr 2009 03:30:25 +0000 (03:30 +0000)]
Eventlog support for new event type: create spark.

15 years agoTweak a Show instance
Ian Lynagh [Tue, 7 Apr 2009 14:30:57 +0000 (14:30 +0000)]
Tweak a Show instance

15 years agoFix Trac #3155: better error message when -XRankNTypes is omitted
simonpj@microsoft.com [Thu, 9 Apr 2009 14:40:04 +0000 (14:40 +0000)]
Fix Trac #3155: better error message when -XRankNTypes is omitted

This patch sligtly re-adjusts the way in which the syntax of types
is handled:

 * In the lexer, '.' and '*' are always accepted in types
   (previously it was conditional).  This things can't mean
   anything else in H98, which is the only reason for doing things
   conditionally in the lexer.

 * As a result '.' in types is never treated as an operator.
   Instead, lacking a 'forall' keyword, it turns into a plain parse error.

 * Test for -XKindSignatures in the renamer when processing
     a) type variable bindings
     b) types with sigs (ty :: kind-sig)

 * Make -XKindSignatures be implied by -XTypeFamilies
   Previously this was buried in the conditonal lexing of '*'

15 years agoUse return instead of returnM, and similar tidy-ups
simonpj@microsoft.com [Thu, 9 Apr 2009 14:09:59 +0000 (14:09 +0000)]
Use return instead of returnM, and similar tidy-ups

15 years agoDon't use thread local storage on x86/not-Linux
Ian Lynagh [Sat, 4 Apr 2009 00:34:45 +0000 (00:34 +0000)]
Don't use thread local storage on x86/not-Linux
With the
    On x86, use thread-local storage instead of stealing a reg for gct
patch, on Windows and OS X:
    error: thread-local storage not supported for this target

15 years agoMake some showSDoc's use OneLineMode rather than PageMode
Ian Lynagh [Tue, 31 Mar 2009 18:19:48 +0000 (18:19 +0000)]
Make some showSDoc's use OneLineMode rather than PageMode

15 years agoMake the showSDoc definition more explicit
Ian Lynagh [Tue, 31 Mar 2009 17:41:03 +0000 (17:41 +0000)]
Make the showSDoc definition more explicit

15 years agoeliminate warnings
dias@eecs.tufts.edu [Fri, 3 Apr 2009 20:34:29 +0000 (20:34 +0000)]
eliminate warnings

15 years agoDebugging by Sesame Street:
dias@eecs.tufts.edu [Fri, 3 Apr 2009 20:15:04 +0000 (20:15 +0000)]
Debugging by Sesame Street:

One of these things is not like the others:

stdPattern :: [LRep] -> Maybe StgHalfWord
stdPattern reps
  = case reps of
        []  -> Just ARG_NONE    -- just void args, probably
        [N] -> Just ARG_N
        [P] -> Just ARG_N
        [F] -> Just ARG_F
        [D] -> Just ARG_D
        [L] -> Just ARG_L

Today's debugging session was brought to you by the letter P.

15 years agoBuggy optimizations caused function-call return to share the function's entry point
dias@eecs.tufts.edu [Tue, 31 Mar 2009 14:46:39 +0000 (14:46 +0000)]
Buggy optimizations caused function-call return to share the function's entry point
- Block concat and branch-chain elimination were allowing a function call
  to return to the caller's entry point. But that doesn't leave anywhere
  for the infotable on the stack, since the SP on return must be the same
  as the SP on entry to the procedure.

15 years agoBetter handling of node parameter in calling conventions
dias@eecs.tufts.edu [Wed, 25 Mar 2009 16:38:15 +0000 (16:38 +0000)]
Better handling of node parameter in calling conventions
 - Previously, the node was taken as a parameter, then ignored,
   for static closures. Goofy. Now, the vestigial node parameters
   are gone.

15 years agoWhen calling gc, avoid saving node in static closures
dias@eecs.tufts.edu [Mon, 23 Mar 2009 20:47:44 +0000 (20:47 +0000)]
When calling gc, avoid saving node in static closures

15 years agoCode simplifications due to call/return separation; some improvements to how node...
dias@eecs.tufts.edu [Mon, 23 Mar 2009 20:11:40 +0000 (20:11 +0000)]
Code simplifications due to call/return separation; some improvements to how node argument is managed

15 years agoCode simplification due to separate call/return conventions
dias@eecs.tufts.edu [Mon, 23 Mar 2009 18:22:14 +0000 (18:22 +0000)]
Code simplification due to separate call/return conventions

15 years agoCalls with and without passing node arguments more clearly separated
dias@eecs.tufts.edu [Mon, 23 Mar 2009 17:47:00 +0000 (17:47 +0000)]
Calls with and without passing node arguments more clearly separated

15 years agoAnother small step: call and return conventions specified separately when making...
dias@eecs.tufts.edu [Mon, 23 Mar 2009 17:28:37 +0000 (17:28 +0000)]
Another small step: call and return conventions specified separately when making calls

15 years agoSmall step toward call-conv improvement: separate out calls and returns
dias@eecs.tufts.edu [Mon, 23 Mar 2009 17:07:06 +0000 (17:07 +0000)]
Small step toward call-conv improvement: separate out calls and returns

15 years agoOn x86, use thread-local storage instead of stealing a reg for gct
Simon Marlow [Fri, 3 Apr 2009 12:18:16 +0000 (12:18 +0000)]
On x86, use thread-local storage instead of stealing a reg for gct
Benchmarks show that using TLS instead of stealing a register is
better by a few percent on x86, due to the lack of registers.

This only affects -threaded; without -threaded we're (now) using
static storage for the GC data.

15 years agoin the non-threaded RTS, use a static gc_thread structure
Simon Marlow [Fri, 3 Apr 2009 12:14:43 +0000 (12:14 +0000)]
in the non-threaded RTS, use a static gc_thread structure

15 years agosmall GC optimisation
Simon Marlow [Fri, 3 Apr 2009 08:37:08 +0000 (08:37 +0000)]
small GC optimisation

15 years agoadd -funroll-loops when compiling the parallel version of Evac.c too
Simon Marlow [Thu, 2 Apr 2009 10:56:43 +0000 (10:56 +0000)]
add -funroll-loops when compiling the parallel version of Evac.c too

15 years agoPACKAGE_CPP_OPTS += -DPAPI_INCLUDE_DIR=""
Simon Marlow [Thu, 2 Apr 2009 10:55:40 +0000 (10:55 +0000)]
PACKAGE_CPP_OPTS += -DPAPI_INCLUDE_DIR=""
unbreaks ghc-pkg check in an installed GHC

15 years agoAdjust inlining heursitics
simonpj@microsoft.com [Fri, 3 Apr 2009 08:46:34 +0000 (08:46 +0000)]
Adjust inlining heursitics

This patch is the result of a long series of nofib-based experiments
to improve GHC's inlining heuristics.

In the end, I'm not sure how worthwhile it all was: I only got a
   1% decrease in code size
   1% decrease in allocation
and I don't trust the runtime statistics enough to quote.

Still, in doing all this I tidied up the code quite a bit, and
I understand it much better now, so I'm going to commit it.

The main changes are in CoreUnfold, which has lots of new comments.
Other changes:

  - litSize moves from Literal to CoreUnfold
  - interestingArg moves from SimplUtils to CoreUnfold
  - the default unfolding threshold (in StaticFlags)
      reduces from 8 to 6 (since the size calculation
      has changed a bit)

15 years agoWorker/wrapper should make INLINE if it doesn't w/w
simonpj@microsoft.com [Fri, 3 Apr 2009 08:43:33 +0000 (08:43 +0000)]
Worker/wrapper should make INLINE if it doesn't w/w

If worker/wrapper decides not to w/w something on the grounds that
it's too small, it should add an INLINE pragma.  Otherwise, later
in the day that small thing might now be big, and we'd wish we'd
done the w/w after all.  This only made a difference in one nofib
program (bspt), but it's an easy change.

See Note [Don't w/w inline things (a) and (b)]

15 years agoRewrite a good chunk of CoreArity
simonpj@microsoft.com [Fri, 3 Apr 2009 08:36:55 +0000 (08:36 +0000)]
Rewrite a good chunk of CoreArity

I found a couple of shortcomings in arity computation, and did
quite a bit of refactoring as a result.  Regrettably, I have
forgotten the details, but I do remember that one part was to
do with the infamous "state hack".  If we're going to use the
state-hack at all, we'd better do it right.

Anyway I think this is an improvement. The comments are more
up to date too, and more voluminous.

15 years agoComments only; record remarks about removing 'type' nonterminal
simonpj@microsoft.com [Thu, 2 Apr 2009 16:52:26 +0000 (16:52 +0000)]
Comments only; record remarks about removing 'type' nonterminal

15 years agoDon't float case expressions in full laziness
simonpj@microsoft.com [Thu, 2 Apr 2009 16:51:01 +0000 (16:51 +0000)]
Don't float case expressions in full laziness

See Note [Case MFEs]; don't float case expressions from
a strict context.

15 years agoFix Trac #3118: missing alternative
simonpj@microsoft.com [Thu, 2 Apr 2009 15:28:34 +0000 (15:28 +0000)]
Fix Trac #3118: missing alternative

This patch fixes a rather obscure bug, whereby it's possible
for (case C a b of <alts>) to have altenatives that do not inclue
(C a b)!  See Note [Unreachable code] in CoreUtils.

15 years agoUse a local interestingDict function instead of importing SimplUtils.interestingArg
simonpj@microsoft.com [Thu, 2 Apr 2009 15:22:46 +0000 (15:22 +0000)]
Use a local interestingDict function instead of importing SimplUtils.interestingArg

I'm changing the details of SimplUtils.interstingArg, and don't want to
mess  up the way Specialise works, so this patch makes a specilialised
(ha) function, Specialise.interestingDict, that is used locally.

15 years agoBetter panic reporting
simonpj@microsoft.com [Thu, 2 Apr 2009 15:18:46 +0000 (15:18 +0000)]
Better panic reporting

Make idDetails and idInfo into proper functions, rather than record
fields, so that we can report more informatively if you use thenm on
a non-Id.