summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* heapview: Clean up language pragmaswip/erikd/heapviewErik de Castro Lopo2017-01-291-1/+13
|
* heapview: Make constructor fields strictErik de Castro Lopo2017-01-291-89/+89
|
* heapview: Move HeadView.hs to GHC.ExtsErik de Castro Lopo2017-01-294-6/+6
|
* heapview: Rename `tipe` to `cltype`Erik de Castro Lopo2017-01-292-8/+8
|
* heapview.cabal: Remove un-needed dependenciesErik de Castro Lopo2017-01-291-5/+0
|
* heapview: Strip back APIErik de Castro Lopo2017-01-294-793/+2
|
* Add tests for heapviewErik de Castro Lopo2017-01-294-0/+88
|
* ghc.mk: Add heapview libraryErik de Castro Lopo2017-01-294-123/+140
|
* Add the heapview libraryErik de Castro Lopo2017-01-298-0/+1617
| | | | This library allows the GHC heap to be inspected from haskell code.
* Add RTS support for GHC.HeapView functionalityErik de Castro Lopo2017-01-293-0/+261
|
* Fix deprecation warnings from containersErik de Castro Lopo2017-01-295-14/+14
| | | | | | | | | | | | | | Summary: The functions that causing warnings were deprecated in containers 0.5 and GHC is already using containers 0.5.9.1. Test Plan: validate Reviewers: rwbarton, bgamari, hsyl20, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3036
* Convert pprTrace in isPredTy to a WARNRyan Scott2017-01-281-5/+19
| | | | | | | | | | | | | | | | | | Summary: There was a `pprTrace` in `isPredTy` that could fire under certain scenarios, causing normal GHC users to see debugging output. This turns it into a less chatty `WARN`, and expounds on the comment below it to add the scenario in #13187 which triggered the `pprTrace`. Reviewers: goldfire, austin, bgamari Reviewed By: goldfire, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3033 GHC Trac Issues: #13187
* Document GHC.Profiling functions [ci skip]Ömer Sinan Ağacan2017-01-281-1/+10
|
* Add delete retry loop. [ci skip]Tamar Christina2017-01-281-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: On Windows we have to retry the delete a couple of times. The reason for this is that a `FileDelete` command just marks a file for deletion. The file is really only removed when the last handle to the file is closed. Unfortunately there are a lot of system services that can have a file temporarily opened using a shared readonly lock, such as the built in AV and search indexer. We can't really guarantee that these are all off, so what we can do is whenever after a `rmtree` the folder still exists to try again and wait a bit. Based on what I've seen from the tests on CI server, is that this is relatively rare. So overall we won't be retrying a lot. If after a reasonable amount of time the folder is still locked then abort the current test by throwing an exception, this so it won't fail with an even more cryptic error. The issue is that these services often open a file using `FILE_SHARE_DELETE` permissions. So they can seemingly be removed, and for most intended purposes they are, but recreating the file with the same name will fail as the FS will prevent data loss. The MSDN docs for `DeleteFile` says: ``` The DeleteFile function marks a file for deletion on close. Therefore, the file deletion does not occur until the last handle to the file is closed. Subsequent calls to CreateFile to open the file fail with ERROR_ACCESS_DENIED. ``` Retrying seems to be a common pattern, SQLite has it in their driver http://www.sqlite.org/src/info/89f1848d7f The only way to avoid this is to run each way of a test in it's own folder. This would also have the added bonus of increased parallelism. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2936 GHC Trac Issues: #12661, #13162
* Remove Data.Tuple doc's claim to have tuple typesChris Martin2017-01-261-1/+1
| | | | | | | | | | | | | | | "The tuple data types" seems like an inaccurate way to lead off the description of this module, which doesn't actually export the tuple data types. The latter part of the sentence, "associated functions", accurately describes the entire module. Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: dfeuer, thomie Differential Revision: https://phabricator.haskell.org/D2924
* Fix the right-shift operation for negative big integers (fixes #12136)Daishi Nakajima2017-01-265-4/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In `x shiftR y`, any of the following conditions cause an abort: - `x` is a negative big integer - The size of `x` and `y` is a multiple of `GMP_NUMB_BITS` - The bit of the absolute value of `x` is filled with `1` For example: Assuming `GMP_NUMB_BITS = 2`, the processing of `-15 shiftR 2` is as follows: 1. -15 = -1111 (twos complement: 10001) 2. right shift 2 (as a positive number) -> 0011 3. Due to the shift larger than GMP_NUMB_BITS, the size of the destination is decreasing (2bit) -> 11 4. Add 1, and get carry: (1) 00 5. abort I fixed it that the destination size does not decrease in such a case. Test Plan: I tested the specific case being reported. Reviewers: goldfire, austin, hvr, bgamari, rwbarton Reviewed By: bgamari, rwbarton Subscribers: mpickering, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D2998 GHC Trac Issues: #12136
* Fatal if we try to reinitialize the RTSSimon Marlow2017-01-261-0/+6
| | | | | | | | | | | | | | | This isn't supported, and fatalling with an error is better than segfaulting later. Test Plan: validate Reviewers: JonCoens, austin, erikd, niteria, bgamari Reviewed By: niteria, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3020
* Bump hsc2hs submoduleBen Gamari2017-01-261-0/+0
|
* Bump nofib submoduleBen Gamari2017-01-261-0/+0
|
* Generalizes the type of asProxyTypeOf (#12805)Dave Laing2017-01-262-1/+3
| | | | | | | | | | | | | | Test Plan: validate Reviewers: austin, hvr, bgamari, RyanGlScott, simonpj Reviewed By: RyanGlScott, simonpj Subscribers: simonpj, RyanGlScott, thomie Differential Revision: https://phabricator.haskell.org/D3017 GHC Trac Issues: #12805
* Don't unnecessarily qualify TH-converted instances with empty contextsRyan Scott2017-01-265-25/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The addition of rigorous pretty-printer tests (499e43824bda967546ebf95ee33ec1f84a114a7c) had the unfortunate side-effect of revealing a bug in `hsSyn/Convert.hs` wherein instances are _always_ qualified with an instance context, even if the context is empty. This led to instances like this: ``` instance Foo Int ``` being pretty-printed like this! ``` instance () => Foo Int ``` We can prevent this by checking if the context is empty before adding an HsQualTy to the type. Also does some refactoring around HsForAllTys in `Convert` while I was in town. Fixes #13183. Test Plan: ./validate Reviewers: goldfire, bgamari, austin, alanz Reviewed By: alanz Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D3018 GHC Trac Issues: #13183
* Prune unneeded Derive* language pragmasGabor Greif2017-01-262-3/+2
|
* Make type import/export API Annotation friendlyAlan Zimmerman2017-01-2612-119/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: At the moment an export of the form type C(..) is parsed by the rule ``` | 'type' oqtycon {% amms (mkTypeImpExp (sLL $1 $> (unLoc $2))) [mj AnnType $1,mj AnnVal $2] } ``` This means that the origiinal oqtycon loses its location which is then retained in the AnnVal annotation. The problem is if the oqtycon has its own annotations, these get lost. e.g. in type (?)(..) the parens annotations for (?) get lost. This patch adds a wrapper around the name in the IE type to (a) provide a distinct location for the adornment annotation and (b) identify the specific adornment, for use in the pretty printer rather than occName magic. Updates haddock submodule Test Plan: ./validate Reviewers: mpickering, dfeuer, bgamari, austin Reviewed By: dfeuer Subscribers: dfeuer, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D3016 GHC Trac Issues: #13163
* Typos in comments [ci skip]Gabor Greif2017-01-262-2/+2
|
* Nix typo and redundant where-clausesRyan Scott2017-01-255-6/+1
|
* Add pragCompleteDName to templateHaskellNamesRyan Scott2017-01-252-1/+19
| | | | | | | 95dc6dc070deac733d4a4a63a93e606a2e772a67 forgot to add `pragCompleteDName` to the list of `templateHaskellNames`, which caused a panic if you actually tried to splice a `COMPLETE` pragma using Template Haskell. This applies the easy fix and augments the regression test to check for this in the future.
* Generalize the type of runRW#David Feuer2017-01-253-13/+23
| | | | | | | | | | | | | | | | | | | | | * Generalize the type of `runRW#` to allow arbitrary return types. * Use `runRW#` to implement `Control.Monad.ST.Lazy.runST` (this provides evidence that it actually works properly with the generalized type). * Adjust the type signature in the definition of `oneShot` to match the one it is given in `MkId`. Reviewers: simonmar, austin, bgamari, hvr Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3012 GHC Trac Issues: #13178
* Template Haskell support for COMPLETE pragmasMatthew Pickering2017-01-269-43/+90
| | | | | | | | | | Reviewers: RyanGlScott, austin, goldfire, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2997 GHC Trac Issues: #13098
* COMPLETE pragmas for enhanced pattern exhaustiveness checkingMatthew Pickering2017-01-2651-154/+959
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new pragma so that users can specify `COMPLETE` sets of `ConLike`s in order to sate the pattern match checker. A function which matches on all the patterns in a complete grouping will not cause the exhaustiveness checker to emit warnings. ``` pattern P :: () pattern P = () {-# COMPLETE P #-} foo P = () ``` This example would previously have caused the checker to warn that all cases were not matched even though matching on `P` is sufficient to make `foo` covering. With the addition of the pragma, the compiler will recognise that matching on `P` alone is enough and not emit any warnings. Reviewers: goldfire, gkaracha, alanz, austin, bgamari Reviewed By: alanz Subscribers: lelf, nomeata, gkaracha, thomie Differential Revision: https://phabricator.haskell.org/D2669 GHC Trac Issues: #8779
* Update Win32 submodule to fix Windows buildMatthew Pickering2017-01-251-0/+0
| | | | | | | | Reviewers: RyanGlScott, austin, Phyx, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3021
* Add myself [ci skip]Gabor Greif2017-01-251-0/+1
|
* Typos in comments [ci skip]Gabor Greif2017-01-2513-19/+19
|
* Update .mailmapMatthew Pickering2017-01-251-0/+1
|
* testsuite: Bump compiler allocations of T5837Ben Gamari2017-01-241-1/+3
| | | | | Gipeda suggests that this is due to the recent top-level string literals in Core patch.
* Bump Win32 version.Ben Gamari2017-01-249-9/+12
| | | | | | | | | | | | | | | | | | | | | | Bump the version of `Win32` to `2.5.0.0` which is a major update and includes fixes for wrong alignments and wrong 64-bit types. Strangely enough this also seems to resolve #12713, where `T10858` was failing due to too-low allocations. The underlying type aliases have changed, so there is a potential for user programs not to compile anymore, but the types were incorrect. This also requires a bump in the `directory`, `Cabal`, and `process` submodules. Original author: Tamar Christina <tamar@zhox.com> Test Plan: ./validate Reviewers: bgamari, RyanGlScott, austin Subscribers: hvr, RyanGlScott, thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2938
* HscTypes: Use foldl' instead of foldrBen Gamari2017-01-241-3/+4
| | | | | | | | | | | | | | | | | | In this case we are building a map, for which `foldl'` is much better suited. This has a small but consistent impact on compiler allocations, ``` -1 s.d. ----- -0.161% +1 s.d. ----- -0.011% Average ----- -0.086% ``` Test Plan: Validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2967
* nativeGen: Use `foldl'` instead of `foldr` in free register accumulationBen Gamari2017-01-246-9/+13
| | | | | | | | | | | | | | | | | | | Manipulations of `FreeRegs` values are all just bit-operations on a word. Turning these `foldr`s into `foldl'`s has a very small but consistent effect on compiler allocations, ``` -1 s.d. ----- -0.065% +1 s.d. ----- -0.018% Average ----- -0.042% ``` Test Plan: Validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2966
* UniqSet: Implement unionManyUniqSets in terms of foldl' instead of foldrBen Gamari2017-01-241-4/+4
| | | | | | | | | | | | | | | | | | | | foldr generally isn't a good choice for folds where the result can't be consumed incrementally. This gives a very modest improvement in compiler allocations, ``` -1 s.d. ----- -0.182% +1 s.d. ----- -0.050% Average ----- -0.116% ``` This is clearly semantics-preserving since we are constructing a set. Test Plan: Validate Reviewers: austin Subscribers: dfeuer, thomie Differential Revision: https://phabricator.haskell.org/D2965
* Partially revert D3001David Feuer2017-01-241-9/+7
| | | | | | | | | | | | | D3001 accidentally changed the meaning of `containsSpan`. Revert that change. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3015
* Don't put foralls in front of TH-spliced GADT constructors that don't need themRyan Scott2017-01-242-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It turns out that D2974 broke this program (see https://phabricator.haskell.org/rGHC729a5e452db5#58801): ```lang=haskell {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -ddump-splices #-} module Bug where import GHC.Exts (Constraint) $([d| data Dec13 :: (* -> Constraint) -> * where MkDec13 :: c a => a -> Dec13 c |]) ``` This was actually due to a long-standing bug in `hsSyn/Convert` that put unnecessary `forall`s in front of GADT constructors that didn't have any explicitly quantified type variables. This cargo-cults the code in `Convert` that handles `ForallT` and adapts it to `ForallC`. Fixes #13123 (for real this time). Test Plan: make test TEST=T13123 Reviewers: goldfire, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3002 GHC Trac Issues: #13123
* Skip path_with_commas when dyn unavailableBartosz Nitka2017-01-241-1/+2
| | | | | | | | | | | | | | | | | | | RyanGlScott reported a failure: ``` Could not find module 'Prelude'; Perhaps you haven't installed the "dyn" libraries for package ‘base-4.10.0.0’? ``` This might fix it. Test Plan: harbormaster Reviewers: austin, bgamari, thomie, RyanGlScott Reviewed By: RyanGlScott Subscribers: thomie, simonmar Differential Revision: https://phabricator.haskell.org/D3013
* Remove unused LOCAL_GHC_PKG definition from a test MakefileReid Barton2017-01-231-2/+0
| | | | | | | | | | | | Test Plan: harbormaster Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3004
* Add a failing test for #13102Reid Barton2017-01-239-0/+60
| | | | | | | | | | | | | | Test Plan: harbormaster Reviewers: austin, ezyang, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3005 GHC Trac Issues: #13102
* Document -fspecialise-aggressivelyMatthew Pickering2017-01-231-0/+12
| | | | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3007 GHC Trac Issues: #12979
* Re-sort case alternatives after scrutinee constant folding (#13170)Reid Barton2017-01-233-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d3b546b1a605 added a "scrutinee constant folding" pass that rewrites a case expression whose scrutinee is an expression like x +# 3#. But case expressions are supposed to have their alternatives in sorted order, so when the scrutinee is (for example) negateInt# x#, we need to re-sort the alternatives after mapping their values. This showed up as a core lint failure when compiling System.Process.Posix: isSigIntQuit n = sig == sigINT || sig == sigQUIT where sig = fromIntegral (-n) Data.List.sortBy is supposed to be linear-time on sorted or reverse-sorted input, so it is probably not worth doing anything more clever than this. Test Plan: Added a new test T13170 for the above case. Reviewers: austin, hsyl20, simonpj, bgamari Reviewed By: hsyl20, simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3008 GHC Trac Issues: #13170
* Ensure that scrutinee constant folding wraps numbersSylvain Henry2017-01-235-32/+77
| | | | | | | | | | | | | | Test Plan: T13172 Reviewers: rwbarton, simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D3009 GHC Trac Issues: #13172
* users-guide: Document -dppr-ticksBen Gamari2017-01-231-0/+5
|
* typecheck: Fix noteBen Gamari2017-01-231-1/+1
|
* Make tickishContains fasterBartosz Nitka2017-01-232-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This just reorders some inequality checks to make the common case cheaper. The results are quite dramatic for #11095, but that's probably because something else is causing it to do too much work. Before (full https://phabricator.haskell.org/P136): ``` 13,589,495,832 bytes allocated in the heap ``` After (full https://phabricator.haskell.org/P137): ``` 7,885,575,872 bytes allocated in the heap ``` This is with `BuildFlavour = devel2`, so take it with a a grain of salt. For reference, with no `-g` I get: ``` 155,703,112 bytes allocated in the heap ``` so we're still quite a way off. Test Plan: harbormaster I still have to test locally Reviewers: austin, bgamari Subscribers: thomie, simonmar Differential Revision: https://phabricator.haskell.org/D3001 GHC Trac Issues: #11095
* Record evaluated-ness on workers and wrappersSimon Peyton Jones2017-01-2311-61/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is a refinement of the original commit (which was reverted): commit 6b976eb89fe72827f226506d16d3721ba4e28bab Date: Fri Jan 13 08:56:53 2017 +0000 Record evaluated-ness on workers and wrappers In Trac #13027, comment:20, I noticed that wrappers created after demand analysis weren't recording the evaluated-ness of strict constructor arguments. In the ticket that led to a (debatable) Lint error but in general the more we know about evaluated-ness the better we can optimise. This commit adds that info * both in the worker (on args) * and in the wrapper (on CPR result patterns). See Note [Record evaluated-ness in worker/wrapper] in WwLib On the way I defined Id.setCaseBndrEvald, and used it to shorten the code in a few other places Then I added test T13077a to test the CPR aspect of this patch, but I found that Lint failed! Reason: simpleOptExpr was discarding evaluated-ness info on lambda binders because zapFragileIdInfo was discarding an Unfolding of (OtherCon _). But actually that's a robust unfolding; there is no need to discard it. To fix this: * zapFragileIdInfo only zaps fragile unfoldings * Replace isClosedUnfolding with isFragileUnfolding (the latter is just the negation of the former, but the nomenclature is more consistent). Better documentation too Note [Fragile unfoldings] * And Simplify.simplLamBndr can now look at isFragileUnfolding to decide whether to use the longer route of simplUnfolding. For some reason perf/compiler/T9233 improves in compile-time allocation by 10%. Hooray Nofib: essentially no change: -------------------------------------------------------------------------------- Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- cacheprof +0.0% -0.3% +0.9% +0.4% +0.0% -------------------------------------------------------------------------------- Min +0.0% -0.3% -2.4% -2.4% +0.0% Max +0.0% +0.0% +9.8% +11.4% +2.4% Geometric Mean +0.0% -0.0% +1.1% +1.0% +0.0%