Simon Marlow [Tue, 3 Jul 2012 14:18:33 +0000 (15:18 +0100)]
mainly tidyup
Simon Marlow [Thu, 15 Mar 2012 13:18:13 +0000 (13:18 +0000)]
BlockId == Int now
Simon Marlow [Thu, 15 Mar 2012 13:08:11 +0000 (13:08 +0000)]
some optimisations
Simon Marlow [Thu, 15 Mar 2012 13:07:57 +0000 (13:07 +0000)]
a bit more UNPACKing
Simon Marlow [Thu, 15 Mar 2012 13:01:16 +0000 (13:01 +0000)]
remove dead code
Simon Marlow [Tue, 13 Mar 2012 13:24:16 +0000 (13:24 +0000)]
Remove dead code and optimise a bit
Simon Marlow [Tue, 13 Mar 2012 13:23:59 +0000 (13:23 +0000)]
a couple of minor optimisations
Simon Marlow [Tue, 13 Mar 2012 13:23:41 +0000 (13:23 +0000)]
take the analyses out of the FuelUniqSM monad
Simon Marlow [Tue, 13 Mar 2012 13:22:05 +0000 (13:22 +0000)]
refactoring and comments
Simon Marlow [Fri, 9 Mar 2012 11:06:25 +0000 (11:06 +0000)]
Remove the old stack layout algorithms
Also, do removeDeadAssignments instead of cmmLiveness before stack
allocation, because the former also does liveness analysis, and we can
do just one liveness analysis instead of two. The stack layout
algorithm doesn't introduce any dead assignments, so this doesn't
affect the generated code.
Max Bolingbroke [Fri, 9 Mar 2012 23:47:46 +0000 (23:47 +0000)]
Add type signature necessary for GHC 7.0.4
Simon Marlow [Fri, 9 Mar 2012 10:59:08 +0000 (10:59 +0000)]
fix another bug in CmmOpt
Simon Marlow [Thu, 8 Mar 2012 14:54:44 +0000 (14:54 +0000)]
An optimisation to reduce code size in a common case
Simon Marlow [Thu, 8 Mar 2012 13:32:49 +0000 (13:32 +0000)]
Refactoring only
Simon Marlow [Wed, 7 Mar 2012 15:38:58 +0000 (15:38 +0000)]
Lower safe foreign calls separately from stack layout
Simon Marlow [Wed, 7 Mar 2012 15:06:47 +0000 (15:06 +0000)]
Improve the case-alternative heap checks
The code we were generating for heap-checks in algebraic case
alternatives wasn't working well with the common-block eliminator. A
small tweak to make the heap-check failure jump back to the same place
in all branches lets the common-block eliminator squash more code.
Simon Marlow [Wed, 7 Mar 2012 15:04:25 +0000 (15:04 +0000)]
Improve common-block elimination
We need to compare middle nodes and expressions modulo the BlockId
mapping too, because there are references to BlockIds in CmmStackSlot
and CmmBlock. This lets us catch more common blocks - in particular
we can share the heap-check fail code between multiple case
alternatives, which is most cool.
Simon Marlow [Wed, 7 Mar 2012 15:02:34 +0000 (15:02 +0000)]
Fix a bug in common block elimination
When we had more than two identical blocks, we weren't eliminating all
the duplicates properly.
Simon Marlow [Wed, 7 Mar 2012 14:55:18 +0000 (14:55 +0000)]
fix the updfr offset in the jump after newCAF
Simon Marlow [Wed, 7 Mar 2012 14:54:41 +0000 (14:54 +0000)]
refactoring only
Simon Marlow [Tue, 6 Mar 2012 12:24:40 +0000 (12:24 +0000)]
Lower safe foreign calls in the new CmmLayoutStack
We also generate much better code for safe foreign calls (and maybe
also unsafe foreign calls) than previously. See the two new Notes:
Note [lower safe foreign calls]
Note [safe foreign call convention]
Simon Marlow [Fri, 2 Mar 2012 15:41:34 +0000 (15:41 +0000)]
fixes to the mini-inliner (fixes stage2 crashes)
Simon Marlow [Tue, 6 Mar 2012 13:28:13 +0000 (13:28 +0000)]
Revert "Revert "Improvements to the mini-inliner""
This reverts commit
5ff03ca7f3b5b1abad64c039fa20165b4cf77360.
Simon Marlow [Fri, 2 Mar 2012 13:12:53 +0000 (13:12 +0000)]
Revert "Improvements to the mini-inliner"
This reverts commit
3d8ab554ced45c51f39951f29cc53277d5788c37.
Simon Marlow [Sun, 19 Feb 2012 13:04:37 +0000 (13:04 +0000)]
Merge branch 'newcg' of /home/simonmar/code-all/work/ghc-newcg into newcg
Simon Marlow [Sun, 19 Feb 2012 13:04:34 +0000 (13:04 +0000)]
remove some obsolete notes
Simon Marlow [Wed, 15 Feb 2012 12:57:24 +0000 (12:57 +0000)]
New codegen: fix bad code for comparisons (see Note [case on bool])
Simon Marlow [Wed, 15 Feb 2012 12:56:38 +0000 (12:56 +0000)]
Improvements to the mini-inliner
- inline x = R1, even if x occurs many times
- inline past a store, if the expression is not a load
(we could further refine this of course, but the idea here
is to get reasonable code for not much effort)
Simon Marlow [Wed, 15 Feb 2012 11:11:18 +0000 (11:11 +0000)]
re-enable constant folding in the NCG, while cmmRewriteAssignments is off
Me at work [Tue, 14 Feb 2012 11:49:53 +0000 (11:49 +0000)]
Merge remote-tracking branch 'laptop/newcg' into newcg
Simon Marlow [Tue, 14 Feb 2012 11:46:33 +0000 (11:46 +0000)]
Delete some done items
Simon Marlow [Tue, 14 Feb 2012 11:46:13 +0000 (11:46 +0000)]
kill some dead code
Simon Marlow [Tue, 14 Feb 2012 11:46:02 +0000 (11:46 +0000)]
Eliminate some redundant stack assignments and empty stack checks
Simon Marlow [Tue, 14 Feb 2012 11:45:25 +0000 (11:45 +0000)]
tiny refactoring
Simon Marlow [Tue, 14 Feb 2012 11:44:55 +0000 (11:44 +0000)]
Fix an SRT-related bug
We were using the SRT information generated by the computeSRTs pass to
decide whether to add a static link field to a constructor or not, and
this broke when I disabled computeSRTs for the new code generator. So
I've hacked it for now to only rely on the SRT information generated
by CoreToStg.
Simon Marlow [Mon, 13 Feb 2012 22:08:45 +0000 (22:08 +0000)]
remove unused Conventions (Foreign, Private)
Simon Marlow [Mon, 13 Feb 2012 21:54:09 +0000 (21:54 +0000)]
merge fixes
Simon Marlow [Mon, 13 Feb 2012 21:28:55 +0000 (21:28 +0000)]
disable GADTs again (causes problems with no-let-generalisation)
Simon Marlow [Mon, 13 Feb 2012 21:19:21 +0000 (21:19 +0000)]
Merge remote-tracking branch 'origin/master' into newcg
Conflicts:
compiler/cmm/CmmLint.hs
compiler/cmm/OldCmm.hs
compiler/codeGen/CgMonad.lhs
compiler/main/CodeOutput.lhs
Simon Marlow [Mon, 13 Feb 2012 13:22:20 +0000 (13:22 +0000)]
Revert "Don't add a bad import to the saved context."
This reverts commit
e5272d9bf2a65b7da8364803fcafbd2012b7de97.
Reverting to fix validate regression, and pending a redesign of the
changes.
Simon Marlow [Mon, 13 Feb 2012 13:21:42 +0000 (13:21 +0000)]
Revert "Have :load work under -XSafe in GHCi."
This reverts commit
5e9e07a33e17da01245f0cea78e6a6f8a32ac77d.
Reverting to fix validate regression, and pending a redesign of the
changes.
Simon Marlow [Mon, 13 Feb 2012 11:18:08 +0000 (11:18 +0000)]
.cmm files need to depend on DerivedConstants.h
Simon Marlow [Mon, 13 Feb 2012 11:17:50 +0000 (11:17 +0000)]
Allocate pinned object blocks from the nursery, not the global
allocator.
Prompted by a benchmark posted to parallel-haskell@haskell.org by
Andreas Voellmy <andreas.voellmy@gmail.com>. This program exhibits
contention for the block allocator when run with -N2 and greater
without the fix:
{-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-}
module Main where
import Control.Monad
import Control.Concurrent
import System.Environment
import GHC.IO
import GHC.Exts
import GHC.Conc
main = do
[m] <- fmap (fmap read) getArgs
n <- getNumCapabilities
ms <- replicateM n newEmptyMVar
sequence [ forkIO $ busyWorkerB (m `quot` n) >> putMVar mv () | mv <- ms ]
mapM takeMVar ms
busyWorkerB :: Int -> IO ()
busyWorkerB n_loops = go 0
where go !n | n >= n_loops = return ()
| otherwise =
do p <- (IO $ \s ->
case newPinnedByteArray# 1024# s of
{ (# s', mbarr# #) ->
(# s', () #)
}
)
go (n+1)
Simon Hengel [Wed, 8 Feb 2012 07:38:35 +0000 (08:38 +0100)]
Minor documentation fix
Add a missing 'to' to the documentation of "Safe Haskell".
Ian Lynagh [Sat, 11 Feb 2012 14:23:56 +0000 (14:23 +0000)]
Improve FreeBSD support in configure
Patch from Sergei Trofimovich.
Ian Lynagh [Sat, 11 Feb 2012 13:33:01 +0000 (13:33 +0000)]
Add dragonfly support; based on a patch from Goetz Isenmann
Ian Lynagh [Fri, 10 Feb 2012 19:38:51 +0000 (19:38 +0000)]
Fix some more sh syntax in configure.ac
Gabor Pali [Wed, 8 Feb 2012 17:30:38 +0000 (17:30 +0000)]
Fix equality testing for test(1) on FreeBSD
David Terei [Thu, 9 Feb 2012 11:45:24 +0000 (03:45 -0800)]
Have :load work under -XSafe in GHCi.
David Terei [Thu, 9 Feb 2012 02:35:54 +0000 (18:35 -0800)]
Don't add a bad import to the saved context.
Importing an unsafe module in GHCi under -XSafe would fail
but still save that in the context so it would be retried
on every subsequent import.
David Terei [Thu, 9 Feb 2012 01:24:49 +0000 (17:24 -0800)]
Don't allow implicit qualified imports in GHCi when -XSafe on.
It would be better to actually check the safety of the import but doing
that requires some significant refactoring of code so punting for
another day.
Ian Lynagh [Fri, 10 Feb 2012 16:12:21 +0000 (16:12 +0000)]
Add script for sending bug remilestoning e-mails
Simon Peyton Jones [Fri, 10 Feb 2012 15:34:07 +0000 (15:34 +0000)]
Merge branch 'master' of darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 10 Feb 2012 15:33:53 +0000 (15:33 +0000)]
Complete fix of #5820
There are two related changes in here
a) Fix TcRnDriver.setInteractiveContext so that it initialises
tcg_insts and tcg_fam_insts, as well as the corresponding
tcg_inst_env and tcg_fam_inst_env fields. Vital!
b) Fix FamInst.tcExtendLocalFamInstEnv for the GHCi case.
It had a special HACK to allow family instances to be overridden
in GHCi. Fair enough, but
* It was only affecting the tcg_fam_inst_env, not tcg_fam_insts
* It overrode home-package instances as well as ones entered
at the GHCi prompt, which probably wasn't intended.
I fixed both of these, and also narrowed the scope of what it does
to override only *identical* instances, rather than any ones that
conflict. If people yelp about this we can return to the question,
but for now it narrows the range of the HACK
Simon Peyton Jones [Fri, 10 Feb 2012 11:15:43 +0000 (11:15 +0000)]
Document -fwarn-auto-orphans
Simon Peyton Jones [Fri, 10 Feb 2012 10:46:16 +0000 (10:46 +0000)]
Put only local instances in the interactive context (fixes Trac #5820)
In HscMain.hscDeclsWithLocaion, we were grabbing class instances from
the tcg_inst_env field of the TcGblEnv. But that's wrong: that field
contains all the *home-package* instances. Instead we need the
tct_insts field, which has just the instances from the module being
compiled.
Trevor Elliott [Thu, 9 Feb 2012 19:53:34 +0000 (11:53 -0800)]
Distinguish between normal and qualified unused imports
Ian Lynagh [Fri, 10 Feb 2012 01:23:10 +0000 (01:23 +0000)]
Fix the build on Windows
WhatGccIsCalled was no longer being defined on Windows.
Spotted by Niklas Larsson.
David Terei [Thu, 9 Feb 2012 00:18:18 +0000 (16:18 -0800)]
Fix '-distrust-all-packages' flag.
Simon Marlow [Wed, 8 Feb 2012 15:49:50 +0000 (15:49 +0000)]
a build system fix that is already on HEAD
Simon Marlow [Wed, 8 Feb 2012 15:49:27 +0000 (15:49 +0000)]
just comments
Simon Marlow [Wed, 8 Feb 2012 15:49:15 +0000 (15:49 +0000)]
Port the old CmmLint to the new Cmm representation
Simon Marlow [Wed, 8 Feb 2012 15:48:34 +0000 (15:48 +0000)]
Build info tables with the new stack layout code
Simon Marlow [Wed, 8 Feb 2012 15:47:28 +0000 (15:47 +0000)]
fix a bug
Simon Marlow [Fri, 3 Feb 2012 15:03:06 +0000 (15:03 +0000)]
New stack layout algorithm
Also:
- improvements to code generation: push slow-call continuations
on the stack instead of generating explicit continuations
- remove unused CmmInfo wrapper type (replace with CmmInfoTable)
- squash Area and AreaId together, remove now-unused RegSlot
- comment out old unused stack-allocation code that no longer
compiles after removal of RegSlot
Ian Lynagh [Mon, 12 Dec 2011 21:20:08 +0000 (21:20 +0000)]
MERGE from 7.4 branch: Update dependencies
Ian Lynagh [Tue, 7 Feb 2012 21:30:35 +0000 (21:30 +0000)]
Remove a workaround for building with GHC 6.12.2
Ben Gamari [Mon, 30 Jan 2012 21:52:40 +0000 (16:52 -0500)]
ARM StgRun: Ensure r11 state is preserved
Simon Marlow [Tue, 7 Feb 2012 09:27:18 +0000 (09:27 +0000)]
Ignore -C when not unregisterised (reported on ghc-users)
Simon Marlow [Thu, 2 Feb 2012 10:28:34 +0000 (10:28 +0000)]
avoid 32-bit integer overflow (#5831)
Simon Marlow [Wed, 1 Feb 2012 12:57:54 +0000 (12:57 +0000)]
Check that imported modules actually exist (#5836)
Simon Marlow [Fri, 6 Jan 2012 22:01:53 +0000 (22:01 +0000)]
comments
Simon Peyton Jones [Mon, 6 Feb 2012 08:42:54 +0000 (08:42 +0000)]
Merge branch 'master' of darcs.haskell.org/ghc
Simon Peyton Jones [Mon, 6 Feb 2012 08:42:38 +0000 (08:42 +0000)]
Refactor tcUserStmt, to fix Trac #5829
The problem was that the FunBind we we build in the expression case
didn't have the right free variables, and that tripped an ASSERT later.
Simon Peyton Jones [Mon, 6 Feb 2012 08:40:44 +0000 (08:40 +0000)]
Give promoted DataCons a tyConArity and promoted TyCons a tyConKind
..and fix up Core Lint. (I was getting a bogus Core Lint failure.)
Simon Peyton Jones [Mon, 6 Feb 2012 08:38:59 +0000 (08:38 +0000)]
Refactor HsDecls again, to put family instances in InstDecl
This continues the clean up of the front end. Since they
were first invented, type and data family *instance* decls
have been in the TyClDecl data type, even though they always
treated separately.
This patch takes a step in the right direction
* The InstDecl type now includes both class instances and
type/data family instances
* The hs_tyclds field of HsGroup now never has any family
instance declarations in it
However a family instance is still a TyClDecl. It should really
be a separate type, but that's the next step.
All this was provoked by fixing Trac #5792 in the HEAD.
(I did a less invasive fix on the branch.)
Simon Marlow [Fri, 3 Feb 2012 15:02:05 +0000 (15:02 +0000)]
add mapSuccessors
Simon Marlow [Fri, 3 Feb 2012 15:01:53 +0000 (15:01 +0000)]
Small improvement to control-flow optimisation
Simon Marlow [Fri, 3 Feb 2012 15:01:26 +0000 (15:01 +0000)]
comments
Ian Lynagh [Thu, 2 Feb 2012 21:38:29 +0000 (21:38 +0000)]
Add a "tag" command to sync-all
Ian Lynagh [Thu, 2 Feb 2012 19:21:20 +0000 (19:21 +0000)]
Don't include Cabal in mkDocs
Cabal no longer has a userguide that we know how to build, so we
can't include it in our docs.
Simon Peyton Jones [Wed, 1 Feb 2012 15:51:30 +0000 (15:51 +0000)]
When type-checking kinds, be sure to promote list and tuple syntax
This fixes the ASSERT failure in Trac #5833 and type error in #5798
David Terei [Tue, 31 Jan 2012 02:24:01 +0000 (18:24 -0800)]
Improve support for LLVM >= 3.0 write barrier. (#5814)
Ben Gamari [Wed, 25 Jan 2012 00:56:35 +0000 (19:56 -0500)]
llvmGen: Use new fence instruction
Signed-off-by: David Terei <davidterei@gmail.com>
Simon Marlow [Mon, 30 Jan 2012 14:43:53 +0000 (14:43 +0000)]
Validate fix: no cross compilation for bindists
Maybe we could revisit whether we want to allow building bindists of
cross-compilers later, but for now I'm fixing validate by setting all
the cross-compilation settings to NO.
Simon Marlow [Mon, 30 Jan 2012 13:00:04 +0000 (13:00 +0000)]
don't inline foldExpDeep
Simon Marlow [Mon, 30 Jan 2012 11:29:29 +0000 (11:29 +0000)]
message tweak
Simon Marlow [Mon, 30 Jan 2012 11:19:03 +0000 (11:19 +0000)]
Improve support for cross-compilation
Patchset from Stephen Blackheath <stephen.blackheath@ipwnstudios.com>
Ben Gamari [Sat, 28 Jan 2012 21:55:04 +0000 (16:55 -0500)]
Fix register clobber list in StgRun for ARM
The ARM implementation of StgRun does not claim that it clobbers r7-r12. As a
result, the compiler will sometimes put the returned RegTable in one of these
registers, resulting in an invalid RegTable to be returned. Hilarity ensues.
Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
Simon Marlow [Mon, 23 Jan 2012 10:23:36 +0000 (10:23 +0000)]
Remove bogus extra definition of $(dir)
This was preventing things like 'cd compiler; make stage2/build/DynFlags.o'
from working.
Ian Lynagh [Sat, 28 Jan 2012 23:33:11 +0000 (23:33 +0000)]
Pass alex and happy locations to ghc-cabal; fixes #5579
We only use --with-alex / --with-happy if we know where alex / happy
are. In particular, we don't need them when building from a source
tarball.
Ian Lynagh [Sat, 28 Jan 2012 17:26:06 +0000 (17:26 +0000)]
Start on 7.6.1 release notes
Jose Pedro Magalhaes [Fri, 27 Jan 2012 13:40:31 +0000 (14:40 +0100)]
FIX #5819: add -XDataKinds to the language options section of the user's guide
Simon Marlow [Fri, 27 Jan 2012 11:22:07 +0000 (11:22 +0000)]
Move the 2nd control-flow optimisation pass
It was causing wrong info tables where it was; I'm not entirely sure
why.
Simon Marlow [Fri, 27 Jan 2012 10:03:46 +0000 (10:03 +0000)]
Thread the UniqSupply around properly
Simon Marlow [Fri, 27 Jan 2012 09:53:48 +0000 (09:53 +0000)]
Make the old codegen run in constant space too
Simon Marlow [Fri, 27 Jan 2012 09:52:04 +0000 (09:52 +0000)]
Don't call computeSRTs when -fnew-codegen is on
Ian Lynagh [Wed, 25 Jan 2012 16:30:36 +0000 (16:30 +0000)]
de-tabbed the hs-boot files
Ian Lynagh [Wed, 25 Jan 2012 13:19:58 +0000 (13:19 +0000)]
Rename polyKindsErr to dataKindsErr
Ian Lynagh [Wed, 25 Jan 2012 13:15:55 +0000 (13:15 +0000)]
Just rename a local variable