ghc-hetmet.git
13 years agoadd "./sync-all fetch" and "./sync-all new"
Simon Marlow [Fri, 1 Apr 2011 14:03:27 +0000 (15:03 +0100)]
add "./sync-all fetch" and "./sync-all new"

./sync-all fetch

  Fetches remote changes from the "origin" for each sub-repo.  Useful
  before "./sync-all new".

  (Runs 'git fetch origin' on all sub-repos.)

./sync-all new

  Lists the new patches relative to "origin" for each sub-repo.
  You probably want to './sync-all fetch' first.

  (Runs 'git log origin..' on all sub-repos)

13 years agoadd a "set-origin" command
Simon Marlow [Fri, 1 Apr 2011 13:11:01 +0000 (14:11 +0100)]
add a "set-origin" command

Use it like this

  ./sync-all -r http://darcs.haskell.org/ghc-git set-origin

to set the origin branches of all sub-repos to point to the appropriate
repo within the http://darcs.haskell.org/ghc-git tree.

13 years agofix 'sync-all pull'
Simon Marlow [Fri, 1 Apr 2011 10:34:19 +0000 (11:34 +0100)]
fix 'sync-all pull'

13 years agoFix bindisttest in git
Ian Lynagh [Thu, 31 Mar 2011 23:26:22 +0000 (00:26 +0100)]
Fix bindisttest in git

13 years agoUpdate meta-repo stuff
Ian Lynagh [Thu, 31 Mar 2011 22:00:53 +0000 (23:00 +0100)]
Update meta-repo stuff

13 years agoIntroducing a datatype for WorkLists that properly prioritizes equalities.
dimitris@microsoft.com [Thu, 31 Mar 2011 10:26:34 +0000 (10:26 +0000)]
Introducing a datatype for WorkLists that properly prioritizes equalities.

We were not prioritizing the interaction of equalities in the worklist, because
pre-canonicalization solved the constraints one by one, in their arrival order.
This patch fixes this, so it's a generally useful improvement, mainly for
efficiency. It makes #4981 go away, although it's not a definite answer to the
cause of the problem. See discussion on Trac.

13 years agoFix Trac #5048: location on AbsBinds
simonpj@microsoft.com [Thu, 31 Mar 2011 10:23:15 +0000 (10:23 +0000)]
Fix Trac #5048: location on AbsBinds

This patch just puts a better SrcSpan on the AbsBinds
produced by the type checker

13 years agoComments and variable naming only
simonpj@microsoft.com [Thu, 31 Mar 2011 10:22:24 +0000 (10:22 +0000)]
Comments and variable naming only

13 years agoRe-enable assertion now the new type checker is in
simonpj@microsoft.com [Thu, 31 Mar 2011 10:21:16 +0000 (10:21 +0000)]
Re-enable assertion now the new type checker is in

