ghc.git
5 years agoImplement recursive compatibility check for closed type families. wip/recurs-compat
Richard Eisenberg [Sat, 22 Mar 2014 17:16:26 +0000 (13:16 -0400)] 
Implement recursive compatibility check for closed type families.

Now, on a closed type family, two branches are considered compatible
if their RHSs **normalize** to the same type. Previously, the RHSs
had to be identical (under the unifying substitution). This allows
more reductions -- yay.

CAVEAT: This is probably not type-safe with UndecidableInstances.
Someone (er... me) has to Think Hard about this before merging.
It might be unsafe even with imported non-terminating instances
(so, without UndecidableInstances in the same module).
There's a change this isn't type-safe even without UndecidableInstances,
but I'm not too worried about that possibility.

5 years agoFix #8917.
Richard Eisenberg [Sat, 22 Mar 2014 17:13:26 +0000 (13:13 -0400)] 
Fix #8917.

FamInstEnv.normaliseTcApp should normalise arguments even when
the top-level tycon isn't a type family. This was a regression
from 7.6 -- not sure when it happened, but it was probably my
fault. Fixed now, in any case.

5 years agoAdd test case for #8917
Richard Eisenberg [Sat, 22 Mar 2014 16:34:40 +0000 (12:34 -0400)] 
Add test case for #8917

5 years agoRemove redundant compatibility check.
Richard Eisenberg [Sat, 22 Mar 2014 03:40:47 +0000 (23:40 -0400)] 
Remove redundant compatibility check.

Previously, the closed type family compatibility check was
done even when type-checking an interface file. But interface
files now store compatibility info, so this check was redundant.

5 years agoComments only -- clarifying Notes around compatibility.
Richard Eisenberg [Fri, 21 Mar 2014 21:22:10 +0000 (17:22 -0400)] 
Comments only -- clarifying Notes around compatibility.

