simonpj@microsoft.com [Thu, 9 Aug 2007 15:14:57 +0000 (15:14 +0000)]
Better scoring for loop breakers; fixes simplifier loop in nofib/minimax
See Note [Inline candidates] in OccurAnal. We were getting a recursive
loop exposed, which led to infinite inlinings. Doesn't bite much, but
was obviously wrong.
I've change the "scoring order" for loop breakers, which could possibly
have a performance impact on other programs. A full nofib run exposed
a 0.00% change in allocation in any nofib program, so I don't think it's
likely, but keep an eye out.
simonpj@microsoft.com [Fri, 3 Aug 2007 09:31:07 +0000 (09:31 +0000)]
Remove dead code
Simon Marlow [Thu, 9 Aug 2007 10:01:39 +0000 (10:01 +0000)]
Cabal depends on -package unix when GHC <= 6.2
Clemens Fruhwirth [Sat, 14 Jul 2007 08:32:41 +0000 (08:32 +0000)]
joinToTargets to emit fixup code even when movement graph contains cycles
First, cycles can only start of with registers and their destination
must involve a register location. This is because memory locations are
allocated exclusively for a virtual register and hence can never cause
a conflict in the assignment, hence need no fixup code. Therefore, we
only have to deal with InReg -> InReg, or InReg -> InReg/InMem
movements.
The strategy is to take the first cycle element, which is guaranteed
to start with a register, spill it to a fresh memory location, compute
the fixup for the rest, and restore from the spill slot to its
destinations. The "rest" will degenerate into an acyclic scc, so we do
not need take care of the empty list case in CyclicScc.
***END OF DESCRIPTION***
Place the long patch description above the ***END OF DESCRIPTION*** marker.
The first line of this file will be the patch name.
This patch contains the following changes:
M ./compiler/nativeGen/RegisterAlloc.hs -6 +27
simonpj@microsoft.com [Sun, 5 Aug 2007 22:03:35 +0000 (22:03 +0000)]
Make SpecConstr specialise for constant arguments again
Consider
lvl = Just True
foo :: Maybe Bool -> Int -> Int
foo (Just True) i = i
foo _ i = foo lvl i
SpecConstr should specialise foo, but it wasn't doing so (spotted
by Roman).
Reason: lvl's unfolding wasn't in the cloned version of lvl.
Solution: extend the value environment to record top-level bindings too
At the same time I made it work if 'lvl' is a lambda, in which case it
is again worth specialisg. This meant renaming ConEnv to ValueEnv,
and adding a case for 'LambdaVal'.
(To make specialisation on lambdas work properly, we have to do lambda
lifting as well, but this gets part of the way, and fixes a bug too.)
simonpj@microsoft.com [Sun, 5 Aug 2007 21:44:04 +0000 (21:44 +0000)]
Comments only: explain why StgConApp is still useful
simonpj@microsoft.com [Sat, 4 Aug 2007 17:47:59 +0000 (17:47 +0000)]
Add missing case to sizeofPrimRep
simonpj@microsoft.com [Sat, 4 Aug 2007 17:44:20 +0000 (17:44 +0000)]
Fix Trac #1037
It makes *sense* for a foreign import to have a zero-sized return, thus
foreign import ccall foo :: Int -> State# RealWorld
but it's not clear that it's useful, and it requires some back-end (a
Hint for void types) to make it go right through. It's not clear that
we really want this facility, so rather than fixing the code
generator, I'm just making the construct illegal for now.
simonpj@microsoft.com [Sat, 4 Aug 2007 17:35:39 +0000 (17:35 +0000)]
In GHCi, filter instances by what is in scope, not just by what is in scope unqualified
Trac #1581 was doing too much filtering; it even filtered out intances
defined in this very module! The new rule shows more instances, but
hopefully not to many.
Furthermore I have moved the filtering out of TcRnDriver (where it does
not belong) to InteractiveEval. And I've added a note to the documentation.
simonpj@microsoft.com [Sat, 4 Aug 2007 17:21:51 +0000 (17:21 +0000)]
Improve pretty-printing of 'foreign' declarations
Simon Marlow [Thu, 9 Aug 2007 08:58:17 +0000 (08:58 +0000)]
FIX read030 (error message wibble)
Ian Lynagh [Wed, 8 Aug 2007 23:16:20 +0000 (23:16 +0000)]
Fix the use of emptyCopyFlags
Magnus Jonsson [Wed, 8 Aug 2007 22:10:29 +0000 (22:10 +0000)]
Removed a dependency on Cabal that caused a build failure when Cabal changed
Ian Lynagh [Tue, 7 Aug 2007 19:31:39 +0000 (19:31 +0000)]
Add blurb in the user guide re stdout buffering differing between GHC and GHCi
Duncan Coutts [Mon, 6 Aug 2007 15:28:24 +0000 (15:28 +0000)]
Use emptyRegisterFlags and emptyCopyFlags for reduced fragility
So we will inherit default values for any new flags that get added,
so things should not break if new flags are added.
Isaac Dupree [Tue, 7 Aug 2007 12:22:34 +0000 (12:22 +0000)]
remove gratuitous usage of Double in favor of Rational
Isaac Dupree [Tue, 7 Aug 2007 12:14:54 +0000 (12:14 +0000)]
Warning police: eliminate all defaulting within stage1
Defaulting makes compilation of multiple modules more complicated (re: #1405)
Although it was all locally within functions, not because of the module
monomorphism-restriction... but it's better to be clear what's meant, anyway.
I changed some that were defaulting to Integer, to explicit Int, where Int
seemed appropriate rather than Integer.
Isaac Dupree [Tue, 7 Aug 2007 00:28:59 +0000 (00:28 +0000)]
NOINLINE the global FastString.string_table
Isaac Dupree [Mon, 6 Aug 2007 21:19:14 +0000 (21:19 +0000)]
comment FastMutInt possibilities
Ian Lynagh [Sun, 5 Aug 2007 17:51:16 +0000 (17:51 +0000)]
Follow Cabal changes
Ian Lynagh [Sun, 5 Aug 2007 15:33:41 +0000 (15:33 +0000)]
Add a --supported-languages flag
Print the list of strings that are accepted in a LANGUAGE pragma,
or as a -XFoo flag. (No can be prepended to any of the strings).
Ian Lynagh [Sun, 5 Aug 2007 15:03:02 +0000 (15:03 +0000)]
Whitespace
Ian Lynagh [Sun, 5 Aug 2007 13:28:56 +0000 (13:28 +0000)]
Add Distribution.System to compat
Ian Lynagh [Sat, 4 Aug 2007 21:14:15 +0000 (21:14 +0000)]
Canonicalise flags in error message
Ian Lynagh [Sat, 4 Aug 2007 21:01:45 +0000 (21:01 +0000)]
Canonicalise the flag format in the user guide
Ian Lynagh [Sat, 4 Aug 2007 19:24:31 +0000 (19:24 +0000)]
We now need to pass a version to extensionsToGHCFlag
Ian Lynagh [Sat, 4 Aug 2007 16:49:30 +0000 (16:49 +0000)]
Fix -fallow* flags
Ian Lynagh [Sat, 4 Aug 2007 16:22:41 +0000 (16:22 +0000)]
Add more of Cabal to compat
Ian Lynagh [Sat, 4 Aug 2007 15:54:25 +0000 (15:54 +0000)]
Rename Opt_Allow* to Opt_* to match the language names
Ian Lynagh [Sat, 4 Aug 2007 15:48:05 +0000 (15:48 +0000)]
Rename Opt_TH to Opt_TemplateHaskell to match the language name
Ian Lynagh [Sat, 4 Aug 2007 15:45:05 +0000 (15:45 +0000)]
Add -fparr deprecated flag, and change -XParr to -XPArr
-fparr did exist before, it just wasn't documented.
Ian Lynagh [Sat, 4 Aug 2007 15:42:34 +0000 (15:42 +0000)]
Rename Opt_FFI to Opt_ForeignFunctionInterface to match the language name
Ian Lynagh [Sat, 4 Aug 2007 15:34:12 +0000 (15:34 +0000)]
Remove many of the new flag variants permitted
Now we only allow -XFooBar syntax, not alternate case, hyphens or -f.
There are some deprecated -f flags accordingly.
Ian Lynagh [Sat, 4 Aug 2007 15:33:33 +0000 (15:33 +0000)]
Add a comment about when maybePrefixMatch can be removed
Ian Lynagh [Sat, 4 Aug 2007 02:01:56 +0000 (02:01 +0000)]
Typo in a comment
Ian Lynagh [Fri, 3 Aug 2007 18:38:35 +0000 (18:38 +0000)]
Update the boring file
Ian Lynagh [Fri, 3 Aug 2007 18:32:29 +0000 (18:32 +0000)]
Catch exceptions on Windows, to stop it popping up dialog boxes
Adaptated from code from Sigbjorn Finne
Simon Marlow [Fri, 3 Aug 2007 10:21:43 +0000 (10:21 +0000)]
FIX -ddump-cmm by temporarily disabling the gc_target part (#1582)
Simon Marlow [Fri, 3 Aug 2007 09:32:29 +0000 (09:32 +0000)]
mkLiveness: when calculating the size of a parameter, round up not down.
Fixes read002 on x86_64 (and maybe others). The stg_ap_f_info info
table had the wrong liveness on it, because the float had been treated
as having zero size.
Roman Leshchinskiy [Fri, 3 Aug 2007 02:09:36 +0000 (02:09 +0000)]
Add PA dfuns to VectInfo
Ian Lynagh [Thu, 2 Aug 2007 21:33:00 +0000 (21:33 +0000)]
Add a --ignore-failure flag to push-all script
simonpj@microsoft.com [Thu, 2 Aug 2007 16:51:10 +0000 (16:51 +0000)]
Dump renamer output with -ddump-rn for command-line entry in ghci
simonpj@microsoft.com [Thu, 2 Aug 2007 11:12:04 +0000 (11:12 +0000)]
Fix Trac #1525
A Name used to have a Parent, but no longer has. When we want to
print info about data type T and data constructor MkT, the info about
T already describes MkT so we want to discard the latter. Now that
Names don't have a Parent, we must do that in a different way,
using implicitTyThings
Test is ghci011
simonpj@microsoft.com [Thu, 2 Aug 2007 08:51:36 +0000 (08:51 +0000)]
Wibbble to last fix to generalisation (again!); fixes Trac #1575
simonpj@microsoft.com [Wed, 1 Aug 2007 14:13:39 +0000 (14:13 +0000)]
Small error-message change
Roman Leshchinskiy [Thu, 2 Aug 2007 04:37:12 +0000 (04:37 +0000)]
Vectorise DataCon workers
Roman Leshchinskiy [Thu, 2 Aug 2007 04:29:38 +0000 (04:29 +0000)]
Include original tycon in PAInstance
Roman Leshchinskiy [Thu, 2 Aug 2007 02:28:59 +0000 (02:28 +0000)]
More refactoring
Roman Leshchinskiy [Thu, 2 Aug 2007 02:28:40 +0000 (02:28 +0000)]
Refactoring
Roman Leshchinskiy [Thu, 2 Aug 2007 02:25:03 +0000 (02:25 +0000)]
Thread lifting context implicitly in the vectorisation monad
Roman Leshchinskiy [Wed, 1 Aug 2007 04:56:56 +0000 (04:56 +0000)]
Fix calls to replicatePA
Roman Leshchinskiy [Wed, 1 Aug 2007 04:56:40 +0000 (04:56 +0000)]
Trace vectorisation failures
Roman Leshchinskiy [Wed, 1 Aug 2007 04:24:41 +0000 (04:24 +0000)]
Reuse the lifting context Var
Roman Leshchinskiy [Wed, 1 Aug 2007 04:24:04 +0000 (04:24 +0000)]
Move code
Roman Leshchinskiy [Wed, 1 Aug 2007 04:13:22 +0000 (04:13 +0000)]
Nicer names for hoisted functions
Roman Leshchinskiy [Wed, 1 Aug 2007 03:41:19 +0000 (03:41 +0000)]
Improve closure generation for functions with multiple parameters
Roman Leshchinskiy [Wed, 1 Aug 2007 01:40:56 +0000 (01:40 +0000)]
Rename functions
Roman Leshchinskiy [Wed, 1 Aug 2007 01:37:28 +0000 (01:37 +0000)]
Use new closure generation code in vectorisation
Roman Leshchinskiy [Tue, 31 Jul 2007 06:50:24 +0000 (06:50 +0000)]
More vectorisation-related smart constructors
Roman Leshchinskiy [Tue, 31 Jul 2007 06:34:48 +0000 (06:34 +0000)]
Use VectCore stuff in vectorisation
Roman Leshchinskiy [Tue, 31 Jul 2007 06:27:11 +0000 (06:27 +0000)]
Move vectorisation-related smart constructors into a separate module
Roman Leshchinskiy [Tue, 31 Jul 2007 06:16:10 +0000 (06:16 +0000)]
Use a Var instead of a CoreExpr as the lifting context during vectorisation
Roman Leshchinskiy [Tue, 31 Jul 2007 06:09:17 +0000 (06:09 +0000)]
Simplify handling of variables during vectorisation
Roman Leshchinskiy [Tue, 31 Jul 2007 05:54:19 +0000 (05:54 +0000)]
Simplify closure generation code
Roman Leshchinskiy [Tue, 31 Jul 2007 04:40:29 +0000 (04:40 +0000)]
New closure generation code
Roman Leshchinskiy [Tue, 31 Jul 2007 04:06:21 +0000 (04:06 +0000)]
Refactoring
Roman Leshchinskiy [Thu, 26 Jul 2007 07:13:08 +0000 (07:13 +0000)]
Optimise parallel arrays of products
Simon Marlow [Wed, 1 Aug 2007 14:02:31 +0000 (14:02 +0000)]
FIX recent PPC crashes introduced by the pointer-tagging patch (I hope)
There was an accidental endian-dependency in changes related to RET_FUN.
The changes in question weren't strictly necessary - they were left
over from the original workaround for the compacting GC problems, so
I've just reverted those changes in this patch, which should hopefully
fix the PPC problems.
Simon Marlow [Wed, 1 Aug 2007 13:39:38 +0000 (13:39 +0000)]
revert accidental modification of version number
simonpj@microsoft.com [Wed, 1 Aug 2007 12:49:07 +0000 (12:49 +0000)]
Fix a knot-tying bug with ghc --make
This bug showed up when I touched Data.Generics.Schemes, and then said
make build.library.base
This compiles the base library with --make, and I got an assertion failure
in TcIface. The explanation is in Note [Tying the knot] in TcIface.
As well as fixing the bug, I also impoved the assertion message.
This might fix or improve other knot-tying problems with --make
simonpj@microsoft.com [Wed, 1 Aug 2007 12:48:52 +0000 (12:48 +0000)]
Spelling error
simonpj@microsoft.com [Fri, 6 Jul 2007 09:48:36 +0000 (09:48 +0000)]
Clarify comments
simonpj@microsoft.com [Wed, 1 Aug 2007 07:26:12 +0000 (07:26 +0000)]
Fix generalisation during type inference (again); fixes Trac #1564
Figuring out which type variables to generalise when inferring the type
of a let-bound function is always trickier than I think! This patch
fixes a bug (related, inevitably, to functional depenencies) found by
iampure, Trac #1564. I'll add a test shortly.
Clemens Fruhwirth [Wed, 1 Aug 2007 09:24:29 +0000 (09:24 +0000)]
Only add -rpath to linker invocation when -dynamic
Simon Marlow [Wed, 1 Aug 2007 08:32:57 +0000 (08:32 +0000)]
fix the hardtop test for ghc-6.2.x, and make it notice failure earlier
Simon Marlow [Tue, 31 Jul 2007 11:49:25 +0000 (11:49 +0000)]
compile the -inplace programs using $(HC), not $(GHC)
$(UseStage1) modifies $(HC) rather than $(GHC)
Ian Lynagh [Mon, 30 Jul 2007 22:31:52 +0000 (22:31 +0000)]
Make lndir work on Windows (by copying)
Ian Lynagh [Mon, 30 Jul 2007 19:30:12 +0000 (19:30 +0000)]
Make lndir whitespace consistent
Ian Lynagh [Mon, 30 Jul 2007 19:25:13 +0000 (19:25 +0000)]
Set hardtop_plat to hardtop to find out what, if anything, breaks
Ian Lynagh [Mon, 30 Jul 2007 19:08:08 +0000 (19:08 +0000)]
Use our own (Haskell) pwd to find the tree root
Ian Lynagh [Mon, 30 Jul 2007 18:28:06 +0000 (18:28 +0000)]
#1559 is worked around elsewhere, so validate no longer needs to
Clemens Fruhwirth [Tue, 31 Jul 2007 09:59:53 +0000 (09:59 +0000)]
Change the strategy to determine dynamic data access
Instead of attaching the information whether a Label is going to be
accessed dynamically or not (distinction between IdLabel/DynLabel and
additional flags in ModuleInitLabel and PlainModuleInitLabel), we hand
dflags through the CmmOpt monad and the NatM monad. Before calling
labelDynamic in PositionIndependentCode, we extract thisPackage from
dflags and supply the current package to labelDynamic, so it can take
this information into account instead of extracting it from the labels
itself. This simplifies a lot of code in codeGen that just hands
through this_pkg.
Clemens Fruhwirth [Mon, 23 Jul 2007 13:41:24 +0000 (13:41 +0000)]
Translate dyn in GhcLibWays into --enable-shared for Cabal
Clemens Fruhwirth [Sun, 22 Jul 2007 08:20:50 +0000 (08:20 +0000)]
Add proper header so that cygwin recognizes this file as executable
Clemens Fruhwirth [Tue, 17 Jul 2007 19:26:22 +0000 (19:26 +0000)]
Add hardwire-lib-paths option and make it default for inplace invocations
Clemens Fruhwirth [Fri, 13 Jul 2007 21:08:45 +0000 (21:08 +0000)]
Add import facility to cmm parser
The cmm parser classified all unknown variables as imported. This
behaviour is not changed with this patch. Explicitly imported
variables get a different internal label type, namely ForeignLabel
instead of RtsLabel. In PIC compilation, the NCG creates dynamic
access for ForeignLabel, while RtsLabel are not treated as PIC when
-package rts. Hence, putting explicit imports into cmm files enables
the NCG to distinguish between RTS-external and RTS-internal symbols,
and create the appropriate code.
Clemens Fruhwirth [Fri, 13 Jul 2007 21:03:55 +0000 (21:03 +0000)]
Fix the knot-tying in loopDecls to actually do what its comment tells: provide access to global declarations
Clemens Fruhwirth [Tue, 3 Jul 2007 14:56:53 +0000 (14:56 +0000)]
windres to use the gcc given as --with-cc.
Clemens Fruhwirth [Thu, 28 Jun 2007 10:58:31 +0000 (10:58 +0000)]
Change package name mangling when linking against DSOs
Clemens Fruhwirth [Wed, 20 Jun 2007 14:20:23 +0000 (14:20 +0000)]
Allow access via manually generated SymbolPtrs. Generalize pprImportedSymbol for 64 bit archs.
Simon Marlow [Mon, 30 Jul 2007 15:39:59 +0000 (15:39 +0000)]
FIX compacting GC (bug1010, and other failures)
Compacting GC interacts badly with the new pointer-tagging feature, as
it also uses the low bits of a pointer to encode some information
during a collection. My original workaround didn't work, this more
elaborate fix should be better.
Simon Marlow [Mon, 30 Jul 2007 13:43:46 +0000 (13:43 +0000)]
FIX #1559, #1560. Rearrange the way we do ifBuildable...
ifBuildable now returns an exit code, with 1 indicating an unbuildable
non-core package, and 0 otherwise. Hence we can now invoke the
recursive make from the shell, sidestepping the problems in #1559 and
#1560.
audreyt@audreyt.org [Mon, 30 Jul 2007 12:22:16 +0000 (12:22 +0000)]
* ghc-asm: Finally did away with $* in a way that works with Perl 5.6~5.10+, by appending /m to all regexes.
Ian Lynagh [Sun, 29 Jul 2007 13:18:09 +0000 (13:18 +0000)]
Use "set -e" in validate, so "sh validate" still has it set
Ian Lynagh [Sun, 29 Jul 2007 11:07:11 +0000 (11:07 +0000)]
Follow cabal configurations changes
Simon Marlow [Fri, 27 Jul 2007 10:41:57 +0000 (10:41 +0000)]
Pointer Tagging
This patch implements pointer tagging as per our ICFP'07 paper "Faster
laziness using dynamic pointer tagging". It improves performance by
10-15% for most workloads, including GHC itself.
The original patches were by Alexey Rodriguez Yakushev
<mrchebas@gmail.com>, with additions and improvements by me. I've
re-recorded the development as a single patch.
The basic idea is this: we use the low 2 bits of a pointer to a heap
object (3 bits on a 64-bit architecture) to encode some information
about the object pointed to. For a constructor, we encode the "tag"
of the constructor (e.g. True vs. False), for a function closure its
arity. This enables some decisions to be made without dereferencing
the pointer, which speeds up some common operations. In particular it
enables us to avoid costly indirect jumps in many cases.
More information in the commentary:
http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/HaskellExecution/PointerTagging
Ian Lynagh [Thu, 26 Jul 2007 18:16:22 +0000 (18:16 +0000)]
Fix building the HEAD with itself
Ian Lynagh [Thu, 26 Jul 2007 16:42:01 +0000 (16:42 +0000)]
Link with hpc even if GhcWithInterpreter is not set
Simon Marlow [Thu, 26 Jul 2007 09:40:30 +0000 (09:40 +0000)]
Documentation updates for #1177
We now have a section that describes what hs_exit() does (including
the "wait for foreign calls to return" behaviour), and more
documentation on creating libraries of Haskell code. I also imported
the section "Beware of DllMain()!" from the haskell.org wiki, with
some minor editing.
Roman Leshchinskiy [Thu, 26 Jul 2007 05:30:01 +0000 (05:30 +0000)]
Mark PA dictionaries as __inline_me