summaryrefslogtreecommitdiff
path: root/compiler/main
Commit message (Collapse)AuthorAgeFilesLines
* Squashed commit of the following:Trevor Elliott2013-09-082-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 6549c3e569d0e0c3714814860201924432da2435 Author: Trevor Elliott <trevor@galois.com> Date: Sun Sep 8 16:43:42 2013 -0700 Document `data kind` syntax commit 81c6d7b884e819cf0b0569cef23b67bb5aff8944 Merge: 6c3f34c c798a8c Author: Trevor Elliott <trevor@galois.com> Date: Sun Sep 8 11:40:47 2013 -0700 Merge remote-tracking branch 'head/master' into data-kind-syntax-v2 commit 6c3f34c80bd8b17920a956e194ec29d1affbd776 Author: Trevor Elliott <awesomelyawesome@gmail.com> Date: Wed Aug 28 02:21:07 2013 -0400 Merge with the roles changes There a bunch of spots where the roles haven't been properly integrated with, so this patch should get some review. commit 6bb530f50f655e74fb4e337311699eee46b519b7 Merge: 7d27880 4b5238a Author: Trevor Elliott <awesomelyawesome@gmail.com> Date: Tue Aug 27 02:35:55 2013 -0400 Merge remote-tracking branch 'head/master' into data-kind-syntax-v2 Conflicts: compiler/basicTypes/DataCon.lhs compiler/iface/IfaceSyn.lhs compiler/main/PprTyThing.hs compiler/parser/Lexer.x compiler/parser/Parser.y.pp compiler/typecheck/TcInstDcls.lhs compiler/typecheck/TcTyClsDecls.lhs compiler/typecheck/TcTyDecls.lhs compiler/types/TyCon.lhs commit 7d2788021dab549ffd888deb9f28c8e7eab0d4ba Author: Trevor Elliott <trevor@galois.com> Date: Mon Jul 29 09:05:38 2013 -0700 Migrate through some lost instances commit 13e1f41ec9252fd9d547d8e4b9fb04ffaf43c105 Merge: e051060 9e185cc Author: Trevor Elliott <awesomelyawesome@gmail.com> Date: Sun Jul 28 14:28:05 2013 -0400 Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2 Moved Binary instances for data-kind related types to IfaceSyn commit e051060bbef4d359f2b1caa1c6135b23df17ffe7 Merge: 08d7c2f 2f99cdb Author: Trevor Elliott <awesomelyawesome@gmail.com> Date: Wed Jul 17 01:58:16 2013 -0400 Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2 commit 08d7c2fca10a8c89b6fd638536a28972753ae360 Author: Trevor Elliott <awesomelyawesome@gmail.com> Date: Mon Jul 1 21:56:48 2013 -0400 Fix some bugs from the merge with master * Figure out what the right choice for the kind checking strategy of kind decls should be commit 12f055d23a1b5c0a74d2db0784b779b605f3888f Merge: f0adbdc e56b9d5 Author: Trevor Elliott <awesomelyawesome@gmail.com> Date: Mon Jul 1 21:12:47 2013 -0400 Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2 Conflicts: compiler/typecheck/TcTyClsDecls.lhs commit f0adbdc29fefc54675f0960e3178f3b079058eea Author: Trevor Elliott <awesomelyawesome@gmail.com> Date: Sun Jun 23 15:53:06 2013 -0400 Swap the names for PromotionFlavor and PromotionInfo commit e177270dc002f45286a9b644935ea339d8a6c8d3 Merge: 16df4be 3660ef9 Author: Trevor Elliott <awesomelyawesome@gmail.com> Date: Sat Jun 22 04:00:15 2013 -0400 Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2 commit 16df4beac24065d3075a65b26add543452d1f2b2 Merge: b021b30 569b265 Author: Trevor Elliott <awesomelyawesome@gmail.com> Date: Sat Jun 22 02:41:14 2013 -0400 merge with master commit b021b30f66fdb66965f6c57fb0969317c9aeb9e3 Author: Trevor Elliott <trevor@galois.com> Date: Thu Jun 20 19:39:20 2013 -0700 Start reworking comments commit b765370181571c1922b508f8dd17648a090ac248 Merge: d1ac794 e4fc6fd Author: Trevor Elliott <trevor@galois.com> Date: Thu Jun 20 18:27:43 2013 -0700 Merge branch 'master' into data-kind-syntax-v2 commit d1ac794b5bd06ae04e014cabe4560628b70fcdeb Merge: 9ad0a3c 73991d6 Author: Trevor Elliott <trevor@galois.com> Date: Thu Jun 20 18:16:15 2013 -0700 Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2 commit 9ad0a3c57a5b77f5040f1201b2c53a84680c1af2 Author: Trevor Elliott <trevor@galois.com> Date: Thu Jun 20 18:13:58 2013 -0700 Don't add the promotion tick to data kind constructors commit 8c37784e31702ecf7d91f2d7cf7dfab675a56927 Merge: 4dff379 db9b631 Author: Trevor Elliott <trevor@galois.com> Date: Mon Jun 17 10:55:51 2013 -0700 Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2 Conflicts: compiler/main/PprTyThing.hs compiler/rename/RnTypes.lhs compiler/types/TyCon.lhs commit 4dff3791ac9d1175d26f8c3b44923aefbe6c3f40 Author: Trevor Elliott <trevor@galois.com> Date: Mon Jun 3 20:45:00 2013 -0700 When parsing interfaces, use forkM while checking type constructors commit 7903009475b3e89aecc0a8e5d328ea84ea53a39d Author: Trevor Elliott <trevor@galois.com> Date: Mon Jun 3 20:06:40 2013 -0700 When parsing data kind declarations, don't change the constructor namespace commit 78ff545601cedba106eda05a38ce8f24f8480961 Author: Trevor Elliott <trevor@galois.com> Date: Mon May 27 18:45:52 2013 -0700 Switch from Maybe TyCon to a richer type for promotion The new type distinguishes the two cases where promotion isn't possible: 1) Promotion isn't possible, as it's disabled by a 'data type' declaration 2) Promotion isn't possible because we don't know how to promote it commit 0573fd3e8f9822171ddeb0df937e10075b653678 Author: Trevor Elliott <trevor@galois.com> Date: Mon May 27 17:36:21 2013 -0700 Remove an old TODO commit e218d5d6848109e9dea129250199115a9db6b1d9 Author: Trevor Elliott <trevor@galois.com> Date: Mon May 27 17:36:15 2013 -0700 Properly print data kind declarations in ghci commit 22b011d43f84cb0478eded613344e1dd165664e5 Author: Trevor Elliott <trevor@galois.com> Date: Thu May 16 18:38:22 2013 -0700 Switch to using the PromotedDataCon for the RHS of a data kind Something is still wrong here: doing :browse will get a panic for some reason. commit 12db8c704765d2775b0299c2e718d015577a6f18 Author: Trevor Elliott <trevor@galois.com> Date: Sat May 4 19:06:43 2013 -0700 Thread data kind syntax through the interface Things are not quite right at the moment. The issue is that we can't distinguish abstract types from types that are constructors in a data kind. As such, we should introduce a new constructor to TyCon to help disambiguate these two cases. Also it might be nice to add a new TyCon for kinds, which would avoid the need for a new RHS in the AlgTyCon case. commit 73f19612444e2a3b1534ab41f02449c9a5191ccb Author: Trevor Elliott <trevor@galois.com> Date: Tue Apr 30 20:30:21 2013 -0700 Handle kind declarations separately commit 8d3bf040748026829382c5d13421f910b3f9fcf9 Author: Trevor Elliott <trevor@galois.com> Date: Fri Apr 26 20:40:49 2013 -0700 Partial type-kind checking of `data kind` declarations commit 2399eb788ed0fe571c22de4f810080a323ddaceb Author: Trevor Elliott <trevor@galois.com> Date: Fri Apr 26 18:01:28 2013 -0700 Support empty `data kind` declarations commit 61a28f2df42b34742219a97a22c029f840fef7f5 Author: Trevor Elliott <trevor@galois.com> Date: Fri Apr 26 17:34:31 2013 -0700 Rename `data kind` declarations commit 5d3485a3e3ab7a78f1055b872f78203d5d005b76 Author: Trevor Elliott <trevor@galois.com> Date: Fri Apr 26 16:53:26 2013 -0700 Fix a typo in a parser comment commit 7f631cf41a3ca84cd820b292711014b4e806a440 Author: Trevor Elliott <trevor@galois.com> Date: Fri Apr 26 16:53:00 2013 -0700 Add paring for `data kind` declarations commit d29733901b2cd195989cdc972ac74c1ed4f19670 Author: Trevor Elliott <trevor@galois.com> Date: Fri Apr 26 14:31:30 2013 -0700 Rename typeLiteralsBit to dataKindsBit in the lexer commit ca8ae194826fc47a2ba4f0188d62f5247b0fe631 Author: Trevor Elliott <trevor@galois.com> Date: Fri Apr 26 14:27:50 2013 -0700 Add a check for -XDataKinds when parsing a `data type` declaration commit 8588717e8ce224affa584bd1e27aa14e098f5a8f Author: Trevor Elliott <trevor@galois.com> Date: Fri Apr 26 14:18:41 2013 -0700 Implement the 'data type' syntax and checking Add a new form of data declaration where the 'type' modifier can be used to prevent data promotion. For example data type T = K will not yield a promoted kind T, and promoted type K, even though they are in principle promotable.
* resurrected -fdicts-strict, off by defaultNicolas Frisby2013-09-082-9/+7
| | | | also added -fdmd-tx-dict-sel, on by default
* Add basic support for GHCJSAustin Seipp2013-09-061-1/+16
| | | | | | | | | | | | | | | | | | | This patch encompasses most of the basic infrastructure for GHCJS. It includes: * A new extension, -XJavaScriptFFI * A new architecture, ArchJavaScript * Parser and lexer support for 'foreign import javascript', only available under -XJavaScriptFFI, using ArchJavaScript. * As a knock-on, there is also a new 'WayCustom' constructor in DynFlags, so clients of the GHC API can add custom 'tags' to their built files. This should be useful for other users as well. The remaining changes are really just the resulting fallout, making sure all the cases are handled appropriately for DynFlags and Platform. Authored-by: Luite Stegeman <stegeman@gmail.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix annoying iOS linker warnings (#8208)Austin Seipp2013-09-042-2/+16
| | | | | Authored-by: Luke Iannini <lukexi@me.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Improve Linting in GHCi (fixes Trac #8215)Simon Peyton Jones2013-09-032-30/+20
| | | | | | | | | | | | | | | | | | | | | The original problem was that we weren't bringing varaibles bound in the interactive context into scope before Linting the result of a top-level declaration in GHCi. (We were doing this for expressions.) Moreover I found that we weren't Linting the result of desugaring a GHCi expression, which we really should be doing. It took me a bit of time to unravel all this, and I did some refactoring to make it easier next time. * CoreMonad contains the Lint wrappers that get the right environments into place. It always had endPass and lintPassResult (which Lints bindings), but now it has lintInteractiveExpr. * Both use a common function CoreMonad.interactiveInScope to find those in-scope variables. Quite a bit of knock-on effects from this, but nothing exciting.
* Export languageExtensions as part of the API.Jan Stolarek2013-08-301-6/+7
| | | | Fixes #8200
* simplified the .hi format and added the -flate-dmd-anal flag (fixes #7782)Nicolas Frisby2013-08-292-5/+5
| | | | cf http://ghc.haskell.org/trac/ghc/wiki/LateDmd
* Display the full type environment when reporting type holesSimon Peyton Jones2013-08-291-0/+6
| | | | | | | This fixes Trac #8191. The patch also adds and documents a new flag -fmax-relevant-bindings=N which lets you control how many bindings in the type environment are shown.
* Fix validate failure.Austin Seipp2013-08-281-1/+1
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Implement -XNumDecimals (#7266)Austin Seipp2013-08-281-0/+2
| | | | | | | | | | | | | | | | | Under -XNumDecimals, it's possible to specify an integer literal using compact "floating point" syntax for any floating literal constant which also happens to be an integer. This lets us write 1.2e6 :: Integer instead of: 1200000 :: Integer This also makes some amendments to the users guide. Authored-by: Shachaf Ben-Kiki <shachaf@gmail.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Applicative instance for Ghc and GhcTDan Frumin2013-08-281-0/+8
| | | | | | Fixes #8175. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Rework how iOS does linking (#8127)Austin Seipp2013-08-285-42/+93
| | | | | | | | | | | | | | | | | | | | | | | | iOS has some particular constraints about how applications can be built: * We must generate a static library (.a) since XCode does the final link. * We need to carefully give the right set of arguments to libtool in the case we're generating an archive. * Dynamic linking isn't supported. * It can only be done on OS X. This patch cleans up all of the above. We add a new flag `-staticlib` (only supported on Darwin) that allows us to produce archive files using libtool, and a -pgmlibtool flag to control which 'libtool' executable to use. This fixes #8127. I believe this is the last piece missing from the iOS cross compiler. Authored-by: Luke Iannini <lukexi@me.com> Authored-by: Maxwell Swadling <maxwellswadling@gmail.com> Authored-by: Stephen Blackheath <...@blacksapphire.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Actually, split that last comment a bit.Austin Seipp2013-08-221-4/+6
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Add some more comments to UsageFile.Austin Seipp2013-08-221-1/+8
| | | | | | This brings them up to date with the changes in #8144. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Remove trailing whitespace from HscTypesAustin Seipp2013-08-221-7/+6
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix interface hashes including time stamp of dependent files.Niklas Hambüchen2013-08-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | | Fixes #8144. Before, the modification time of e.g. #included files (and everything that ends up as a UsageFile, e.g. via addDependentFile) was taken as input for the interface hash of a module. This lead to different hashes for identical inputs on every compilation. We now use file content hashes instead. This changes the interface file format. You will get "Binary.get(Usage): 50" when you try to do an incremental using .hi files that were created with a GHC 7.7 (only) older than this commit. To calculate the md5 hash (`Fingerprint`) of a file in constant space, there now is GHC.Fingerprint.getFileHash, and a fallback version for older GHCs that needs to load the file into memory completely (only used when compiling stage1 with an older GHC). Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Only add -O to C compilations if there was -O on the command lineSimon Marlow2013-08-221-3/+5
| | | | | | | | | | | | In 1e2b3780ebc40d28cd0f029b90df102df09e6827 I changed the option ordering for C compilations. A side effect was that -optc options came before the automatic -O we were adding, which made it so that the -debug RTS was getting optimised when it shouldn't have been. Perhaps we shouldn't have automatic -O options added to C compilations. But that might cause problems for build systems that are relying on the current behaviour, so I've made a minor change instead: now C optimisation level == Haskell optimisation level.
* iOS: generate archive files when compiling.Austin Seipp2013-08-141-5/+6
| | | | | | | | | | | When cross compiling to iOS, we generate archive files which are linked into the final executable. We already *did* generate archive files - just with the wrong suffix. Fixes #8125. Authored-by: Stephen Blackheath <...@blacksapphire.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Added support for writing and checking closed type families is hs-boot files.Richard Eisenberg2013-08-051-2/+7
| | | | | | | | As documented in the users' guide, you can now write type family Foo a where .. in a hs-boot file to declare an abstract closed type family.
* Implement "roles" into GHC.Richard Eisenberg2013-08-021-0/+2
| | | | | | | | | | | | | | | | Roles are a solution to the GeneralizedNewtypeDeriving type-safety problem. Roles were first described in the "Generative type abstraction" paper, by Stephanie Weirich, Dimitrios Vytiniotis, Simon PJ, and Steve Zdancewic. The implementation is a little different than that paper. For a quick primer, check out Note [Roles] in Coercion. Also see http://ghc.haskell.org/trac/ghc/wiki/Roles and http://ghc.haskell.org/trac/ghc/wiki/RolesImplementation For a more formal treatment, check out docs/core-spec/core-spec.pdf. This fixes Trac #1496, #4846, #7148.
* Add a warning for empty enumerations; fixes #7881Ian Lynagh2013-08-011-0/+3
| | | | We now give a warning about enumerations like [5 .. 3] :: Int8.
* Add NegativeLiterals extensionIan Lynagh2013-07-311-0/+2
| | | | | | | | | | | I'd been meaning to do this for some time, but finally got around to it due to the overflowing literals warning. With that enabled, we were getting a warning for -128 :: Int8 as that is parsed as negate (fromInteger 128) which just happens to do the right thing, as negate (fromInteger 128) = negate (-128) = -128
* Add a warning for overflowing literals; fixes #7895Ian Lynagh2013-07-311-0/+3
|
* Rename doDynamicToo to dynamicTooMkDynamicDynFlagsIan Lynagh2013-07-303-14/+15
| | | | | Makes it look less likely that people will confuse what it is for (e.g. #8104).
* Remove an out-of-date comment (see #8101)Ian Lynagh2013-07-281-5/+0
|
* desugar code even when -fno-code is used; fixes #8101Ian Lynagh2013-07-281-2/+2
| | | | | We need to desugar the code, or we don't get the warnings from the desugarer.
* Beautify a few Binary instancesIan Lynagh2013-07-271-2/+3
|
* De-orphan a load of Binary instancesIan Lynagh2013-07-272-0/+215
|
* Sync the list of default warnings with reality; fixes #8060.Ian Lynagh2013-07-211-10/+9
|
* Disable executable stack for the linker note, fixing #703 (again)Edward Z. Yang2013-07-091-1/+11
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Always have LLVM optimize globalsPeter Wortmann2013-07-051-2/+2
| | | | | | | | This pass is pretty cheap and eliminates the aliases generated by the LLVM backend. This in turn is required for dynamic linking to work correctly, as LLVM fails to properly attribute calls to aliased addresses. Signed-off-by: David Terei <davidterei@gmail.com>
* Major Llvm refactoringPeter Wortmann2013-06-271-5/+1
| | | | | | | | | | | | | | | | | | | | | | This combined patch reworks the LLVM backend in a number of ways: 1. Most prominently, we introduce a LlvmM monad carrying the contents of the old LlvmEnv around. This patch completely removes LlvmEnv and refactors towards standard library monad combinators wherever possible. 2. Support for streaming - we can now generate chunks of Llvm for Cmm as it comes in. This might improve our speed. 3. To allow streaming, we need a more flexible way to handle forward references. The solution (getGlobalPtr) unifies LlvmCodeGen.Data and getHsFunc as well. 4. Skip alloca-allocation for registers that are actually never written. LLVM will automatically eliminate these, but output is smaller and friendlier to human eyes this way. 5. We use LlvmM to collect references for llvm.used. This allows places other than cmmProcLlvmGens to generate entries.
* Re-adjust whitespaceIan Lynagh2013-06-231-9/+10
|
* Allow the GHCi messages to be overridden via the GHC API; fixes #7456Ian Lynagh2013-06-233-2/+13
| | | | | | | They now go through log_action. The existing severities all used printDoc, which always adds a trailing newline, which we don't want for the GHCi messages. I therefore added a new severity SevInteractive, which doesn't add a newline.
* Whitespace only in HeaderInfoIan Lynagh2013-06-221-34/+27
|
* Revise implementation of overlapping type family instances.Richard Eisenberg2013-06-216-18/+25
| | | | | | | | | | | | | | | | | | | This commit changes the syntax and story around overlapping type family instances. Before, we had "unbranched" instances and "branched" instances. Now, we have closed type families and open ones. The behavior of open families is completely unchanged. In particular, coincident overlap of open type family instances still works, despite emails to the contrary. A closed type family is declared like this: > type family F a where > F Int = Bool > F a = Char The equations are tried in order, from top to bottom, subject to certain constraints, as described in the user manual. It is not allowed to declare an instance of a closed family.
* Fix many ASSERT uses under Clang.Austin Seipp2013-06-182-3/+2
| | | | | | Clang doesn't like whitespace between macro and arguments. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Use assembler-with-cpp mode when running CPP.Austin Seipp2013-06-181-4/+8
| | | | | | | | | | | | | | | | This is needed because Clang is very strict about C99 macro rules, which dictate that '#' in a body must have a token immediately following it for string-ification. In practice we break this all the time, because we do very weird stuff like: #define FOOBAR(xyz) \ {-# SOME PRAGMA #-} \ baz :: (xyz) \ baz = ... where the leading '#' in in the macro body clearly breaks this rule. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Detect linker information at runtime. Fixes Trac #6063Austin Seipp2013-06-162-6/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we did ./configure time checks to see if 'GNU ld' supported certain options. If it does, we bake those options into the link step. See Trac #5240. Unfortunately, the linker we use at runtime can change for several reasons. One is that the user specifies -pgml 'foo'. The other is if /usr/bin/ld or whatnot changes from when GHC was built. Those options mentioned earlier are specific to GNU ld, but many systems support GNU gold too. This is Trac #6063. So we need to check at runtime what linker we're using. This is actually a little bit complicated because we normally use the C compiler as our linker. Windows and OS X are also special here. Finally, this patch also unconditionally gives '--hash-size=31' and '--reduce-memory-overheads' to the system linker if it's GNU ld. These options have been supported for 8+ years from what I can see, and there are probably a lot of other reasons why GHC would not work with such an ancient binutils, all things considered. See Note [Run-time linker info] in SysTools for details. There are plenty of comments as well in the surrounding code. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Add --show-options to list all flags (Fixes #7843)Jan Stolarek2013-06-061-3/+10
|
* Implement cardinality analysisSimon Peyton Jones2013-06-061-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This major patch implements the cardinality analysis described in our paper "Higher order cardinality analysis". It is joint work with Ilya Sergey and Dimitrios Vytiniotis. The basic is augment the absence-analysis part of the demand analyser so that it can tell when something is used never at most once some other way The "at most once" information is used a) to enable transformations, and in particular to identify one-shot lambdas b) to allow updates on thunks to be omitted. There are two new flags, mainly there so you can do performance comparisons: -fkill-absence stops GHC doing absence analysis at all -fkill-one-shot stops GHC spotting one-shot lambdas and single-entry thunks The big changes are: * The Demand type is substantially refactored. In particular the UseDmd is factored as follows data UseDmd = UCall Count UseDmd | UProd [MaybeUsed] | UHead | Used data MaybeUsed = Abs | Use Count UseDmd data Count = One | Many Notice that UCall recurses straight to UseDmd, whereas UProd goes via MaybeUsed. The "Count" embodies the "at most once" or "many" idea. * The demand analyser itself was refactored a lot * The previously ad-hoc stuff in the occurrence analyser for foldr and build goes away entirely. Before if we had build (\cn -> ...x... ) then the "\cn" was hackily made one-shot (by spotting 'build' as special. That's essential to allow x to be inlined. Now the occurrence analyser propagates info gotten from 'build's stricness signature (so build isn't special); and that strictness sig is in turn derived entirely automatically. Much nicer! * The ticky stuff is improved to count single-entry thunks separately. One shortcoming is that there is no DEBUG way to spot if an allegedly-single-entry thunk is acually entered more than once. It would not be hard to generate a bit of code to check for this, and it would be reassuring. But it's fiddly and I have not done it. Despite all this fuss, the performance numbers are rather under-whelming. See the paper for more discussion. nucleic2 -0.8% -10.9% 0.10 0.10 +0.0% sphere -0.7% -1.5% 0.08 0.08 +0.0% -------------------------------------------------------------------------------- Min -4.7% -10.9% -9.3% -9.3% -50.0% Max -0.4% +0.5% +2.2% +2.3% +7.4% Geometric Mean -0.8% -0.2% -1.3% -1.3% -1.8% I don't quite know how much credence to place in the runtime changes, but movement seems generally in the right direction.
* Make 'SPECIALISE instance' work againSimon Peyton Jones2013-05-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a long-standing regression (Trac #7797), which meant that in particular the Eq [Char] instance does not get specialised. (The *methods* do, but the dictionary itself doesn't.) So when you call a function f :: Eq a => blah on a string type (ie a=[Char]), 7.6 passes a dictionary of un-specialised methods. This only matters when calling an overloaded function from a specialised context, but that does matter in some programs. I remember (though I cannot find the details) that Nick Frisby discovered this to be the source of some pretty solid performanc regresisons. Anyway it works now. The key change is that a DFunUnfolding now takes a form that is both simpler than before (the DFunArg type is eliminated) and more general: data Unfolding = ... | DFunUnfolding { -- The Unfolding of a DFunId -- See Note [DFun unfoldings] -- df = /\a1..am. \d1..dn. MkD t1 .. tk -- (op1 a1..am d1..dn) -- (op2 a1..am d1..dn) df_bndrs :: [Var], -- The bound variables [a1..m],[d1..dn] df_con :: DataCon, -- The dictionary data constructor (never a newtype datacon) df_args :: [CoreExpr] -- Args of the data con: types, superclasses and methods, } -- in positional order That in turn allowed me to re-enable the DFunUnfolding specialisation in DsBinds. Lots of details here in TcInstDcls: Note [SPECIALISE instance pragmas] I also did some refactoring, in particular to pass the InScopeSet to exprIsConApp_maybe (which in turn means it has to go to a RuleFun). NB: Interface file format has changed!
* Print kinds of non-* tyvar binders in pprTyThingSimon Peyton Jones2013-05-281-5/+6
| | | | This makes the output of :info more useful
* Don't try to use -dynamic-too on WindowsIan Lynagh2013-05-251-1/+6
| | | | It doesn't work
* Revert "Fix -dynamic-too on Windows"Ian Lynagh2013-05-251-14/+1
| | | | | | This reverts commit 5734f7afcc2b9acf857f8e0f745185bf01b91148. It didn't fully fix -dynamic-too on Windows
* Handle -opt<blah> options more consistently (#7909)Simon Marlow2013-05-213-99/+83
| | | | | Now these are always added by the run<blah> functions in SysTools, so we never miss any out. Several cleanups resulted.
* Fix -dynamic-too on WindowsIan Lynagh2013-05-201-1/+14
| | | | | If we're building the dynamic way too, then hasCafRefs needs to check whether the dynamic way would use a dynamic name.
* Fix a build problem with integer-simpleIan Lynagh2013-05-191-3/+1
| | | | | | | We were trying to look up the mkInteger Id before we'd compiled the Integer modules. I'm not sure why this never showed up with integer-gmp; possibly we just always got lucky with the build order.
* Update a comment; spotted by Carter SchonwaldIan Lynagh2013-05-181-1/+1
|
* Link to the right RTS whenever we build a .dll on WindowsIan Lynagh2013-05-152-4/+16
| | | | | When GHCi makes temporary DLLs, those also need to be linked against the right RTS, or we won't be able to load them.