5 years agoMake cabal01 pass with Cabal 1.18 (#8738).
Mikhail Glushenkov [Tue, 4 Mar 2014 07:02:36 +0000 (08:02 +0100)] 
Make cabal01 pass with Cabal 1.18 (#8738).

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoEnable popcnt test now when segfault is fixed
Johan Tibell [Sat, 22 Mar 2014 17:30:36 +0000 (18:30 +0100)] 
Enable popcnt test now when segfault is fixed

The fix was to ghc-prim.

5 years agoFollow hs_popcntX changes in ghc-prim
Johan Tibell [Sat, 22 Mar 2014 17:29:29 +0000 (18:29 +0100)] 
Follow hs_popcntX changes in ghc-prim

5 years agoMark test for #8831 as known-broken
Joachim Breitner [Sat, 22 Mar 2014 10:53:03 +0000 (11:53 +0100)] 
Mark test for #8831 as known-broken

to keep validate working.

5 years agocodeGen: inline allocation optimization for clone array primops
Johan Tibell [Thu, 13 Mar 2014 08:35:21 +0000 (09:35 +0100)] 
codeGen: inline allocation optimization for clone array primops

The inline allocation version is 69% faster than the out-of-line
version, when cloning an array of 16 unit elements on a 64-bit
machine.

Comparing the new and the old primop implementations isn't
straightforward. The old version had a missing heap check that I
discovered during the development of the new version. Comparing the
old and the new version would requiring fixing the old version, which
in turn means reimplementing the equivalent of MAYBE_CG in StgCmmPrim.

The inline allocation threshold is configurable via
-fmax-inline-alloc-size which gives the maximum array size, in bytes,
to allocate inline. The size does not include the closure header size.

Allowing the same primop to be either inline or out-of-line has some
implication for how we lay out heap checks. We always place a heap
check around out-of-line primops, as they may allocate outside of our
knowledge. However, for the inline primops we only allow allocation
via the standard means (i.e. virtHp). Since the clone primops might be
either inline or out-of-line the heap check layout code now consults
shouldInlinePrimOp to know whether a primop will be inlined.

5 years agoUpdate ghc --help references to --make and a.out (fixes #8600)
ccatalfo [Wed, 12 Mar 2014 02:11:11 +0000 (22:11 -0400)] 
Update ghc --help references to --make and a.out (fixes #8600)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agolinker: Fix indirect calls for x86_64 windows (#2283)
Kyrill Briantsev [Fri, 21 Mar 2014 10:42:48 +0000 (05:42 -0500)] 
linker: Fix indirect calls for x86_64 windows (#2283)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agotestsuite: add test for #8831
Austin Seipp [Fri, 21 Mar 2014 09:42:32 +0000 (04:42 -0500)] 
testsuite: add test for #8831

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoTypos
Austin Seipp [Fri, 21 Mar 2014 09:36:23 +0000 (04:36 -0500)] 
Typos

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFlush after TH in #8884 test case
Joachim Breitner [Fri, 21 Mar 2014 12:46:15 +0000 (13:46 +0100)] 
Flush after TH in #8884 test case

(I recall that this was needed in some cases in the past, and might fix
the validate error on travis.)

5 years agoDon't use gcptr for interior pointers
Johan Tibell [Thu, 20 Mar 2014 06:58:10 +0000 (07:58 +0100)] 
Don't use gcptr for interior pointers

gcptr should only be used for pointers that the GC should
follow. While this didn't cause any bugs right now, since these
variables aren't live over a GC, it's clearer to use the right type.

5 years agoUpdate expected test outputs to match new format of pretty-printing
Dr. ERDI Gergo [Wed, 19 Mar 2014 13:44:38 +0000 (21:44 +0800)] 
Update expected test outputs to match new format of pretty-printing
interface contents

5 years agoisLexVarSym: check all characters of the name, not just the first one.
Dr. ERDI Gergo [Wed, 19 Mar 2014 12:07:47 +0000 (20:07 +0800)] 
isLexVarSym: check all characters of the name, not just the first one.

This is so that generated names like e.g. workers don't show up as
infix operators when using something like -ddump-simpl.

5 years agoImplement ordering comparisons for type-level naturals and symbols.
Iavor S. Diatchki [Wed, 19 Mar 2014 01:54:23 +0000 (18:54 -0700)] 
Implement ordering comparisons for type-level naturals and symbols.

This is done with two built-in type families: `CmpNat and `CmpSymbol`.
Both of these return a promoted `Ordering` type (EQ, LT, or GT).

5 years agoMake sure we occurrence-analyse unfoldings (fixes Trac #8892)
Simon Peyton Jones [Tue, 18 Mar 2014 17:10:18 +0000 (17:10 +0000)] 
Make sure we occurrence-analyse unfoldings (fixes Trac #8892)

For DFunUnfoldings we were failing to occurrence-analyse the unfolding,
and that meant that a loop breaker wasn't marked as such, which in turn
meant it was inlined away when it still had occurrence sites.  See
Note [Occurrrence analysis of unfoldings] in CoreUnfold.

This is a pretty long-standing bug, happily nailed by John Lato.

5 years agoUpdate submodule to Win32-2.3.0.2
Herbert Valerio Riedel [Tue, 18 Mar 2014 10:06:57 +0000 (11:06 +0100)] 
Update submodule to Win32-2.3.0.2

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoAdd some documentation about type-level literals.
Iavor S. Diatchki [Tue, 18 Mar 2014 06:19:16 +0000 (23:19 -0700)] 
Add some documentation about type-level literals.

I moved the "promoted literals" sub-section into a separate section,
as many folks were not finding the docs.  I also added some additional
paragraphs describing the current state of the feature.

5 years agoTest case: ghci059: Forgot stdout file
Joachim Breitner [Mon, 17 Mar 2014 14:34:54 +0000 (15:34 +0100)] 
Test case: ghci059: Forgot stdout file

5 years agoTest Trac #8889
Simon Peyton Jones [Mon, 17 Mar 2014 13:50:54 +0000 (13:50 +0000)] 
Test Trac #8889

5 years agoMore debug info
Simon Peyton Jones [Fri, 14 Mar 2014 13:50:29 +0000 (13:50 +0000)] 
More debug info

5 years agoComments only
Simon Peyton Jones [Fri, 14 Mar 2014 13:50:14 +0000 (13:50 +0000)] 
Comments only

5 years agoFix validation issue due to Coercible move (#8894)
Joachim Breitner [Mon, 17 Mar 2014 13:43:31 +0000 (14:43 +0100)] 
Fix validation issue due to Coercible move (#8894)

5 years agoRevert ad15c2, which causes Windows seg-faults (Trac #8834)
Simon Peyton Jones [Fri, 14 Mar 2014 22:55:26 +0000 (22:55 +0000)] 
Revert ad15c2, which causes Windows seg-faults (Trac #8834)

We don't yet understand WHY commit ad15c2, which is to do with
CmmSink, causes seg-faults on Windows, but it certainly seems to.  So
reverting it is a stop-gap, but we need to un-block the 7.8 release.

Many thanks to awson for identifying the offending commit.

5 years agoUnflatten the constraints of an inferred types (Trac #8889)
Simon Peyton Jones [Fri, 14 Mar 2014 22:51:20 +0000 (22:51 +0000)] 
Unflatten the constraints of an inferred types (Trac #8889)

There was even a comment to warn about this possiblity,
and it finally showed up in practice!  This patch fixes
it quite nicely, with commens to explain.

5 years agoRemove support for "primclass"
Joachim Breitner [Sun, 16 Mar 2014 17:39:27 +0000 (18:39 +0100)] 
Remove support for "primclass"

This partly reverts commit e239753c349f925b576b72dc3445934cba8bcd50. Since
Coercible is exported via GHC.Types, so "primclass" is no longer
needed. The support for => in primops.pp is still required for coerce.

5 years agoCoercible is now exported from GHC.Types (#8894)
Joachim Breitner [Sun, 16 Mar 2014 17:35:28 +0000 (18:35 +0100)] 
Coercible is now exported from GHC.Types (#8894)

so do not export it in GHC.Prim, and also have the pseudo-code for
GHC.Prim import GHC.Types, so that haddock is happy.

5 years agoFix comment for ghci script files
Joachim Breitner [Sun, 16 Mar 2014 16:40:51 +0000 (17:40 +0100)] 
Fix comment for ghci script files

(Unchecked comment-only commits should better use the right commenting
style...)

5 years agoTest case: :info Coercible in GHCi
Joachim Breitner [Sun, 16 Mar 2014 16:12:58 +0000 (17:12 +0100)] 
Test case: :info Coercible in GHCi

This prepares against future breakage, especially if #8894 is tackled.

5 years agoRemove code reporting issues with Safe Haskell and coerce.
Richard Eisenberg [Fri, 14 Mar 2014 19:03:21 +0000 (15:03 -0400)] 
Remove code reporting issues with Safe Haskell and coerce.

This is a followup to the fix for #8827, and should be merged
with that change.

5 years agoCall Arity test case: Check what happens with unboxed lets
Joachim Breitner [Fri, 14 Mar 2014 18:16:58 +0000 (19:16 +0100)] 
Call Arity test case: Check what happens with unboxed lets

5 years agoCall Arity: Never eta-expand thunks in recursive groups
Joachim Breitner [Fri, 14 Mar 2014 17:25:07 +0000 (18:25 +0100)] 
Call Arity: Never eta-expand thunks in recursive groups

Even if the recursion is a nice tail-call only recusion, we'd stil be
calling the thunk multiple times and eta-expansion would be wrong.
Includes a [Note].

(Also shows the disadvantage of unit tests: They had the same bug.)

5 years agoAdd test case for #8776
Dr. ERDI Gergo [Fri, 14 Mar 2014 14:34:56 +0000 (22:34 +0800)] 
Add test case for #8776

5 years agoReinstate pretty-printing of AnIds via pprId (#8776)
Dr. ERDI Gergo [Fri, 14 Mar 2014 14:17:45 +0000 (22:17 +0800)] 
Reinstate pretty-printing of AnIds via pprId (#8776)

5 years agoUse prefix notation in pprIfaceDecl for IfaceIds
Dr. ERDI Gergo [Fri, 14 Mar 2014 13:35:30 +0000 (21:35 +0800)] 
Use prefix notation in pprIfaceDecl for IfaceIds

5 years agoHonor Op_PrintExplicitForalls setting in pprIfaceForAllPart
Dr. ERDI Gergo [Fri, 14 Mar 2014 11:50:15 +0000 (19:50 +0800)] 
Honor Op_PrintExplicitForalls setting in pprIfaceForAllPart

5 years agoDocument Coercible in the user guide
Joachim Breitner [Fri, 14 Mar 2014 11:51:37 +0000 (12:51 +0100)] 
Document Coercible in the user guide

as a subsection of "Equality constraints", containing references to the
module's haddock and to the paper. Fixes #8888

5 years agoAnother reference to Note [Kind-changing of (~) and Coercible]
Joachim Breitner [Fri, 14 Mar 2014 11:26:26 +0000 (12:26 +0100)] 
Another reference to Note [Kind-changing of (~) and Coercible]

5 years agoReference Note [Kind-changing of (~) and Coercible]
Joachim Breitner [Fri, 14 Mar 2014 10:28:48 +0000 (11:28 +0100)] 
Reference  Note [Kind-changing of (~) and Coercible]

5 years agoUpdate to containers-0.5.5.1
Herbert Valerio Riedel [Fri, 14 Mar 2014 10:13:39 +0000 (11:13 +0100)] 
Update to containers-0.5.5.1

This fixes a wrong #if around role annotations (see #8718)

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agotestsuite: look for tests-ghc directories for libraries
Austin Seipp [Fri, 14 Mar 2014 09:26:50 +0000 (04:26 -0500)] 
testsuite: look for tests-ghc directories for libraries

Who knows how long the tests for containers have been broken. They
haven't bitrotted, however.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRemove unused gHC_COERCIBLE
Joachim Breitner [Fri, 14 Mar 2014 08:23:15 +0000 (09:23 +0100)] 
Remove unused gHC_COERCIBLE

5 years agoCall Arity : Note about fakeBoringCalls
Joachim Breitner [Wed, 12 Mar 2014 14:48:21 +0000 (15:48 +0100)] 
Call Arity : Note about fakeBoringCalls

5 years agoFix typo in user's manual, changing "-j N" to "-jN".
Richard Eisenberg [Thu, 13 Mar 2014 21:20:50 +0000 (17:20 -0400)] 
Fix typo in user's manual, changing "-j N" to "-jN".

5 years agoFix #8884.
Richard Eisenberg [Thu, 13 Mar 2014 19:48:56 +0000 (15:48 -0400)] 
Fix #8884.

There were two unrelated errors fixed here:
 1) Make sure that only the *result kind* is reified when reifying
    a type family. Previously, the whole kind was reified, which
    defies the TH spec.

 2) Omit kind patterns in equations.

5 years agoRecharacterize test according to discussion in #8851.
Richard Eisenberg [Thu, 13 Mar 2014 19:12:27 +0000 (15:12 -0400)] 
Recharacterize test according to discussion in #8851.

5 years agoRemove "Safe mode" check for Coercible instances
Richard Eisenberg [Thu, 13 Mar 2014 18:16:37 +0000 (14:16 -0400)] 
Remove "Safe mode" check for Coercible instances

We assume that library authors supply correct role annotations
for their types, and therefore we do not need to check for
the availability of data constructors in Safe mode. See
discussion in #8725. This effectively fixes #8827 and #8826.

5 years agocodeGen: allocate small byte arrays of statically known size inline
Johan Tibell [Wed, 12 Mar 2014 06:20:19 +0000 (07:20 +0100)] 
codeGen: allocate small byte arrays of statically known size inline

This results in a 57% runtime decrease when allocating an array of 128
bytes on a 64-bit machine.

Fixes #8876.

5 years agoFix T2110 now that base has map/coerce rule.
Austin Seipp [Thu, 13 Mar 2014 22:56:18 +0000 (17:56 -0500)] 
Fix T2110 now that base has map/coerce rule.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix incorrect maxStkSize calculation (#8858)
Kyrill Briantsev [Thu, 13 Mar 2014 22:00:17 +0000 (17:00 -0500)] 
Fix incorrect maxStkSize calculation (#8858)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoDriverPipeline: Ensure -globalopt is passed to LLVM opt
Ben Gamari [Thu, 6 Mar 2014 20:20:02 +0000 (21:20 +0100)] 
DriverPipeline: Ensure -globalopt is passed to LLVM opt

While -O1 and -O2 both include -globalopt, the order in which the passes are
run means that aliases aren't resolved which then causes llc to fall over.
See GHC bug #8855.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoconfig.mk.in: ARM now supports dynamic linking with the LLVM backend
Ben Gamari [Thu, 6 Mar 2014 20:22:28 +0000 (21:22 +0100)] 
config.mk.in: ARM now supports dynamic linking with the LLVM backend

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix incorrect blocksize calculation on Win64
Kyrill Briantsev [Wed, 12 Mar 2014 19:31:21 +0000 (14:31 -0500)] 
Fix incorrect blocksize calculation on Win64

Fixes #8839

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agodisable shared libs on sparc (linux/solaris) (fixes #8857)
Karel Gardas [Fri, 7 Mar 2014 10:36:37 +0000 (11:36 +0100)] 
disable shared libs on sparc (linux/solaris) (fixes #8857)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agofix SHELL makefile variable to be set by the configure script (fixes #8783)
Karel Gardas [Wed, 12 Mar 2014 15:14:49 +0000 (16:14 +0100)] 
fix SHELL makefile variable to be set by the configure script (fixes #8783)

The patch provided by Christian Maeder <Christian.Maeder@dfki.de>
Signed-off-by: Karel Gardas <karel.gardas@centrum.cz>
Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix two issues in stg_newArrayzh
Johan Tibell [Thu, 13 Mar 2014 21:24:24 +0000 (22:24 +0100)] 
Fix two issues in stg_newArrayzh

The implementations of newArray# and newArrayArray#, stg_newArrayzh
and stg_newArrayArrayzh, had three issues:

 * The condition for the loop that fills the array with the initial
   element was incorrect. It would write into the card table as
   well. The condition for the loop that filled the card table was
   never executed, as its condition was also wrong. In the end this
   didn't lead to any disasters as the value of the card table doesn't
   matter for newly allocated arrays.

 * The card table was unnecessarily initialized. The card table is
   only used when the array isn't copied, which new arrays always
   are. By not writing the card table at all we save some cycles.

 * The ticky allocation accounting was wrong. The second argument to
   TICK_ALLOC_PRIM is the size of the closure excluding the header
   size, but the header size was incorrectly included.

Fixes #8867.

5 years agoUpdate to containers-0.5.5.0
Herbert Valerio Riedel [Thu, 13 Mar 2014 21:09:56 +0000 (22:09 +0100)] 
Update to containers-0.5.5.0

This adds role annotations to Map and Set and therefore addresses #8718

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoImprove copy/clone array primop docs
Johan Tibell [Thu, 13 Mar 2014 17:10:41 +0000 (18:10 +0100)] 
Improve copy/clone array primop docs

Clarify the order of the arguments. Also, remove any use of # in the
comments, which would make the rest of that comment line disappear in
the docs, due to being treated as a comment by the preprocessor.

5 years agoPretty-print the following TyThings via their IfaceDecl counterpart:
Dr. ERDI Gergo [Thu, 13 Mar 2014 13:18:39 +0000 (21:18 +0800)] 
Pretty-print the following TyThings via their IfaceDecl counterpart:
 * AnId
 * ACoAxiom
 * AConLike

5 years agopprIfaceDecl for IfacePatSyn: use pprPatSynSig
Dr. ERDI Gergo [Wed, 12 Mar 2014 12:38:54 +0000 (20:38 +0800)] 
pprIfaceDecl for IfacePatSyn: use pprPatSynSig

5 years agopprIfaceContextArr: print a context including the "=>" arrow
Dr. ERDI Gergo [Wed, 12 Mar 2014 12:38:26 +0000 (20:38 +0800)] 
pprIfaceContextArr: print a context including the "=>" arrow

5 years agoAdd OutputableBndr instance for OccName
Dr. ERDI Gergo [Wed, 12 Mar 2014 12:37:22 +0000 (20:37 +0800)] 
Add OutputableBndr instance for OccName

5 years agoTest Trac #8832
Simon Peyton Jones [Thu, 13 Mar 2014 12:24:49 +0000 (12:24 +0000)] 
Test Trac #8832

The test is a bit crude; -ddump-simpl | grep '#'.

I'm concerned that the -ddump-simpl output may differ on 32 and 64-bit
platforms.  So far I've only put in output for 64-bit platforms.

5 years agoAdd BuiltinRules for constant-folding not# and notI# (logical complement)
Simon Peyton Jones [Thu, 13 Mar 2014 12:15:52 +0000 (12:15 +0000)] 
Add BuiltinRules for constant-folding not# and notI# (logical complement)

I don't know why these constant-folding rules were implemented for
and/or/xor but not for 'not'.

Adding them is part of the fix for Trac #8832.
(The other part is in Data.Bits.)

5 years agoComments only
Simon Peyton Jones [Thu, 13 Mar 2014 12:14:11 +0000 (12:14 +0000)] 
Comments only

5 years agoExport runTcInteractive from TcRnDriver, and from GHC (Trac #8878)
Simon Peyton Jones [Thu, 13 Mar 2014 12:13:49 +0000 (12:13 +0000)] 
Export runTcInteractive from TcRnDriver, and from GHC (Trac #8878)

5 years agoA bit more tracing to do with SPECIALISE pragmas
Simon Peyton Jones [Thu, 13 Mar 2014 08:36:28 +0000 (08:36 +0000)] 
A bit more tracing to do with SPECIALISE pragmas

5 years agoComments on virtHp, realHp (Trac #8864)
Simon Peyton Jones [Tue, 11 Mar 2014 13:09:21 +0000 (13:09 +0000)] 
Comments on virtHp, realHp (Trac #8864)

Documentation in response to Johan's questions

Plus, don't export hpRel from StgCmmHeap, StgCmmLayout
  (it is only used locally in StgCmmLayout)

5 years agoCall Arity: Resurrect fakeBoringCalls
Joachim Breitner [Wed, 12 Mar 2014 10:15:16 +0000 (11:15 +0100)] 
Call Arity: Resurrect fakeBoringCalls

(Otherwise the analysis was wrong, as covered by the new test case.)

5 years agoAdd perf test for inline array allocation
Johan Tibell [Tue, 11 Mar 2014 21:39:00 +0000 (22:39 +0100)] 
Add perf test for inline array allocation

5 years agoValidate computed sums in inline array allocation test
Johan Tibell [Tue, 11 Mar 2014 21:12:31 +0000 (22:12 +0100)] 
Validate computed sums in inline array allocation test

5 years agoAdd test for inline array allocation
Johan Tibell [Tue, 11 Mar 2014 15:01:19 +0000 (16:01 +0100)] 
Add test for inline array allocation

5 years agoFix incorrect loop condition in inline array allocation
Johan Tibell [Tue, 11 Mar 2014 12:54:29 +0000 (13:54 +0100)] 
Fix incorrect loop condition in inline array allocation

Also make sure allocHeapClosure updates profiling counters with the
memory allocated.

5 years agoRefactor inline array allocation
Simon Marlow [Mon, 10 Mar 2014 21:43:15 +0000 (21:43 +0000)] 
Refactor inline array allocation

- Move array representation knowledge into SMRep

- Separate out low-level heap-object allocation so that we can reuse
  it from doNewArrayOp

- remove card-table initialisation, we can safely ignore the card
  table for newly allocated arrays.

5 years agoRepresent offsets into heap objects with byte, not word, offsets
Simon Marlow [Fri, 29 Nov 2013 10:32:26 +0000 (10:32 +0000)] 
Represent offsets into heap objects with byte, not word, offsets

I'd like to be able to pack together non-pointer fields that are less
than a word in size, and this is a necessary prerequisite.

5 years agocodeGen: allocate small arrays of statically known size inline
Johan Tibell [Wed, 25 Sep 2013 13:10:13 +0000 (09:10 -0400)] 
codeGen: allocate small arrays of statically known size inline

This results in a 46% runtime decrease when allocating an array of 16
unit elements on a 64-bit machine.

In order to allow newArray# to have both an inline and an out-of-line
implementation, cgOpApp is refactored slightly. The new implementation
of cgOpApp should make it easier to add other primops with both inline
and out-of-line implementations in the future.

5 years agoFix last-minute typo in SetLevels commit ef44a4
Simon Peyton Jones [Tue, 11 Mar 2014 12:47:57 +0000 (12:47 +0000)] 
Fix last-minute typo in SetLevels commit ef44a4

Sorry about that...

5 years agoMake SetLevels do substitution properly (fixes Trac #8714)
Simon Peyton Jones [Tue, 11 Mar 2014 11:13:31 +0000 (11:13 +0000)] 
Make SetLevels do substitution properly (fixes Trac #8714)

Nowadays SetLevels floats case expressions as well as let-bindings,
and case expressions bind type variables.  We need to clone all such
floated binders, to avoid accidental name capture.  But I'd forgotten
to substitute for the cloned type variables, causing #8714.  (In the
olden days only Ids were cloned, from let-bindings.)

This patch fixes the bug and does quite a bit of clean-up refactoring
as well, by putting the context level in the LvlEnv.

There is no effect on performance, except that nofib 'rewrite' improves
allocations by 3%.  On investigation I think it was a fluke to do with
loop-cutting in big letrec nests.  But at least it's a fluke in the
right direction.

        Program           Size    Allocs   Runtime   Elapsed  TotalMem
--------------------------------------------------------------------------------
            Min          -0.4%     -3.0%    -19.4%    -19.4%    -26.7%
            Max          -0.0%     +0.0%    +17.9%    +17.9%      0.0%
 Geometric Mean          -0.1%     -0.0%     -0.7%     -0.7%     -0.4%

5 years agoComments only
Simon Peyton Jones [Thu, 6 Mar 2014 11:54:33 +0000 (11:54 +0000)] 
Comments only

5 years agoFix copy-paste error in build system comment
Johan Tibell [Mon, 10 Mar 2014 17:59:21 +0000 (18:59 +0100)] 
Fix copy-paste error in build system comment

5 years agoAdd "bench" build flavour to build system
Johan Tibell [Mon, 10 Mar 2014 17:54:47 +0000 (18:54 +0100)] 
Add "bench" build flavour to build system

This build generates the same code as the "perf" build and is thus
good for compiling benchmarks and inspecting the generated
code. However, it compiles the stage2 compiler faster at the expense
of compiler user programs more slowly.

5 years agoUnify, rather than match, in GND processing (fixes Trac #8865)
Simon Peyton Jones [Mon, 10 Mar 2014 11:10:21 +0000 (11:10 +0000)] 
Unify, rather than match, in GND processing (fixes Trac #8865)

Yet another small way in which polymorphic kinds needs a bit of care
See Note [Unify kinds in deriving] in TcDeriv

5 years agoImprove documentation of standalone deriving (c.f. Trac #8851)
Simon Peyton Jones [Mon, 10 Mar 2014 11:08:37 +0000 (11:08 +0000)] 
Improve documentation of standalone deriving (c.f. Trac #8851)

5 years agoAlso allow http://github.com (#8824)
Joachim Breitner [Sat, 8 Mar 2014 00:11:42 +0000 (01:11 +0100)] 
Also allow http://github.com (#8824)

5 years agoTest Trac #8856
Simon Peyton Jones [Fri, 7 Mar 2014 17:15:15 +0000 (17:15 +0000)] 
Test Trac #8856

5 years agoFix the treatment of lexically scoped kind variables (Trac #8856)
Simon Peyton Jones [Fri, 7 Mar 2014 16:50:17 +0000 (16:50 +0000)] 
Fix the treatment of lexically scoped kind variables (Trac #8856)

The issue here is described in Note [Binding scoped type variables] in
TcPat.  When implementing this fix I was able to make things quite a
bit simpler:
 * The type variables in a type signature now never unify
   with each other, and so can be straightfoward skolems.
 * We only need the SigTv stuff for signatures in patterns,
   and for kind variables.

5 years agoMake -XDeriveFunctor more generous about non-last arguments (Trac #8678)
Simon Peyton Jones [Fri, 7 Mar 2014 16:45:55 +0000 (16:45 +0000)] 
Make -XDeriveFunctor more generous about non-last arguments (Trac #8678)

When deriving Functor, Foldable, Traversable, we need only look at the
way that the last type argument is treated.  It's fine for there to
be existentials etc, provided they don't affect the last type argument.

See Note [Check that the type variable is truly universal] in TcDeriv.

5 years agoMake sync-all handle all github protocols correctly
Joachim Breitner [Fri, 7 Mar 2014 15:50:43 +0000 (16:50 +0100)] 
Make sync-all handle all github protocols correctly

This fixes #8824.

5 years agoRun testcase for 8124 only with threaded ways
Joachim Breitner [Fri, 7 Mar 2014 15:05:39 +0000 (16:05 +0100)] 
Run testcase for 8124 only with threaded ways

5 years agoTest #8851.
Richard Eisenberg [Fri, 7 Mar 2014 04:44:57 +0000 (23:44 -0500)] 
Test #8851.

5 years agoTrac #8569 fixed
Simon Peyton Jones [Thu, 6 Mar 2014 12:13:17 +0000 (12:13 +0000)] 
Trac #8569 fixed

5 years agoTest for Trac #8841 now works
Simon Peyton Jones [Thu, 6 Mar 2014 12:13:05 +0000 (12:13 +0000)] 
Test for Trac #8841 now works

5 years agoAttach the right location to pattern synonym error message (fixes Trac #8841)
Simon Peyton Jones [Thu, 6 Mar 2014 11:32:55 +0000 (11:32 +0000)] 
Attach the right location to pattern synonym error message (fixes Trac #8841)

5 years agoMake the demand on a binder compatible with type (fixes Trac #8569)
Simon Peyton Jones [Thu, 6 Mar 2014 11:31:47 +0000 (11:31 +0000)] 
Make the demand on a binder compatible with type (fixes Trac #8569)

Because of GADTs and casts we were getting binders whose
demand annotation was more deeply nested than made sense
for its type.

See Note [Trimming a demand to a type], in Demand.lhs,
which I reproduce here:

   Note [Trimming a demand to a type]
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Consider this:

     f :: a -> Bool
     f x = case ... of
             A g1 -> case (x |> g1) of (p,q) -> ...
             B    -> error "urk"

   where A,B are the constructors of a GADT.  We'll get a U(U,U) demand
   on x from the A branch, but that's a stupid demand for x itself, which
   has type 'a'. Indeed we get ASSERTs going off (notably in
   splitUseProdDmd, Trac #8569).

   Bottom line: we really don't want to have a binder whose demand is more
   deeply-nested than its type.  There are various ways to tackle this.
   When processing (x |> g1), we could "trim" the incoming demand U(U,U)
   to match x's type.  But I'm currently doing so just at the moment when
   we pin a demand on a binder, in DmdAnal.findBndrDmd.

5 years agoAdd some debug tracing
Simon Peyton Jones [Thu, 6 Mar 2014 10:50:32 +0000 (10:50 +0000)] 
Add some debug tracing

5 years agoTypos in comments
Gabor Greif [Wed, 5 Mar 2014 20:13:31 +0000 (21:13 +0100)] 
Typos in comments