summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add INLINABLE pragma to (<**>)wip/inlinable-bugMatthew Pickering2017-01-021-0/+2
| | | | | | | | Reviewers: austin, hvr, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2912
* Remove documentation about non-existent flag.Edward Z. Yang2017-01-011-9/+0
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Fix incorrect statement about plugin packages.Edward Z. Yang2017-01-011-4/+4
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Fix various issues with testsuite code on WindowsTamar Christina2016-12-283-39/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously we would make direct calls to `diff` using `os.system`. On Windows `os.system` is implemented using the standard idiom `CreateProcess .. WaitForSingleObject ..`. This again runs afoul with the `_exec` behaviour on Windows. So we ran into some trouble where sometimes `diff` would return before it's done. On tests which run multiple ways, such as `8086` what happens is that we think the diff is done and continue. The next way tries to set things up again by removing any previous directory. This would then fail with and error saying the directory can't be removed. Which is true, because the previous diff code/child is still running. We shouldn't make any external calls to anything using `os.system`. Instead just use `runCmd` which uses `timeout`. This also ensures that if we hit the cygwin bug where diff or any other utility hangs, we kill it and continue and not hang the entire test and leave hanging processes. Further more we also: Ignore error lines from `removeFile` from tools in the testsuite. This is a rather large hammer to work around the fact that `hsc2hs` often tries to remove it's own file too early. When this is patched the workaround can be removed. See Trac #9775 We mark `prog003` as skip. Since this test randomly fails and passes. For stability it's disabled but it is a genuine bug which we should find. It's something with interface files being overwritten. See Trac #11317 when `rmtree` hits a readonly file, the `onerror` handler is raised afterwards but not during the tree walk. It doesn't allow you to recover and continue as we thought. Instead you have to explicitly start again. This is why sometimes even though we call `cleanup` before `os.mkdirs`, it would sometimes fail with an error that the folder already exists. So we now do a second walk. A new verbosity level (4) will strip the silent flags from `MAKE` invocations so you can actually see what's going on. Test Plan: ./validate on build bots. Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: mpickering, thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2894 GHC Trac Issues: #12661, #11317, #9775
* Bump array submoduleBen Gamari2016-12-271-0/+0
| | | | Fixes overflow check from fix to #229.
* Testsuite: Skip failing tests on PowerPC 64-bitPeter Trommler2016-12-279-13/+41
| | | | | | | | | | | | | | | | | | | The Power ISA says the result of a division by zero is undefined. So ignore stdout on PowerPC 64-bit systems. Disable ext-interp tests on 64-bit PowerPC. We don't have support for PowerPC 64-bit ELF in the RTS linker, which is needed for the external interpreter. Test Plan: ./validate Reviewers: austin, simonmar, hvr, erikd, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2782
* testsuite: Fix T13025Ben Gamari2016-12-272-2/+2
| | | | | | It relied on `wc`, which produces slightly different format on OS X and Linux. Instead use `grep -c` which appears to be supported on both platforms and produces consistent output.
* Expand I/O CP in commentsJoachim Breitner2016-12-271-2/+2
| | | | | as suggested by @gracjan at https://github.com/ghc/ghc/commit/efc4a1661f0fc1004a4b7b0914f3d3a08c2e791a#commitcomment-20284337
* CallArity: Use exprIsCheap to detect thunksJoachim Breitner2016-12-262-10/+22
| | | | | | | | | | | | | | | Originally, everything that is not in WHNF (`exprIsWHNF`) is considered a thunk, not eta-expanded, to avoid losing any sharing. This is also how the published papers on Call Arity describe it. In practice, there are thunks that do a just little work, such as pattern-matching on a variable, and the benefits of eta-expansion likely oughtweigh the cost of doing that repeatedly. Therefore, this implementation of Call Arity considers everything that is not cheap (`exprIsCheap`) as a thunk. Nofib reports -2.58% allocations for scs and -40.93% allocation for wheel-sieve1; the latter has - 2.92% runtime.
* Remove redudant import from check-pprMatthew Pickering2016-12-261-1/+0
|
* check-ppr: Make --dump the default behaviorBen Gamari2016-12-261-11/+6
|
* rename: Add note describing #11216Ben Gamari2016-12-231-4/+22
|
* Define MAP_ANONYMOUS on systems that only provide MAP_ANONGracjan Polak2016-12-232-5/+10
| | | | | | | | | | | | Reviewers: simonmar, erikd, austin, bgamari Reviewed By: bgamari Subscribers: gracjan, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D2881 GHC Trac Issues: #13005
* base: Override Foldable.{toList,length} for NonEmptyArtyom2016-12-231-2/+4
| | | | | | | | | | | | | | | | | | | | Previously the Foldable instance for NonEmpty used default implementations for toList and length. I assume that the existing implementations (i.e. Data.List.NonEmpty.{toList,length}) are better than the default ones, and frankly can't see a good reason why they might be worse – but if they are, instead of this commit we'd have to switch Data.List.NonEmpty.{toList,length} to use Foldable. Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: int-index, thomie Differential Revision: https://phabricator.haskell.org/D2882
* Fix test for T12877Sylvain Henry2016-12-234-22/+6
| | | | | | | | | | | | Summary: See https://phabricator.haskell.org/rGHCd3b546b1a605 Reviewers: nomeata, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2883
* Use python3 for lintersMatthew Pickering2016-12-234-6/+6
| | | | | | | | | | | | | | We now require python3 for the testsuite so rather than require two versions of python it makes sense to use python3 for the linters as well. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2888
* Add caret diagnosticsPhil Ruffwind2016-12-2316-14/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | This is controlled by -f[no-]diagnostics-show-caret. Example of what it looks like: ``` | 42 | x = 1 + () | ^^^^^^ ``` This is appended to each diagnostic message. Test Plan: testsuite/tests/warnings/should_fail/CaretDiagnostics1 testsuite/tests/warnings/should_fail/CaretDiagnostics2 Reviewers: simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: joehillen, mpickering, Phyx, simonpj, alanz, thomie Differential Revision: https://phabricator.haskell.org/D2718 GHC Trac Issues: #8809
* rename: Don't require 'fail' in non-monadic contextsBen Gamari2016-12-234-4/+32
| | | | Fixes #11216.
* users-guide: Kill extraneous linkBen Gamari2016-12-231-1/+1
|
* testsuite: Split out Windows allocations numbers for T12234Ben Gamari2016-12-231-1/+3
|
* Push coercions in exprIsConApp_maybeSimon Peyton Jones2016-12-236-2/+114
| | | | | | | | | | Trac #13025 showed up the fact that exprIsConApp_maybe isn't clever enough: it didn't push coercions through applicatins, and that meant we weren't getting as much superclass selection as we should. It's easy to fix, happily. See Note [Push coercions in exprIsConApp_maybe]
* Removed dead code in DsCCall.mk_altSimon Peyton Jones2016-12-231-48/+41
| | | | Fixes Trac #13029 by deleting code and adding comments
* Propagate evaluated-ness a bit more faithfullySimon Peyton Jones2016-12-234-3/+54
| | | | | | | | | | This was provoked by Trac #13027. The fix in Simplify actually cures the reported bug; see Note [Case binder evaluated-ness] in Simplify. The fix in CoreTidy looks like an omission that I fixed while I was at it.
* Tiny refactor in CoreTidySimon Peyton Jones2016-12-231-10/+10
|
* Float unboxed expressions by boxingSimon Peyton Jones2016-12-237-118/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes GHC's floating more robust, by allowing it to float unboxed expressions of at least some common types. See Note [Floating MFEs of unlifted type] in SetLevels. This was all provoked by Trac #12603 In working this through I also made a number of other corner-case changes in SetLevels: * Previously we inconsistently use exprIsBottom (which checks for bottom) instead of exprBotStrictness_maybe (which checks for bottoming functions). As well as being inconsistent it was simply less good. See Note [Bottoming floats] * I fixed a case where were were unprofitably floating an expression because we thought it escaped a value lambda (see Note [Escaping a value lambda]). The relevant code is float_me = (dest_lvl `ltMajLvl` (le_ctxt_lvl env) && not float_is_lam) -- NEW * I made lvlFloatRhs work properly in the case where abs_vars is non-empty. It wasn't wrong before, but it did some stupid extra floating.
* Ensure that even bottoming functions have an unfoldingSimon Peyton Jones2016-12-231-20/+26
| | | | | | | | | | | The payload of this change is to ensure that a bottoming function still has an unfolding, just one with an UnfoldingGuidance of UnfoldNever. Previously it was getting an unfolding of NoUnfolding. I don't think that was really /wrong/, but it was inconsistent with the general principle of giving everthing an unfoding if we know it. And it seems tideier this way.
* Comments onlySimon Peyton Jones2016-12-231-0/+2
|
* White space onlySimon Peyton Jones2016-12-231-4/+4
|
* Fix a bug in ABot handling in CoreAritySimon Peyton Jones2016-12-235-4/+33
| | | | | | | | | | | | | | | See Note [ABot branches: use max] in CoreArity. I stumbled on this when investigating something else, and opened Trac #13031 to track it. It's very hard to tickle the bug, which is why it has lurked so long, but the test stranal/should_compile/T13031 does so Oddly, the testsuite framework doesn't actually run the test; I have no idea why.
* Alpha-renaming and white space onlySimon Peyton Jones2016-12-231-10/+11
|
* Allow timeout to kill entire process tree.Tamar Christina2016-12-232-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | Summary: we spawn the child processes with handle inheritance on. So they inherit the std handles. The problem is that the job handle gets inherited too. So the `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE` doesn't get used since there are open handles to the job in the children. We then terminate the top level process which is `sh` but leaves the children around. This explicitly disallows the inheritance of the job and events handle. Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2895 GHC Trac Issues: #13004
* Revert "Suppress duplicate .T files"Gabor Greif2016-12-221-1/+1
| | | | | | | | This reverts commit 9a29b65bda8aed4c5fdbff25866ddf2dd1583210. It turns out that while not harmful, that commit is unnecessary, and a `make clean` resolved it. See: https://phabricator.haskell.org/rGHC9a29b65bda8aed4c5fdbff25866ddf2dd1583210
* Fix another forward reference to a NoteRyan Scott2016-12-211-2/+2
| | | | | | A continuation of ccc918cdc8b2d147c4dbc29bfc87c058862a97cd. [ci skip]
* Notes on parsing lists in Parser.yEdward Z. Yang2016-12-211-0/+44
| | | | | | | | | | | | | | | Summary: Maybe everyone knows this but I think it is worth mentioning Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: none Reviewers: bgamari, austin Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D2890
* Update ghc-cabal command line usage text.Edward Z. Yang2016-12-211-3/+7
| | | | | | | | | | | | | | | Summary: Old usage text was horribly out-of-date. Now updated! Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: none Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2889
* Support for abi-depends for computing shadowing.Edward Z. Yang2016-12-2121-133/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a complete fix based off of ed7af26606b3a605a4511065ca1a43b1c0f3b51d for handling shadowing and out-of-order -package-db flags simultaneously. The general strategy is we first put all databases together, overriding packages as necessary. Once this is done, we successfully prune out broken packages, including packages which depend on a package whose ABI differs from the ABI we need. Our check gracefully degrades in the absence of abi-depends, as we only check deps which are recorded in abi-depends. Contains time and Cabal submodule update. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: niteria, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2846 GHC Trac Issues: #12485
* Disambiguate two Notes with identical namesRyan Scott2016-12-211-2/+2
| | | | | | It turns out there were two Notes in the GHC codebase named [Pattern synonym signatures]. To avoid confusion, I gave one Note a slightly different name.
* Fix a forward reference to a NoteRyan Scott2016-12-211-2/+2
|
* Improved perf for T12227Simon Peyton Jones2016-12-211-1/+3
| | | | | | | | | | | | | | | Improved compiler allocations by abut 5%. It comes from one of 1a4c04b1 Fix 'SPECIALISE instance' c48595ee Never apply worker/wrapper to DFuns 05d233e8 Move InId/OutId to CoreSyn e07ad4db Don't eta-expand in stable unfoldings d250d493 Add INLINE pragamas on Traversable default methods c66dd05c Move typeSize/coercionSize into TyCoRep I think d250d493. But it's good anyway.
* Test Trac #12950Simon Peyton Jones2016-12-212-0/+18
|
* Fix 'SPECIALISE instance'Simon Peyton Jones2016-12-2111-98/+182
| | | | | | | | | | | | | | | | | | | | | Trac #12944 showed that the DsBinds code that implemented a SPECIALISE pragma was inadequate if the constraints solving added let-bindings for dictionaries. The result was that we ended up with an unbound dictionary in a DFunUnfolding -- and Lint didn't even check for that! Fixing this was not entirely straightforward * In DsBinds.dsSpec we use a new function TcEvidence.collectHsWrapBinders to pick off the lambda binders from the HsWapper * dsWrapper now returns a (CoreExpr -> CoreExpr) function * CoreUnfold.specUnfolding now takes a (CoreExpr -> CoreExpr) function it can use to specialise the unfolding. On the whole the code is simpler than before.
* Never apply worker/wrapper to DFunsSimon Peyton Jones2016-12-212-38/+46
| | | | | | | | | While fixing Trac #12444 I found an occasion on which we applied worker/wrapper to a DFunId. This is bad: it destroys the magic DFunUnfolding. This patch is a minor refactoring that stops this corner case happening, and tidies up the code a bit too.
* Move InId/OutId to CoreSynSimon Peyton Jones2016-12-218-84/+51
| | | | | | | | It turned out that many different modules defined the same type synonyms (InId, OutId, InType, OutType, etc) for the same purpose. This patch is refactoring only: it moves all those definitions to CoreSyn.
* Lint DFunUnfoldingsSimon Peyton Jones2016-12-211-2/+14
| | | | | Previously we simply failed to Lint these DFunUnfoldings, which led to a very delayed error message for Trac #12944
* Don't eta-expand in stable unfoldingsSimon Peyton Jones2016-12-217-13/+64
| | | | | See SimplUtils Note [No eta expansion in stable unfoldings], and Trac #9509 for an excellend diagnosis by Nick Frisby
* Add INLINE pragamas on Traversable default methodsSimon Peyton Jones2016-12-211-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I discovered, when debugging a performance regression in the compiler, that the list instance of mapM was not being inlined at call sites, with terrible runtime costs. It turned out that this was a serious (but not entirely obvious) omission of an INLINE pragmas in the class declaration for Traversable. This patch fixes it. I reproduce below the Note [Inline default methods], which I wrote at some length. We may well want to apply the same fix in other class declarations whose default methods are often used. {- Note [Inline default methods] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider class ... => Traversable t where ... mapM :: Monad m => (a -> m b) -> t a -> m (t b) mapM = traverse -- Default method instance Traversable [] where {-# INLINE traverse #-} traverse = ...code for traverse on lists ... This gives rise to a list-instance of mapM looking like this $fTraversable[]_$ctaverse = ...code for traverse on lists... {-# INLINE $fTraversable[]_$ctaverse #-} $fTraversable[]_$cmapM = $fTraversable[]_$ctraverse Now the $ctraverse obediently inlines into the RHS of $cmapM, /but/ that's all! We get $fTraversable[]_$cmapM = ...code for traverse on lists... with NO INLINE pragma! This happens even though 'traverse' had an INLINE pragma becuase the author knew it should be inlined pretty vigorously. Indeed, it turned out that the rhs of $cmapM was just too big to inline, so all uses of mapM on lists used a terribly inefficient dictionary-passing style, because of its 'Monad m =>' type. Disaster! Solution: add an INLINE pragma on the default method: class ... => Traversable t where ... mapM :: Monad m => (a -> m b) -> t a -> m (t b) {-# INLINE mapM #-} -- VERY IMPORTANT! mapM = traverse
* Move typeSize/coercionSize into TyCoRepSimon Peyton Jones2016-12-214-47/+59
| | | | | | | | | | | | | | | While investigating something else I found that 'typeSize' was allocating like crazy. Stupid becuase it should allocate precisely nothing!! Turned out that it was because typeSize and coercionSize were mutually recursive across module boundaries, and so could not benefit from the CPR property. To fix this I moved them both into TyCoRep. It's not critical (because typeSize is really only used in debug mode, but I tripped over and example (T5642) in which typeSize was one of the biggest single allocators in all of GHC. And it's easy to fix, so I did.
* Add note for rebindable syntax of [a..b]Simon Peyton Jones2016-12-211-0/+4
| | | | See Trac #12969
* Test Trac #12968, plus some commentsSimon Peyton Jones2016-12-214-0/+20
|
* Fix typos (not test relevant)Gabor Greif2016-12-212-2/+2
|