summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix egregious error from last commitwip/T14880Richard Eisenberg2018-06-152-2/+2
| | | | | I accidentally reversed the polarity of a key test in the Type module.
* Clarify some commentsRichard Eisenberg2018-06-151-1/+3
|
* Resotre nondeterministic tyCoVarsOfTyprRichard Eisenberg2018-06-016-104/+197
|
* bugfixesRichard Eisenberg2018-05-312-14/+20
|
* BugfixingRichard Eisenberg2018-05-3120-122/+135
|
* BugfixingRichard Eisenberg2018-05-308-31/+26
|
* Fix newtype instance GADTsRichard Eisenberg2018-05-301-2/+9
|
* Change tyCoVarsOfType to close over kinds at endRichard Eisenberg2018-05-303-106/+92
| | | | | | | | This change improved both efficiency and correctness. See new text in Note [Free variables of types] in TyCoRep. This was suggested on #14880, though there is no known program which causes the correctness bug.
* Fix #14880.Richard Eisenberg2018-05-305-22/+84
| | | | | | | This fix is described in Note [Removing variables with bound kinds] in TcType. This commit also changes split_dvs to close over kinds at the end, which seems more performant than walking over the kind of every tyvar occurrence.
* Test #14904 in dependent/should_compile/T14904Richard Eisenberg2018-04-232-0/+12
|
* Typo fix in scavenge_one comment [skip ci]Ömer Sinan Ağacan2018-04-221-1/+1
|
* Remove a outdated comment [skip ci]Ömer Sinan Ağacan2018-04-211-3/+0
|
* rts: Use g0 for &generations[0]Ömer Sinan Ağacan2018-04-211-3/+2
| | | | [skip ci]
* s/traverse_weak_ptr_list/traverseWeakPtrList in comments [skip ci]Ömer Sinan Ağacan2018-04-211-5/+5
|
* Remove unnecessary check in simplCastTobias Dammers2018-04-202-8/+16
| | | | | | | | | | | | | The coercion optimizer will take care of it anyway, and the check is prohibitively expensive. See Trac #14737. Reviewers: bgamari Subscribers: simonpj, thomie, carter Differential Revision: https://phabricator.haskell.org/D4568
* base: Add a test for T10412Ben Gamari2018-04-203-0/+11
| | | | | | | | | | | | | Expects the current behavior, will be updated by D4593 to reflect desired behavior. Reviewers: hvr Subscribers: thomie, carter GHC Trac Issues: #10412 Differential Revision: https://phabricator.haskell.org/D4610
* Fix implementation of rnIfaceBndrMatthew Pickering2018-04-201-1/+1
| | | | | | | | | | | | Reviewers: ezyang, bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #15041 Differential Revision: https://phabricator.haskell.org/D4600
* Remove broken top-level shell.nixMatthew Pickering2018-04-201-61/+0
| | | | | | | | | | | | | | | There is a maintained shell.nix file in the hadrian submodule. This has long since been broken anyway. Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #15045 Differential Revision: https://phabricator.haskell.org/D4599
* comments onlySimon Peyton Jones2018-04-201-4/+4
|
* Inline wrappers earlierSimon Peyton Jones2018-04-2013-265/+323
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has a single significant change: strictness wrapper functions are inlined earlier, in phase 2 rather than phase 0. As shown by Trac #15056, this gives a better chance for RULEs to fire. Before this change, a function that would have inlined early without strictness analyss was instead inlining late. Result: applying "optimisation" made the program worse. This does not make too much difference in nofib, but I've stumbled over the problem more than once, so even a "no-change" result would be quite acceptable. Here are the headlines: -------------------------------------------------------------------------------- Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- cacheprof -0.5% -0.5% +2.5% +2.5% 0.0% fulsom -1.0% +2.6% -0.1% -0.1% 0.0% mate -0.6% +2.4% -0.9% -0.9% 0.0% veritas -0.7% -23.2% 0.002 0.002 0.0% -------------------------------------------------------------------------------- Min -1.4% -23.2% -12.5% -15.3% 0.0% Max +0.6% +2.6% +4.4% +4.3% +19.0% Geometric Mean -0.7% -0.2% -1.4% -1.7% +0.2% * A worthwhile reduction in binary size. * Runtimes are not to be trusted much but look as if they are moving the right way. * A really big win in veritas, described in comment:1 of Trac #15056; more fusion rules fired. * I investigated the losses in 'mate' and 'fulsom'; see #15056.
* Caching coercion roles in NthCo and coercionKindsRole refactoringTobias Dammers2018-04-2028-343/+4358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While addressing nonlinear behavior related to coercion roles, particularly `NthCo`, we noticed that coercion roles are recalculated often even though they should be readily at hand already in most cases. This patch adds a `Role` to the `NthCo` constructor so that we can cache them rather than having to recalculate them on the fly. https://ghc.haskell.org/trac/ghc/ticket/11735#comment:23 explains the approach. Performance improvement over GHC HEAD, when compiling Grammar.hs (see below): GHC 8.2.1: ``` ghc Grammar.hs 176.27s user 0.23s system 99% cpu 2:56.81 total ``` before patch (but with other optimizations applied): ``` ghc Grammar.hs -fforce-recomp 175.77s user 0.19s system 100% cpu 2:55.78 total ``` after: ``` ../../ghc/inplace/bin/ghc-stage2 Grammar.hs 10.32s user 0.17s system 98% cpu 10.678 total ``` Introduces the following regressions: - perf/compiler/parsing001 (possibly false positive) - perf/compiler/T9872 - perf/compiler/haddock.base Reviewers: goldfire, bgamari, simonpj Reviewed By: simonpj Subscribers: rwbarton, thomie, carter GHC Trac Issues: #11735 Differential Revision: https://phabricator.haskell.org/D4394
* Bump transformers submoduleRyan Scott2018-04-201-0/+0
| | | | | This brings in a commit which migrates Contravariant instances from base to transformers.
* Fixes isAlphaNum re. isAlpha/isNumber and doc fix (trac issue #10412)ARJANEN Loïc Jean David2018-04-192-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Corrects the inconsistency between Data.Char.isAlphaNum, Data.Char.isAlpha and Data.Char.isNumber. Indeed, isAlphaNum was returning True not only when isAlpha or isNumber returned True but also when isMark did. The selectors for the Mn, Mc and Me general categories where removed from the macro generating u_iswalnum in ubconfc. Also, Data.Char.isAlphaNum's documentation was changed to state that isAlphaNum returns true not only for Unicode number digits but for Unicode numbers in general in Unicode.hs. Signed-off-by: ARJANEN Loïc Jean David <arjanen.loic@gmail.com> Reviewers: hvr, ekmett, lelf, bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #10412 Differential Revision: https://phabricator.haskell.org/D4593
* Lint types in newFamInstRyan Scott2018-04-194-31/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We weren't linting the types used in `newFamInst`, which might have been why #15012 went undiscovered for so long. Let's fix that. One has to be surprisingly careful with expanding type synonyms in `lintType`, since in the offending program (simplified): ```lang=haskell type FakeOut a = Int type family TF a type instance TF Int = FakeOut a ``` If one expands type synonyms, then `FakeOut a` will expand to `Int`, which masks the issue (that `a` is unbound). I added an extra Lint flag to configure whether type synonyms should be expanded or not in Lint, and disabled this when calling `lintTypes` from `newFamInst`. As evidence that this works, I ran it on the offending program from #15012, and voilà: ``` $ ghc3/inplace/bin/ghc-stage2 Bug.hs -dcore-lint [1 of 1] Compiling Foo ( Bug.hs, Bug.o ) ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.5.20180417 for x86_64-unknown-linux): Core Lint error <no location info>: warning: In the type ‘... (Rec0 (FakeOut b_a1Qt))))’ @ b_a1Qt is out of scope ``` Test Plan: make test TEST=T15057 Reviewers: simonpj, goldfire, bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #15057 Differential Revision: https://phabricator.haskell.org/D4611
* boot: Fix computation of TOPBen Gamari2018-04-191-1/+1
| | | | | | | | | Test Plan: Run `./boot`, check to make sure that `libraries/ghc-prim/GNUmakefile` is sane Subscribers: thomie, carter, sjakobi Differential Revision: https://phabricator.haskell.org/D4580
* configure: Use -Werror to check for existence of -no-pieBen Gamari2018-04-191-1/+1
| | | | | | | | | | | | | | | | | | | Clang throws a warning instead of an error when it is passed -no-pie, clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument] Consequently configure concludes that it supports -no-pie. However, this will fail when used with -Werror. The solution is to simply use -Werror in the configure check. Thanks to @goldfire for reporting this. Reviewers: hvr Subscribers: thomie, carter, goldfire Differential Revision: https://phabricator.haskell.org/D4557
* parsec: Make version hack compatible with WindowsBen Gamari2018-04-191-0/+0
| | | | Fixes D4609 on Windows by bumping parsec submodule.
* testsuite: Fix `./validate --slow`Alp Mestanogullari2018-04-1915-24/+36
| | | | | | | | | | | | | | | | | | | | | This fixes all unexpected passes and unexpected failures from a `./validate --slow` run I did last week. I commented on many tickets and created a few more as I was going through the failing tests. A summary of the entire process is available at: https://gist.github.com/alpmestan/c371840968f086c8dc5b56af8325f0a9 This is part of an attempt to have `./validate --slow` pass, tracked in #14890. Another patch will be necessary for the unexpected stats failures. Test Plan: ./validate --slow (not green yet) Reviewers: bgamari, simonmar Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D4546
* Bump base to version 4.12.0.0Ryan Scott2018-04-1992-97/+97
| | | | | | | | | | | | | | | | Summary: Bumps several submodules. Test Plan: ./validate Reviewers: hvr, bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #15018 Differential Revision: https://phabricator.haskell.org/D4609
* Fix #15012 with a well-placed use of AnyRyan Scott2018-04-195-1/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, derived `Generic1` instances could have associated `Rep1` type family instances with unbound variables, such as in the following example: ```lang=haskell data T a = MkT (FakeOut a) deriving Generic1 type FakeOut a = Int ==> instance Generic1 T where type Rep1 T = ... (Rec0 (FakeOut a)) ``` Yikes! To avoid this, we simply map the last type variable in a derived `Generic1` instance to `Any`. Test Plan: make test TEST=T15012 Reviewers: bgamari Reviewed By: bgamari Subscribers: simonpj, thomie, carter GHC Trac Issues: #15012 Differential Revision: https://phabricator.haskell.org/D4602
* Better error message for empty character literal, for Trac #13450.HE, Tao2018-04-196-10/+70
| | | | | | | | | | | | | | | | | For empty character literal, the `''`, report error message properly rather than just throw a "parser error" with wrong error location. Test Plan: make test TEST="T13450 T13450TH" Reviewers: goldfire, bgamari Reviewed By: bgamari Subscribers: thomie, mpickering, carter GHC Trac Issues: #13450 Differential Revision: https://phabricator.haskell.org/D4594
* Add a test for #14815:Ömer Sinan Ağacan2018-04-194-2/+57
| | | | | | | | | | | | | | | | | | Because the program doesn't have any binders that -XStrict can make strict, the desugarer output should be identical when it's compiled with and without -XStrict. This wasn't the case with GHC 8.2.2, but apparently it was fixed some time between 8.2.2 and 8.4.1. We now add a test case to make sure it stays fixed. Reviewers: bgamari Reviewed By: bgamari Subscribers: simonpj, rwbarton, thomie, carter GHC Trac Issues: #14815 Differential Revision: https://phabricator.haskell.org/D4531
* rts: fix format arguments for debugBelch calls on 32-bit systemsSergei Trofimovich2018-04-193-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes build failure like this: ``` rts/Stats.c:1467:14: error: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] debugBelch("%51s%9" FMT_Word " %9" FMT_Word "\n", ^~~~~~~~ "",tot_live*sizeof(W_),tot_slop*sizeof(W_)); ~~~~~~~~~~~~~~~~~~~ ``` The fix is to cast sizeof() result to Word (W_). Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: build for 32-bit target Reviewers: bgamari, erikd, simonmar Reviewed By: simonmar Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D4608
* users-guide: Override mathjax_pathBen Gamari2018-04-191-0/+3
| | | | | | | | | | | | | | | | | | The Mathjax CDN no longer exists. Use CDNJS instead. See #15006. Test Plan: Build HTML users guide, see whether math is rendered. Reviewers: alpmestan Reviewed By: alpmestan Subscribers: thomie, carter GHC Trac Issues: #15006 Differential Revision: https://phabricator.haskell.org/D4603
* Add a test case from the nested CPR workBen Gamari2018-04-193-0/+28
| | | | | | | | | | Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D4565
* Bump unix submodule to version 2.8.0.0Ryan Scott2018-04-1911-9/+9
| | | | | | | | | | | | | | Summary: Requires bumping several submodules. Test Plan: ./validate Reviewers: hvr, bgamari Subscribers: thomie, carter GHC Trac Issues: #15042 Differential Revision: https://phabricator.haskell.org/D4604
* Fix #14710 with more validity checks during renamingRyan Scott2018-04-198-36/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: #14710 revealed two unfortunate regressions related to kind polymorphism that had crept in in recent GHC releases: 1. While GHC was able to catch illegal uses of kind polymorphism (i.e., if `PolyKinds` wasn't enabled) in limited situations, it wasn't able to catch kind polymorphism of the following form: ```lang=haskell f :: forall a. a -> a f x = const x g where g :: Proxy (x :: a) g = Proxy ``` Note that the variable `a` is being used as a kind variable in the type signature of `g`, but GHC happily accepts it, even without the use of `PolyKinds`. 2. If you have `PolyKinds` (but not `TypeInType`) enabled, then GHC incorrectly accepts the following definition: ```lang=haskell f :: forall k (a :: k). Proxy a f = Proxy ``` Even though `k` is explicitly bound and then later used as a kind variable within the same telescope. This patch fixes these two bugs as follows: 1. Whenever we rename any `HsTyVar`, we check if the following three criteria are met: (a) It's a type variable (b) It's used at the kind level (c) `PolyKinds` is not enabled If so, then we have found an illegal use of kind polymorphism, so throw an error. This check replaces the `checkBadKindBndrs` function, which could only catch illegal uses of kind polymorphism in very limited situations (when the bad kind variable happened to be implicitly quantified in the same type signature). 2. In `extract_hs_tv_bndrs`, we must error if `TypeInType` is not enabled and either of the following criteria are met: (a) An explicitly bound type variable is used in kind position in the body of a `forall` type. (b) An explicitly bound type variable is used in kind position in the kind of a bound type variable in a `forall` type. `extract_hs_tv_bndrs` was checking (a), but not (b). Easily fixed. Test Plan: ./validate Reviewers: goldfire, simonpj, bgamari, hvr Reviewed By: simonpj Subscribers: thomie, carter GHC Trac Issues: #14710 Differential Revision: https://phabricator.haskell.org/D4554
* Introduce a $tooldir variable for nicer toolchain detection on WindowsAlp Mestanogullari2018-04-173-24/+80
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch affects several files that affect how we detect mingw and perl on Windows. The initial motivation is: https://github.com/snowleopard/hadrian/issues/564 where, with Hadrian building relocatable (non-inplace) GHCs, the current detection mechanism falls short by e.g only trying $topdir/../mingw. But in Hadrian, for reasons given in that issue, we would need to store e.g mingw under $topdir/../../mingw except for binary distributions, where we want to follow the existing structure, in which case $topdir/../mingw is correct. So we need to support both, which is what this patch hopefully implements. Test Plan: ./validate Reviewers: Phyx, hvr, bgamari, erikd Reviewed By: Phyx Subscribers: snowleopard, thomie, carter Differential Revision: https://phabricator.haskell.org/D4598
* Proper safe coercions paper linkKirill Zaborsky2018-04-171-1/+1
|
* Fix markup in the UNPACK pragma section of the user's guide.theindigamer2018-04-171-5/+2
| | | | The ticket 5252 wasn't linked earlier.
* Comments onlySimon Peyton Jones2018-04-171-3/+1
| | | | Deleting misleading comments, to fix Trac #15047
* Minor comments in CSESimon Peyton Jones2018-04-171-8/+8
|
* Remove markSignalHandlersÖmer Sinan Ağacan2018-04-164-35/+0
| | | | | | | | | | | | It's no-op on all platforms Reviewers: bgamari, simonmar, erikd, dfeuer Reviewed By: dfeuer Subscribers: dfeuer, thomie, carter Differential Revision: https://phabricator.haskell.org/D4588
* rts: Comment wibblesBen Gamari2018-04-162-1/+3
|
* Revert "Enhanced constant folding"Ben Gamari2018-04-163-309/+37
| | | | | | | I need to upgrade GHC on the CI builders before landing this due to a bug in 8.2.1 triggered by this patch. This reverts commit fea04defa64871caab6339ff3fc5511a272f37c7.
* users guide: Note improved constant folding in 8.6 release notesBen Gamari2018-04-131-0/+4
|
* Enhanced constant foldingSylvain Henry2018-04-133-37/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now GHC only supported basic constant folding (lit op lit, expr op 0, etc.). This patch uses laws of +/-/* (associativity, commutativity, distributivity) to support some constant folding into nested expressions. Examples of new transformations: - simple nesting: (10 + x) + 10 becomes 20 + x - deep nesting: 5 + x + (y + (z + (t + 5))) becomes 10 + (x + (y + (z + t))) - distribution: (5 + x) * 6 becomes 30 + 6*x - simple factorization: 5 + x + (x + (x + (x + 5))) becomes 10 + (4 *x) - siblings: (5 + 4*x) - (3*x + 2) becomes 3 + x Test Plan: validate Reviewers: simonpj, austin, bgamari Reviewed By: bgamari Subscribers: thomie GHC Trac Issues: #9136 Differential Revision: https://phabricator.haskell.org/D2858
* Configure option to disable dtraceBen Gamari2018-04-131-5/+15
| | | | | | | | Reviewers: hvr, bgamari Subscribers: lelf, thomie, carter Differential Revision: https://phabricator.haskell.org/D4575
* Omit ways depending on rts flags for #12870 related tests.Andreas Klebinger2018-04-131-8/+10
| | | | | | | | | | | | | | | | | | Some of these tests instruct the RTS to ignore all RTS flags being passed. While this is intended it causes test failures for some ways like profiling which depend on passing RTS flags. So we skip these ways. Test Plan: testsuite/tests/rts/flags$ make slow Reviewers: bgamari, simonmar, alpmestan Reviewed By: alpmestan Subscribers: alpmestan, thomie, carter GHC Trac Issues: #12870 Differential Revision: https://phabricator.haskell.org/D4585
* Make shortcutting at the asm stage toggleable and default for O2.Andreas Klebinger2018-04-133-2/+25
| | | | | | | | | | | | | | | | | | | Shortcutting during the asm stage of codegen is often redundant as most cases get caught during the Cmm passes. For example during compilation of all of nofib only 508 jumps are eleminated. For this reason I moved the pass from -O1 to -O2. I also made it toggleable with -fasm-shortcutting. Test Plan: ci Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D4555