| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This big-ish patch arranges that if an Id 'f' is
* Type-class overloaded
f :: Ord a => [a] -> [a]
* Defined with an INLINABLE pragma
{-# INLINABLE f #-}
* Exported from its defining module 'D'
then in any module 'U' that imports D
1. Any call of 'f' at a fixed type will generate
(a) a specialised version of f in U
(b) a RULE that rewrites unspecialised calls to the
specialised on
e.g. if the call is (f Int dOrdInt xs) then the
specialiser will generate
$sfInt :: [Int] -> [Int]
$sfInt = <code for f, imported from D, specialised>
{-# RULE forall d. f Int d = $sfInt #-}
2. In addition, you can give an explicit {-# SPECIALISE -#}
pragma for the imported Id
{-# SPECIALISE f :: [Bool] -> [Bool] #-}
This too generates a local specialised definition,
and the corresponding RULE
The new RULES are exported from module 'U', so that any module
importing U will see the specialised versions of 'f', and will
not re-specialise them.
There's a flag -fwarn-auto-orphan that warns you if the auto-generated
RULES are orphan rules. It's not in -Wall, mainly to avoid lots of
error messages with existing packages.
Main implementation changes
- A new flag on a CoreRule to say if it was auto-generated.
This is persisted across interface files, so there's a small
change in interface file format.
- Quite a bit of fiddling with plumbing, to get the
{-# SPECIALISE #-} pragmas for imported Ids. In particular, a
new field tgc_imp_specs in TcGblEnv, to keep the specialise
pragmas for imported Ids between the typechecker and the desugarer.
- Some new code (although surprisingly little) in Specialise,
to deal with calls of imported Ids
|
| |
|
|
|
|
|
|
|
|
| |
We still have
insertList, insertListWith, deleteList
which aren't in Data.Map, and
foldRightWithKey
which works around the fold(r)WithKey addition and deprecation.
|
|
|
|
|
|
|
|
|
| |
This major patch implements the new OutsideIn constraint solving
algorithm in the typecheker, following our JFP paper "Modular type
inference with local assumptions".
Done with major help from Dimitrios Vytiniotis and Brent Yorgey.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
The problem is that showing SDoc's looks at the static flags global
variables, but those are panics while we are parsing the static flags.
We work around this by explicitly using a fixed prettyprinter style.
|
| |
|
| |
|
|
|
|
|
| |
In GHC 6.10, intersectionWith is (a -> b -> a) instead of (a -> b -> c),
so we need to jump through some hoops to get the more general type.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original interfaces are kept. There is small performance improvement:
- when compiling for five nofib, we get following speedups:
Average ----- -2.5%
Average ----- -0.6%
Average ----- -0.5%
Average ----- -5.5%
Average ----- -10.3%
- when compiling HPC ten times, we get:
switches oldmaps newmaps
-O -fasm 117.402s 116.081s (98.87%)
-O -fasm -fregs-graph 119.993s 118.735s (98.95%)
-O -fasm -fregs-iterative 120.191s 118.607s (98.68%)
|
| |
|
| |
|
|
|
|
|
| |
The instances (and deriving declarations) have been taken from the ghc-syb
package.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
also replace picIsOn with isDynamicGhcLib, as __PIC__ is not the
correct test for whether the GHC library is dynamically linked.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main purpose of this patch is to add a bunch of new rules
to the coercion optimiser. They are documented in the (revised)
Appendix of the System FC paper.
Some code has moved about:
- OptCoercion is now a separate module, mainly because it
now uses tcMatchTy, which is defined in Unify, so OptCoercion
must live higehr up in the hierarchy
- Functions that manipulate Kinds has moved from
Type.lhs to Coercion.lhs. Reason: the function typeKind
now needs to call coercionKind. And in any case, a Kind is
a flavour of Type, so it builds on top of Type; indeed Coercions
and Kinds are both flavours of Type.
This change required fiddling with a number of imports, hence
the one-line changes to otherwise-unrelated modules
- The representation of CoTyCons in TyCon has changed. Instead of
an extensional representation (a kind checker) there is now an
intensional representation (namely TyCon.CoTyConDesc). This was
needed for one of the new coercion optimisations.
|
|
|
|
|
|
|
|
|
|
| |
This patch was the cause of the compile-time performance regression in
#3796. My guess is that it is due to the use of unsafePerformIO which
traverses the stack up to the first update frame, and perhaps we have
a deep stack when reading the dictionary from a .hi file. In any
case, since we're not relying on thread safety for FastStrings, I
think the safest thing to do is back this out until we can investigate
further.
|
|
|
|
| |
Use -dppr-debug to make it noisy again
|
|
|
|
|
| |
splitUFM :: Uniquable key => UniqFM elt -> key -> (UniqFM elt, Maybe elt, UniqFM elt)
-- Splits a UFM into things less than, equal to, and greater than the key
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
rather than our own copies
|
|
|
|
|
|
|
|
|
| |
That is, unless we're printing in LeftMode, where we bypass encoding
for speed. This is safe, because LeftMode is used for outputting C or
asm, where everyting is Z-encoded and hence ASCII.
Error messages and other compiler output containing Unicode will now
appear correctly according to the locale settings.
|
|
|
|
|
|
|
|
|
| |
This is needed both for per-session parallelism and for allowing
multiple concurrent sessions in the same process. With the help of
atomicModifyIORef and unsafePerformIO it is also quite fast--an MVar
would most likely be slower. On a full compilation of Cabal's head
branch it was about 1-2 percent slower, but then overall compilation
times varied by about 4 percent, so I think it's worth it.
|
|
|
|
|
| |
For: FastStrings, Names, and Bin values. This makes .hi files smaller
on 64-bit platforms, while also making the format a bit more robust.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Show SrcSpans for Located things might be overkill, but it's sometimes
useful.
I also added
ppWhen, ppUnless :: Bool -> SDoc -> SDoc
to Outputable
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current implementation is rather pessimistic. The persistent
linker state is now an MVar and all exported Linker functions are
wrapped in modifyMVar calls. This is serves as a big lock around all
linker functions.
There might be a chance for more concurrency in a few places. E.g.,
extending the closure environment and loading packages might be
independent in some cases. But for now it's better to be on the safe
side.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The first phase of this tidyup is focussed on the header files, and in
particular making sure we are exposinng publicly exactly what we need
to, and no more.
- Rts.h now includes everything that the RTS exposes publicly,
rather than a random subset of it.
- Most of the public header files have moved into subdirectories, and
many of them have been renamed. But clients should not need to
include any of the other headers directly, just #include the main
public headers: Rts.h, HsFFI.h, RtsAPI.h.
- All the headers needed for via-C compilation have moved into the
stg subdirectory, which is self-contained. Most of the headers for
the rest of the RTS APIs have moved into the rts subdirectory.
- I left MachDeps.h where it is, because it is so widely used in
Haskell code.
- I left a deprecated stub for RtsFlags.h in place. The flag
structures are now exposed by Rts.h.
- Various internal APIs are no longer exposed by public header files.
- Various bits of dead code and declarations have been removed
- More gcc warnings are turned on, and the RTS code is more
warning-clean.
- More source files #include "PosixSource.h", and hence only use
standard POSIX (1003.1c-1995) interfaces.
There is a lot more tidying up still to do, this is just the first
pass. I also intend to standardise the names for external RTS APIs
(e.g use the rts_ prefix consistently), and declare the internal APIs
as hidden for shared libraries.
|
|
|
|
|
| |
We were keeping things as Int, and then converting them to Word16 at
the last minute, when really they ought to have been Word16 all along.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In standalone deriving, we now do *not* check side conditions.
We simply generate the code and typecheck it. If there's a type
error, it's the programmer's problem.
This means that you can do 'deriving instance Show (T a)', where
T is a GADT, for example, provided of course that the boilerplate
code does in fact typecheck.
I put some work into getting a decent error message. In particular
if there's a type error in a method, GHC will show the entire code
for that method (since, after all, the user did not write it).
Most of the changes are to achieve that goal.
Still to come: changes in the documentation.
|
|
|
|
|
|
| |
This function isn't used at the moment, but Max added it, and it
looks useful.
|
|
|
|
|
|
| |
This means that, provided the values are small enough, files
serialized are portable between architectures. In particular,
.haddock files are portable.
|