(See Trac #3011.)

13 years agoAdd a new static flag -fno-opt-coercion
simonpj@microsoft.com [Thu, 31 Mar 2011 10:15:55 +0000 (10:15 +0000)]
Add a new static flag -fno-opt-coercion

This just disables the coercion optimiser, mainly for measurements in the paper

13 years agoNew statistics flags -ddump-core-stats
simonpj@microsoft.com [Thu, 31 Mar 2011 10:15:22 +0000 (10:15 +0000)]
New statistics flags -ddump-core-stats

This dumps a (one-line) listing of the size of the Core program,
just after tidying

13 years agoWindows build fix: ignore pthread.h if it exists (#4989)
Simon Marlow [Wed, 30 Mar 2011 09:23:42 +0000 (09:23 +0000)]
Windows build fix: ignore pthread.h if it exists (#4989)

13 years agoAdd a debug check for a non-empty FPU stack on x86 (see #4914)
Simon Marlow [Wed, 30 Mar 2011 10:19:34 +0000 (10:19 +0000)]
Add a debug check for a non-empty FPU stack on x86 (see #4914)

13 years agoimplement double-to-float narrowing in the x86 NCG (#4441)
Simon Marlow [Wed, 30 Mar 2011 10:18:09 +0000 (10:18 +0000)]
implement double-to-float narrowing in the x86 NCG (#4441)

13 years agoscheduleThreadOn: use TSO_LOCKED even on the non-threaded RTS
Simon Marlow [Wed, 30 Mar 2011 10:11:47 +0000 (10:11 +0000)]
scheduleThreadOn: use TSO_LOCKED even on the non-threaded RTS

13 years agoadd atexit (#4456)
Simon Marlow [Tue, 29 Mar 2011 15:56:28 +0000 (15:56 +0000)]
add atexit (#4456)

13 years agoTurn -vfia-C into a no-op
Ian Lynagh [Tue, 29 Mar 2011 17:01:58 +0000 (17:01 +0000)]
Turn -vfia-C into a no-op

13 years agoRemove -fvia-C references from the users guide
Ian Lynagh [Tue, 29 Mar 2011 17:01:34 +0000 (17:01 +0000)]
Remove -fvia-C references from the users guide

13 years agoAdd a tool for checking for problems in the built-in uniques
Ian Lynagh [Tue, 29 Mar 2011 16:44:41 +0000 (16:44 +0000)]
Add a tool for checking for problems in the built-in uniques

13 years agoRenumber TH uniques
Ian Lynagh [Tue, 29 Mar 2011 16:18:07 +0000 (16:18 +0000)]
Renumber TH uniques
This fixes a couple of duplicates that had crept in, and also
renumbers everything so that they are monotonically increasing
through the file.

13 years agoWhitespace only
Ian Lynagh [Mon, 28 Mar 2011 22:58:05 +0000 (22:58 +0000)]
Whitespace only

13 years agofix typo (#5056)
Simon Marlow [Tue, 29 Mar 2011 11:55:12 +0000 (11:55 +0000)]
fix typo (#5056)

13 years agoAdd a script for library merging
Ian Lynagh [Sun, 27 Mar 2011 18:35:36 +0000 (18:35 +0000)]
Add a script for library merging

13 years agobindist comparison tool: Some logic improvements, and testsuite support
Ian Lynagh [Sun, 27 Mar 2011 15:52:05 +0000 (15:52 +0000)]
bindist comparison tool: Some logic improvements, and testsuite support

13 years agoFix the build on Windows (disable hsc2hs --cross-safe)
Ian Lynagh [Sat, 26 Mar 2011 21:01:10 +0000 (21:01 +0000)]
Fix the build on Windows (disable hsc2hs --cross-safe)
The .hsc files aren't currently safe for cross-compilation on Windows:
    libraries\haskeline\.\System\Console\Haskeline\Backend\Win32.hsc:160
    directive "let" is not safe for cross-compilation

13 years agoBindist comparison tool: Recognise OS X .dylib files too
Ian Lynagh [Fri, 25 Mar 2011 15:53:54 +0000 (15:53 +0000)]
Bindist comparison tool: Recognise OS X .dylib files too

13 years agoFix #4914 (I hope)
Simon Marlow [Fri, 25 Mar 2011 16:12:34 +0000 (16:12 +0000)]
Fix #4914 (I hope)

Here's a bit of erroneous code:

00000c5c <s1ad_info>:
     c5c:       8b 45 08                mov    0x8(%ebp),%eax
     c5f:       d9 46 03                flds   0x3(%esi)
     c62:       dd d9                   fstp   %st(1)
     c64:       d9 55 08                fsts   0x8(%ebp)
     c67:       89 c6                   mov    %eax,%esi
     c69:       c7 45 00 24 0c 00 00    movl   $0xc24,0x0(%ebp)
     c70:       f7 c6 03 00 00 00       test   $0x3,%esi
     c76:       75 ac                   jne    c24 <s1ac_info>

So we should be doing some ffrees before the jne.  The code that
inserts the ffrees wasn't expecting to do it for a conditional jump,
because they are usually local, but we have a late optimisation that
shortcuts jumps-to-jumps, and that can result in a non-local
conditional jump.

This at least fixes an instance of the bug that I was able to
reproduce, let's hope there aren't any more.

13 years agoIgnore comments when inlining.
Edward Z. Yang [Fri, 25 Mar 2011 12:01:08 +0000 (12:01 +0000)]
Ignore comments when inlining.

13 years agoFix typo in documentation (Trac #5035)
simonpj@microsoft.com [Fri, 25 Mar 2011 13:36:19 +0000 (13:36 +0000)]
Fix typo in documentation (Trac #5035)

13 years agoSplit out "Raw Cmm" dump to its own flag -ddump-raw-cmm
Edward Z. Yang [Tue, 22 Mar 2011 15:16:52 +0000 (15:16 +0000)]
Split out "Raw Cmm" dump to its own flag -ddump-raw-cmm

Previously, -ddump-cmmz was used to dump out the "Raw Cmm" right
before it gets passed to the backends, as well as all of the
intermediate phases in the new code generator.  Unfortunately,
there are a lot of intermediate phases, which means -ddump-cmmz
takes a very long time with -fnew-codegen for large programs,
even if you're only interested in the final result.

Here we split up -ddump-cmmz into -ddump-cmmz (now exclusively for
the new code generator) and -ddump-raw-cmm (for both code generation
paths.) The old flag was not documented in the manual, so hopefully
not too many people will be surprised by this change.

13 years agoRednCounts can contain CAFs, so support them in cvtToClosureLbl.
Edward Z. Yang [Tue, 22 Mar 2011 14:17:02 +0000 (14:17 +0000)]
RednCounts can contain CAFs, so support them in cvtToClosureLbl.

13 years agoImmediately tag initialization code to prevent untagged spills.
Edward Z. Yang [Wed, 23 Mar 2011 13:43:30 +0000 (13:43 +0000)]
Immediately tag initialization code to prevent untagged spills.

When allocating new objects on the heap, we previously returned
a CmmExpr containing the heap pointer as well as the tag expression,
which would be added to the code graph upon first usage.  Unfortunately,
this meant that untagged heap pointers living in registers might
be spilled to the stack, where they interacted poorly with garbage
collection (we saw this bug specifically with the compacting garbage
collector.)

This fix immediately tags the register containing the heap pointer,
so that unless we have extremely unfriendly spill code, the new pointer
will never be spilled to the stack untagged.

An alternate solution might have been to modify allocDynClosure to
tag the pointer upon the initial register allocation, but not all
invocations of allocDynClosure tag the resulting pointer, and
threading the consequent CgIdInfo for the cases that did would have
been annoying.

13 years agoFix Trac #5028: zap occ info when doing the binder swap
simonpj@microsoft.com [Mon, 21 Mar 2011 11:00:09 +0000 (11:00 +0000)]
Fix Trac #5028: zap occ info when doing the binder swap

This fixes the Lint error, but still risks leaving stupid
let { x=y } bindings in the code.  But no time to fix that
today.  (Leave the ticket open for that reason.)

13 years agopruneSparkQueue: handle CAFs
Simon Marlow [Fri, 18 Mar 2011 14:21:22 +0000 (14:21 +0000)]
pruneSparkQueue: handle CAFs

13 years agoDocument new hsc2hs flags, and use the --cross-safe flag when we're compiling
Ian Lynagh [Wed, 23 Mar 2011 21:16:51 +0000 (21:16 +0000)]
Document new hsc2hs flags, and use the --cross-safe flag when we're compiling
Patch from Brian Bloniarz

13 years agobindist checker improvements
Ian Lynagh [Tue, 22 Mar 2011 18:21:12 +0000 (18:21 +0000)]
bindist checker improvements
* Some refactoring
* Support for Windows filenames
* Some support for installed trees (as Windows "bindists" are really
  install trees)

13 years agoRename System.Event to GHC.Event
Ian Lynagh [Mon, 21 Mar 2011 23:43:08 +0000 (23:43 +0000)]
Rename System.Event to GHC.Event
It's just an internal GHC library, for now at least

13 years agoHack to get the compare tool to work on Windows "bindists"
Ian Lynagh [Mon, 21 Mar 2011 22:31:07 +0000 (22:31 +0000)]
Hack to get the compare tool to work on Windows "bindists"

13 years agoDon't use read_only_relocs on darwin x86-64; fixes #4984
William Knop [Wed, 9 Mar 2011 20:19:11 +0000 (20:19 +0000)]
Don't use read_only_relocs on darwin x86-64; fixes #4984

13 years agoFunctionalDependencies should imply MultiParamTypeClasses
Max Bolingbroke [Sun, 20 Mar 2011 14:06:25 +0000 (14:06 +0000)]
FunctionalDependencies should imply MultiParamTypeClasses

13 years agoChange how we compute install paths on cygwin
Ian Lynagh [Sun, 20 Mar 2011 01:25:40 +0000 (01:25 +0000)]
Change how we compute install paths on cygwin
We used to have
    MK_INSTALL_DEST = "$(shell cygpath $1)"
but this meant we ended up with
    "$(shell cygpath "[...]/html/`basename $$i`")"
and the $(...) gets evaluated before the makefile rule, so the for loop
hasn't been run, and so $i isn't defined. So we were taking the basename
of the empty string, meaning docs weren't being installed in the right
place.

Now we have
    MK_INSTALL_DEST = $$(cygpath $1)
so the evaluation happens in the shell, while the for loop is running.

13 years agoAdd unboxedTupleTName to templateHaskellNames
Ian Lynagh [Thu, 17 Mar 2011 00:34:06 +0000 (00:34 +0000)]
Add unboxedTupleTName to templateHaskellNames

13 years agobindist comparison tool: Improve way-difference behaviour
Ian Lynagh [Wed, 16 Mar 2011 22:13:38 +0000 (22:13 +0000)]
bindist comparison tool: Improve way-difference behaviour

13 years agoBindist comparison tool: add --ignore-size-changes flag
Ian Lynagh [Wed, 16 Mar 2011 22:07:48 +0000 (22:07 +0000)]
Bindist comparison tool: add --ignore-size-changes flag

13 years agoBindist comparison tool: Handle differences in the library ways nicely
Ian Lynagh [Wed, 16 Mar 2011 21:47:08 +0000 (21:47 +0000)]
Bindist comparison tool: Handle differences in the library ways nicely
In particular, this makes it possible to compare release bindists (with
profiling files) and validate bindists (without them).

13 years agoDon't put includes/rts/Config.h in bindists twice
Ian Lynagh [Wed, 16 Mar 2011 19:01:17 +0000 (19:01 +0000)]
Don't put includes/rts/Config.h in bindists twice

13 years agoDon't put 2 copies of the RTS libraries in the bindists
Ian Lynagh [Wed, 16 Mar 2011 17:29:45 +0000 (17:29 +0000)]
Don't put 2 copies of the RTS libraries in the bindists

13 years agoMake include file paths a little prettier
Ian Lynagh [Wed, 16 Mar 2011 16:20:45 +0000 (16:20 +0000)]
Make include file paths a little prettier
This isn't important, but it stops us getting [...]/./[...] in the paths
in bindists.

13 years agoInitial implementation of bindist comparison tool
Ian Lynagh [Tue, 15 Mar 2011 16:29:12 +0000 (16:29 +0000)]
Initial implementation of bindist comparison tool

13 years agoStop explicitly asking for 10.5 support on OS X; fixes #5011
Ian Lynagh [Sun, 13 Mar 2011 14:03:22 +0000 (14:03 +0000)]
Stop explicitly asking for 10.5 support on OS X; fixes #5011
XCode 4 doesn't include the 10.5 SDK, so if we explicitly ask for it
then linking fails.

13 years agoWrite the XCode version test differently
Ian Lynagh [Sun, 13 Mar 2011 13:49:13 +0000 (13:49 +0000)]
Write the XCode version test differently
Using && causes problems on opensolaris, for an unknown reason.
http://www.haskell.org/pipermail/cvs-ghc/2011-March/060314.html

13 years agoConsistently use <sect1> etc rather than <section>; fixes #5009
Ian Lynagh [Fri, 11 Mar 2011 21:29:58 +0000 (21:29 +0000)]
Consistently use <sect1> etc rather than <section>; fixes #5009
It might be nicer to actually go the other way, and make everything
use <section> instead, but this fixes the incorrect numbering for
now, and we can look into whether <section> has any disadvantages
later.

13 years agoDrop dead core that was kept alive by RULES in CorePrep (#4962)
Max Bolingbroke [Sat, 19 Feb 2011 11:47:26 +0000 (11:47 +0000)]
Drop dead core that was kept alive by RULES in CorePrep (#4962)

13 years agoOptimise comparisons against min/maxBound (ticket #3744).
Michal Terepeta [Wed, 27 Oct 2010 18:40:54 +0000 (18:40 +0000)]
Optimise comparisons against min/maxBound (ticket #3744).

This optimises away comparisons with minBound or maxBound
that are always false or always true.

13 years agoLLVM: Fix #4995, llvm mangler broken for large compiles
David Terei [Wed, 9 Mar 2011 21:53:46 +0000 (21:53 +0000)]
LLVM: Fix #4995, llvm mangler broken for large compiles

13 years agoImprove the XCode version detection
Ian Lynagh [Mon, 7 Mar 2011 22:58:23 +0000 (22:58 +0000)]
Improve the XCode version detection
Amongst other improvements, we now handle 3-component versions
(like "3.1.4") correctly.

13 years agoImpredicative polymorphism no longer deprecated.
Edward Z. Yang [Sun, 6 Mar 2011 21:59:16 +0000 (21:59 +0000)]
Impredicative polymorphism no longer deprecated.

13 years agoFix doc formatting
Ian Lynagh [Sun, 6 Mar 2011 15:15:32 +0000 (15:15 +0000)]
Fix doc formatting

13 years agoconfigure: amend sanity check
Sergei Trofimovich [Tue, 1 Mar 2011 19:40:18 +0000 (19:40 +0000)]
configure: amend sanity check

As we perform some mangling of original --build/--host/--target
params we should check the result of mangling against desired triplet,
not originally passed by user.

Patch also adds mangled triplets to the output.

13 years agoconfigure: triplet: accept i486 CPU (and more), more vendors and OSes
Sergei Trofimovich [Tue, 1 Mar 2011 06:41:08 +0000 (06:41 +0000)]
configure: triplet: accept i486 CPU (and more), more vendors and OSes

Gentoo has interesting ports:

  - freebsd with following triplet:
        ./configure --build=i686-gentoo-freebsd8 --host=i686-gentoo-freebsd8 --host=i686-gentoo-freebsd8
    should be recognized as 'i386-unknown-freebsd'
  - 'pc' vendor along with non-'i386' is very common:
        ./configure --build=i486-pc-linux-gnu --i486-pc-linux-gnu --host=i486-pc-linux-gnu
        ./configure --build=i686-pc-linux-gnu --i686-pc-linux-gnu --host=i686-pc-linux-gnu
    should be recognized as 'i386-unknown-linux'

Patch adds:

  - 'pc' vendor                 (maps to 'unknown')
  - 'gentoo' vendor             (maps to 'unknown')
  - 'i486', 'i586', 'i686' CPUs (maps to 'i386')
  - 'freebsd8' OS               (maps to 'freebsd')

13 years agoDocument -fwarn-missing-import-lists
simonpj@microsoft.com [Sun, 6 Mar 2011 00:02:16 +0000 (00:02 +0000)]
Document -fwarn-missing-import-lists

Also change the behaviour slightly, to warn only for
*unqualified* imports.  See Trac #4977.

13 years agoCompleted the implementation of VECTORISE SCALAR
Manuel M T Chakravarty [Sat, 5 Mar 2011 12:36:25 +0000 (12:36 +0000)]
Completed the implementation of VECTORISE SCALAR
- The pragma {-# VECTORISE SCALAR foo #-} marks 'foo' as a
  scalar function for for vectorisation and generates a
  vectorised version by applying 'scalar_map' and friends.
- The set of scalar functions is not yet emitted into
  interface files.  This will be added in a subsequent
  patch via 'VectInfo'.

13 years agoFix build, and improve ghc-cabal's errors
Ian Lynagh [Sat, 5 Mar 2011 15:39:31 +0000 (15:39 +0000)]
Fix build, and improve ghc-cabal's errors

13 years agoWhitespace only
Ian Lynagh [Sat, 5 Mar 2011 15:02:38 +0000 (15:02 +0000)]
Whitespace only

13 years agoSanity check values that we wrap in single quotes
Ian Lynagh [Sat, 5 Mar 2011 15:01:18 +0000 (15:01 +0000)]
Sanity check values that we wrap in single quotes
Make sure they contain no single quotes, leading spaces, or trailing spaces.

13 years agoAvoid some shell calls in the build system
Ian Lynagh [Sat, 5 Mar 2011 14:48:25 +0000 (14:48 +0000)]
Avoid some shell calls in the build system
The DEP_INCLUDE_DIRS and DEP_LIB_DIRS variables always contain
single-quote dirs, so we can use e.g.
    $(subst $(space)',$(space)-L',$(space)$($1_$2_DEP_LIB_DIRS_SINGLE_QUOTED))
to add -L to the front of each dir. I've appended "_SINGLE_QUOTED" to
the variable names so we don't accidentally add bare directories to
them.

13 years agoMake -fno-enable-rewrite-rules work properly
simonpj@microsoft.com [Wed, 2 Mar 2011 11:43:17 +0000 (11:43 +0000)]
Make -fno-enable-rewrite-rules work properly

I'd failed to propagate the Opt_EnableRewriteRules flag properly,
which meant that -fno-enable-rewrite-rules didn't disable all
rewrites.  This patch fixes it.

13 years agoComments only
simonpj@microsoft.com [Wed, 2 Mar 2011 11:30:41 +0000 (11:30 +0000)]
Comments only

13 years agoRestore SPECIALISE INSTANCE pragmas
simonpj@microsoft.com [Tue, 22 Feb 2011 17:31:12 +0000 (17:31 +0000)]
Restore SPECIALISE INSTANCE pragmas

For some reason I'd commented out this code, which
meant that we weren't getting the the goodness of
the SPECIALISE INSTANCE pragamas in GHC.Real. And
that in turn killed performance in nofib 'power'

13 years agoGHC.Prim.threadStatus# now returns the cap number, and the value of TSO_LOCKED
Simon Marlow [Tue, 1 Mar 2011 10:10:25 +0000 (10:10 +0000)]
GHC.Prim.threadStatus# now returns the cap number, and the value of TSO_LOCKED

13 years agoImprove GHCi line numbers in errors
Ian Lynagh [Sun, 27 Feb 2011 17:20:12 +0000 (17:20 +0000)]
Improve GHCi line numbers in errors
When running commands from the user (as opposed to from a file), reset
the line number to 1 at the start of each command.

13 years ago:script file scripts in GHCi #1363
Vivian McPhail [Sat, 26 Feb 2011 07:31:33 +0000 (07:31 +0000)]
:script file scripts in GHCi #1363
This patch adds the script command in GHCi

A file is read and executed as a series of GHCi commands.

Execution terminates on the first error.  The filename and
line number are included in the error.

13 years agoTurn off split objects on Darwin if XCode < 3.2 (#4013)
Ian Lynagh [Fri, 25 Feb 2011 18:43:58 +0000 (18:43 +0000)]
Turn off split objects on Darwin if XCode < 3.2 (#4013)

13 years agolibffi: backport incorrect detection of selinux
Sergei Trofimovich [Tue, 8 Feb 2011 21:21:40 +0000 (21:21 +0000)]
libffi: backport incorrect detection of selinux

This patch unbreaks ghci on GRSEC kernels hardened with
TPE (Trusted Path Execution) protection.

TPE forbids mmap('rwx') files opened for writes:
    fd = open (a_file_in_tmp, O_RDWR);
    mmap (...,               PROT_READ | PROT_WRITE | PROT_EXEC, fd);

while allows anonymous RWX mappings:
    mmap (...MAP_ANONYMOUS , PROT_READ | PROT_WRITE | PROT_EXEC, -1);

Thanks to klondike for finding it out.

The result of a horrible typo.

(unreleased yet) upstream also has the patch:

http://github.com/atgreen/libffi/commit/eaf444eabc4c78703c0f98ac0197b1619c1b1bef

13 years agoGenerate the OS X installer from a bindist, rather than from a source tree
Ian Lynagh [Wed, 23 Feb 2011 17:00:16 +0000 (17:00 +0000)]
Generate the OS X installer from a bindist, rather than from a source tree

13 years agoUse -h rather than -soname; fixes dynlibs on Solaris 10; trac #4973
Ian Lynagh [Tue, 22 Feb 2011 15:26:56 +0000 (15:26 +0000)]
Use -h rather than -soname; fixes dynlibs on Solaris 10; trac #4973

13 years agoFix another fundep error (fixes Trac #4969)
simonpj@microsoft.com [Mon, 21 Feb 2011 15:32:39 +0000 (15:32 +0000)]
Fix another fundep error (fixes Trac #4969)

If I had a pound for every hour Dimitrios and I have spent
making functional dependencies work right, we'd be rich!

We had stupidly caused a 'wanted' to be rewritten by a 'derived', with
resulting abject failure.  As well as fixing the bug, this patch
refactors some more, adds useful assert and comments.

13 years agoNew codegen: GC calling convention must use registers.
Edward Z. Yang [Fri, 18 Feb 2011 01:17:45 +0000 (01:17 +0000)]
New codegen: GC calling convention must use registers.

Previously, on register-deficient architectures like x86-32,
the new code generator would emit code for calls to stg_gc_l1,
stg_gc_d1 and stg_gc_f1 that pushed their single argument on
to the stack, while the functions themselves expected the
argument to live in L1, D1 and F1 (respectively).  This was
because cmmCall with the GC calling convention allocated real
registers, not virtual registers.

This patch modifies the code for assigning registers/stack slots
to use the right calling convention for GC and adds an assertion
to ensure it did it properly.

13 years agoAdded a VECTORISE pragma
Manuel M T Chakravarty [Sun, 20 Feb 2011 10:50:32 +0000 (10:50 +0000)]
Added a VECTORISE pragma
- Added a pragma {-# VECTORISE var = exp #-} that prevents
  the vectoriser from vectorising the definition of 'var'.
  Instead it uses the binding '$v_var = exp' to vectorise
  'var'.  The vectoriser checks that the Core type of 'exp'
  matches the vectorised Core type of 'var'.  (It would be
  quite complicated to perform that check in the type checker
  as the vectorisation of a type needs the state of the VM
  monad.)
- Added parts of a related VECTORISE SCALAR pragma
- Documented -ddump-vect
- Added -ddump-vt-trace
- Some clean up

13 years agoReenable object splitting on Darwin, now #4013 appears to be fixed
Ian Lynagh [Sat, 19 Feb 2011 19:14:09 +0000 (19:14 +0000)]
Reenable object splitting on Darwin, now #4013 appears to be fixed

13 years agoClarify the "object splitting" variable names
Ian Lynagh [Sat, 19 Feb 2011 16:15:08 +0000 (16:15 +0000)]
Clarify the "object splitting" variable names

13 years agoFix #4867 (updated; corrects address calculation)
gwright@antiope.com [Mon, 14 Feb 2011 15:09:24 +0000 (15:09 +0000)]
Fix #4867 (updated; corrects address calculation)

This is a corrected fix for ticket #4867, "ghci displays negative floats
incorrectly".  The previous patch sometimes gave incorrect offset to values
in the __const section of the __TEXT segment.  The new patch arranges a zero
fixup for non-external, not-global offset table signed relocations.  This
is apparently what is required, though documentation on this point is scarce.

With this change Doubles are negated properly, because the sign bit mask
is loaded from the correct offset.  This was tested both on HEAD and the 7.0
branch.

13 years agoScale columns in cost-centre-stack report to their contents
Max Bolingbroke [Wed, 16 Feb 2011 16:13:40 +0000 (16:13 +0000)]
Scale columns in cost-centre-stack report to their contents

13 years agoChange typechecker-trace output slightly
simonpj@microsoft.com [Thu, 17 Feb 2011 17:59:04 +0000 (17:59 +0000)]
Change typechecker-trace output slightly

13 years agoComments only
simonpj@microsoft.com [Thu, 17 Feb 2011 17:58:40 +0000 (17:58 +0000)]
Comments only

13 years agoFix Trac #4966
simonpj@microsoft.com [Thu, 17 Feb 2011 14:10:00 +0000 (14:10 +0000)]
Fix Trac #4966

This is just a program that exploits overlapping
instances in a delicate way. The fix makes GHC
a bit more friendly towards such programs.

See Note [Overlap and deriving] in TcSimplify

13 years agoUse "on the spot" solving for fundeps
simonpj@microsoft.com [Thu, 17 Feb 2011 14:09:21 +0000 (14:09 +0000)]
Use "on the spot" solving for fundeps

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

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

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

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

This patch also contains a couple of unrelated improvements

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

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

13 years agoIncrease exprIsDupable threshold a bit
simonpj@microsoft.com [Tue, 15 Feb 2011 14:39:21 +0000 (14:39 +0000)]
Increase exprIsDupable threshold a bit

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

13 years agoEnsure exprIsCheap/exprIsExpandable deal with Cast properly
simonpj@microsoft.com [Tue, 15 Feb 2011 14:36:55 +0000 (14:36 +0000)]
Ensure exprIsCheap/exprIsExpandable deal with Cast properly

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

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

13 years agoDo not treat absentError specially
simonpj@microsoft.com [Tue, 15 Feb 2011 14:35:04 +0000 (14:35 +0000)]
Do not treat absentError specially

(This was part of an experiment I abandoned.)

13 years agoFix exprIsDupable
simonpj@microsoft.com [Mon, 14 Feb 2011 11:15:12 +0000 (11:15 +0000)]
Fix exprIsDupable

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

This patch makes it much less aggressive.

13 years agoBetter case-of-case transformation
simonpj@microsoft.com [Mon, 14 Feb 2011 11:11:51 +0000 (11:11 +0000)]
Better case-of-case transformation

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

13 years agoCleaned up Expr and Vectorise
keller@.cse.unsw.edu.au [Tue, 15 Feb 2011 01:44:34 +0000 (01:44 +0000)]
Cleaned up Expr and Vectorise

13 years agoFixed two syntax errors
keller@.cse.unsw.edu.au [Mon, 14 Feb 2011 02:05:31 +0000 (02:05 +0000)]
Fixed two syntax errors

13 years agoHandling of recursive scalar functions in isScalarLam
keller@cse.unsw.edu.au [Mon, 14 Feb 2011 00:29:45 +0000 (00:29 +0000)]
Handling of recursive scalar functions in isScalarLam

13 years agoAdded handling of non-recursive module global functions to isScalar check
keller@cse.unsw.edu.au [Wed, 9 Feb 2011 04:28:55 +0000 (04:28 +0000)]
Added handling of non-recursive module global functions to isScalar check

13 years ago(no commit message)
keller@cse.unsw.edu.au [Wed, 2 Feb 2011 05:14:08 +0000 (05:14 +0000)]

13 years agoRemoved minor bug
keller@cse.unsw.edu.au [Wed, 2 Feb 2011 04:08:26 +0000 (04:08 +0000)]
Removed minor bug

13 years agoadded handling of data constructors to vectLam
keller@cse.unsw.edu.au [Tue, 1 Feb 2011 04:28:07 +0000 (04:28 +0000)]
added handling of data constructors to vectLam

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