summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Tighten cached role in NthCowip/tdammers/T11735Richard Eisenberg2018-02-1213-98/+131
|
* Performance improvements based on Trac #11735 and #14683.Tobias Dammers2018-02-061-19/+42
| | | | | | | | | | | | | | | | | Summary: This includes: - Refactoring coercionKind / coercionKindRole - Caching role in NthCo constructor and mkNthCo - Discard reflexive casts during Simplify - Additional SCC's to hunt down performance bottlenecks in Coercion, CoreTidy, and Simplify Reviewers: goldfire, bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4385
* Fix testsuite failuresRichard Eisenberg2018-01-278-41/+20
|
* This should really have been in the previous commit.Richard Eisenberg2018-01-272-3/+3
|
* Discard reflexive casts during SimplifyRichard Eisenberg2018-01-262-33/+50
| | | | | | Previously, we went to great lengths to build just the right reflexive casts, only to discard them shortly later. Now, just skip creating reflexive casts altogether.
* Update core-spec with new NthCoRichard Eisenberg2018-01-264-5/+8
|
* Make mkNthCo take a Role parameter.Richard Eisenberg2018-01-2613-170/+159
| | | | | | Most callers of mkNthCo know the role of the coercion they are trying to make. So instead of calculating this role, just pass it in.
* Caching coercion roles in NthCo (#11735)Tobias Dammers2018-01-2513-43/+64
|
* Simplification as per #11735Tobias Dammers2018-01-251-6/+4
| | | | (https://ghc.haskell.org/trac/ghc/ticket/11735#comment:19)
* Refactored coercionKindsRole (as per #11735)Tobias Dammers2018-01-241-49/+25
|
* Added SCCs to hunt down #14683Tobias Dammers2018-01-242-35/+53
|
* Applying patch suggested in #11735 to improve coercionKind perfTobias Dammers2018-01-241-16/+18
|
* Pass -dsuppress-uniques when running T14507Ryan Scott2018-01-222-2/+2
| | | | | Not doing so resulted in different uniques being printed on different environments, as shown in #14703.
* Improve comments about TcLevel invariantsSimon Peyton Jones2018-01-223-17/+31
|
* Bump transformers submodule to 0.5.5.0Ben Gamari2018-01-211-0/+0
|
* Update Cabal submoduleOleg Grenrus2018-01-216-39/+12
| | | | | | | | | | | | | | | | - Cabal-2.2 uses SPDX license identifiers, so I had to update `cabal-version: 2.1` packages `license: BSD3` to `license: BSD-3-Clause` - `ghc-cabal` used old ReadP parsec, now it uses `parsec` too - InstalledPackageInfo pretty-printing have changed a little, fields with default values aren't printed. This can be changed in `Cabal` still, but I haven't found problems with omitting them. Note: `BSD-3-Clause` is parsed as "name = BSD, version = 3" by old parser (because 3-Clause looks like version 3 with tag Clause). If you see *"BSD-3" is not a valid license*, then something is using old parser still. Fixes #9885.
* SysTools: Add detection support for LLD linkerBen Gamari2018-01-212-0/+5
| | | | | | I noticed while trying to test against LLVM 5.0 that GHC would throw "Couldn't figure out linker information" warnings due to LLD being chosen by configure. Adding detection support to silence these is simple enough, let's just do it.
* Use IntSet in DataflowBartosz Nitka2018-01-213-23/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, a list was used as a substitute for a heap. This led to quadratic behavior on a simple program (see new test case). This change replaces it with IntSet in effect reverting 5a1a2633553. @simonmar said it's fine to revert as long as nofib results are good. Test Plan: new test case: 20% improvement 3x improvement when N=10000 nofib: I run it twice for before and after because the compile time results are noisy. - Compile Allocations: ``` before before re-run after after re-run -1 s.d. ----- -0.0% -0.1% -0.1% +1 s.d. ----- +0.0% +0.1% +0.1% Average ----- +0.0% -0.0% -0.0% ``` - Compile Time: ``` before before re-run after after re-run -1 s.d. ----- -0.1% -2.3% -2.6% +1 s.d. ----- +5.2% +3.7% +4.4% Average ----- +2.5% +0.7% +0.8% ``` I checked each case and couldn't find consistent slow-down/speed-up on compile time. Full results here: P173 Reviewers: simonpj, simonmar, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter, simonmar GHC Trac Issues: #14667 Differential Revision: https://phabricator.haskell.org/D4329
* Implement underscores in numeric literals (NumericUnderscores extension)Takenobu Tani2018-01-2121-45/+469
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the proposal of underscores in numeric literals. Underscores in numeric literals are simply ignored. The specification of the feature is available here: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/000 9-numeric-underscores.rst For a discussion of the various choices: https://github.com/ghc-proposals/ghc-proposals/pull/76 Implementation detail: * Added dynamic flag * `NumericUnderscores` extension flag is added for this feature. * Alex "Regular expression macros" in Lexer.x * Add `@numspc` (numeric spacer) macro to represent multiple underscores. * Modify `@decimal`, `@decimal`, `@binary`, `@octal`, `@hexadecimal`, `@exponent`, and `@bin_exponent` macros to include `@numspc`. * Alex "Rules" in Lexer.x * To be simpler, we have only the definitions with underscores. And then we have a separate function (`tok_integral` and `tok_frac`) that validates the literals. * Validation functions in Lexer.x * `tok_integral` and `tok_frac` functions validate whether contain underscores or not. If `NumericUnderscores` extensions are not enabled, check that there are no underscores. * `tok_frac` function is created by merging `strtoken` and `init_strtoken`. * `init_strtoken` is deleted. Because it is no longer used. * Remove underscores from target literal string * `parseUnsignedInteger`, `readRational__`, and `readHexRational} use the customized `span'` function to remove underscores. * Added Testcase * testcase for NumericUnderscores enabled. NumericUnderscores0.hs and NumericUnderscores1.hs * testcase for NumericUnderscores disabled. NoNumericUnderscores0.hs and NoNumericUnderscores1.hs * testcase to invalid pattern for NumericUnderscores enabled. NumericUnderscoresFail0.hs and NumericUnderscoresFail1.hs Test Plan: `validate` including the above testcase Reviewers: goldfire, bgamari Reviewed By: bgamari Subscribers: carter, rwbarton, thomie GHC Trac Issues: #14473 Differential Revision: https://phabricator.haskell.org/D4235
* [rts] Adjust whitehole_spinDouglas Wilson2018-01-215-12/+10
| | | | | | | | | | | | | | | | | | | Rename to whitehole_gc_spin, in preparation for adding stats for the whitehole busy-loop in SMPClosureOps. Make whitehole_gc_spin volatile, and move it to be defined and statically initialised in GC.c. This saves some #ifs, and I'm pretty sure it should be volatile. Test Plan: ./validate Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4300
* tentative improvement to callstack docsAlp Mestanogullari2018-01-212-24/+66
| | | | | | | | | | | | | | | | | | This is an attempt at clarifying the docs for HasCallStack in both the user guide and libraries/base/GHC/Stack/Types.hs. The example used right now is built around an hypothetical 'error' function that doesn't itself print call stacks, and the fact that this doesn't hold makes it all confusing, see #14635. Reviewers: hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14635 Differential Revision: https://phabricator.haskell.org/D4317
* Fix #14692 by correcting an off-by-one error in TcGenDerivRyan Scott2018-01-212-2/+2
| | | | | | | | | | | | | | | | | | A silly mistake in `gen_Show_binds` was causing derived `Show` instances for empty data types to case on the precedence argument instead of the actual value being showed. Test Plan: make test TEST=drv-empty-data Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14692 Differential Revision: https://phabricator.haskell.org/D4328
* testsuite: Add testcase for #14670Ben Gamari2018-01-212-0/+12
| | | | | | | | Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14670 Differential Revision: https://phabricator.haskell.org/D4314
* Add new mbmi and mbmi2 compiler flagsJohn Ky2018-01-2123-21/+623
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the bit deposit and extraction operations provided by the BMI and BMI2 instruction set extensions on modern amd64 machines. Implement x86 code generator for pdep and pext. Properly initialise bmiVersion field. pdep and pext test cases Fix pattern match for pdep and pext instructions Fix build of pdep and pext code for 32-bit architectures Test Plan: Validate Reviewers: austin, simonmar, bgamari, angerman Reviewed By: bgamari Subscribers: trommler, carter, angerman, thomie, rwbarton, newhoggy GHC Trac Issues: #14206 Differential Revision: https://phabricator.haskell.org/D4236
* testsuite: Add test for #14335Ben Gamari2018-01-182-0/+11
| | | | | | | | Subscribers: rwbarton, thomie GHC Trac Issues: #14335 Differential Revision: https://phabricator.haskell.org/D4202
* Fix #14681 and #14682 with precision-aimed parenthesesRyan Scott2018-01-1812-10/+334
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that `Convert` was recklessly leaving off parentheses in two places: * Negative numeric literals * Patterns in lambda position This patch fixes it by adding three new functions, `isCompoundHsLit`, `isCompoundHsOverLit`, and `isCompoundPat`, and using them in the right places in `Convert`. While I was in town, I also sprinkled `isCompoundPat` among some `Pat`-constructing functions in `HsUtils` to help avoid the likelihood of this problem happening in other places. One of these places is in `TcGenDeriv`, and sprinkling `isCompountPat` there fixes #14682 Test Plan: make test TEST="T14681 T14682" Reviewers: alanz, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14681, #14682 Differential Revision: https://phabricator.haskell.org/D4323
* Remove unused extern cost centre collectionÖmer Sinan Ağacan2018-01-185-18/+14
| | | | | | | | | | Reviewers: bgamari, simonmar Reviewed By: simonmar Subscribers: alexbiehl, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4309
* cmm: Include braces on default branch as required by the parserklebinger.andreas@gmx.at2018-01-181-2/+2
| | | | | | | | | | | | Test Plan: Looking at cmm-dump Reviewers: bgamari, simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4293
* Revert "Improve accuracy of get/setAllocationCounter"Ben Gamari2018-01-1811-74/+34
| | | | This reverts commit a1a689dda48113f3735834350fb562bb1927a633.
* Revert "Fix regression on i386 due to get/setAllocationCounter change"Ben Gamari2018-01-181-2/+2
| | | | This reverts commit a770226e03f09b767fdb4ce826162a5c0f29ec29.
* Inform hole substitutions of typeclass constraints (fixes #14273).Matthías Páll Gissurarson2018-01-1825-155/+1499
| | | | | | | | | | | | | | | | | | | This implements SPJ's suggestion on the ticket (#14273). We find the relevant constraints (ones that whose free unification variables are all mentioned in the type of the hole), and then clone the free unification variables of the hole and the relevant constraints. We then add a subsumption constraints and run the simplifier, and then check whether all the constraints were solved. Reviewers: bgamari Reviewed By: bgamari Subscribers: RyanGlScott, rwbarton, thomie, carter GHC Trac Issues: #14273 Differential Revision: https://phabricator.haskell.org/D4315
* Fix references to cminusminus.orgBen Gamari2018-01-183-6/+6
| | | | | | | | | | | | Reviewers: simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14665 Differential Revision: https://phabricator.haskell.org/D4311
* Typos in commentsGabor Greif2018-01-1712-14/+14
|
* Fix quadratic behavior of prepareAltsBartosz Nitka2018-01-151-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This code is quadratic and a simple test case I used managed to tickle it. The example (same one as #14667) looks like this: ``` module A10000 where data A = A | A00001 | A00002 ... | A10000 f :: A -> Int f A00001 = 19900001 f A00002 = 19900002 ... f A10000 = 19910000 ``` Applied on top of a fix for #14667, it gives a 30% compile time improvement. Test Plan: ./validate Reviewers: simonpj, bgamari Subscribers: rwbarton, thomie, simonmar, carter Differential Revision: https://phabricator.haskell.org/D4307
* configure: Various cleanupsJohn Ericson2018-01-152-38/+38
| | | | | | | | | | | | | | | | | Substitute RanlibCmd for consistency, and other configure cleanups that should have no effect The other commands are so substituted. Maybe we don't need ranlib at all, and the configure snippet can be removed all together, but that can always be done later. Reviewers: bgamari, hvr, angerman Reviewed By: bgamari, angerman Subscribers: rwbarton, thomie, erikd, carter Differential Revision: https://phabricator.haskell.org/D4286
* Simplify guard in createSwitchPlan.klebinger.andreas@gmx.at2018-01-151-5/+4
| | | | | | | | | | | | | | | | | | Given that we have two unique keys (guaranteed by Map) checking that `|range| == 1` is faster. The fact that `x1 == lo` and `x2 == hi` is guaranteed by mkSwitchTargets which removes values outside of the range. Test Plan: ci Reviewers: bgamari, simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4295
* Remove executable filename check on windowsklebinger.andreas@gmx.at2018-01-151-13/+4
| | | | | | | | | | | | | | | | | | | | On Windows GHC enforces currently that the real executable is named ghc.exe/ghc-stage[123].exe. I don't see a good reason why this is neccessary. This patch removes this restriction and fixes #14652 Test Plan: ci Reviewers: bgamari, Phyx Reviewed By: Phyx Subscribers: Phyx, rwbarton, thomie, carter GHC Trac Issues: #14652 Differential Revision: https://phabricator.haskell.org/D4296
* Parenthesize forall-type args in cvtTypeKindRyan Scott2018-01-154-4/+18
| | | | | | | | | | | | | | | | | Trac #14646 happened because we forgot to parenthesize `forall` types to the left of an arrow. This simple patch fixes that. Test Plan: make test TEST=T14646 Reviewers: alanz, goldfire, bgamari Reviewed By: alanz Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14646 Differential Revision: https://phabricator.haskell.org/D4298
* Add flag -fno-itMatthew Pickering2018-01-153-11/+73
| | | | | | | | | | | | | | | | This flag stops ghci creating the special variable `it` after evaluating an expression. This stops ghci leaking as much memory when evaluating expressions. See #14336 Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14336 Differential Revision: https://phabricator.haskell.org/D4299
* Fix hash in haddock of ghc-prim.HE, Tao2018-01-151-1/+1
| | | | | | | | | | | | Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14653 Differential Revision: https://phabricator.haskell.org/D4305
* CoreLint: typo in a commentÖmer Sinan Ağacan2018-01-151-2/+2
| | | | | | | | | | Reviewers: bgamari, goldfire Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4308
* Fix hashbang of gen-data-layoutBen Gamari2018-01-151-1/+1
| | | | | | Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4313
* Support LIBRARY_PATH and LD_LIBRARY_PATH in rtsBen Gamari2018-01-159-13/+82
| | | | | | | | | | | | | | | | | | | | | | | | | `LIBRARY_PATH` is used to find libraries and other link artifacts while `LD_LIBRARY_PATH` is used to find shared libraries by the loader. Due to an implementation detail on Windows, using `LIBRARY_PATH` will automatically add the path of any library found to the loader's path. So in that case `LD_LIBRARY_PATH` won't be needed. Test Plan: ./validate along with T14611 which has been made Windows only due to linux using the system linker/loader by default. So I feel a testcase there is unwarranted as the support is indirect via glibc. Reviewers: hvr, bgamari, erikd, simonmar, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, thomie, carter GHC Trac Issues: #14611 Differential Revision: https://phabricator.haskell.org/D4275
* Tweak link order slightly to prefer user shared libs before system ones.Tamar Christina2018-01-152-12/+40
| | | | | | | | | | | | | | | | | | | | | | | | | We currently always prefer shared libraries before import libraries and static libraries. This is because they're faster to load. The problem is when shared library are installed in the Windows directory. These would supersede any user specified ones. This is bad because e.g. Windows now ships icuuc, but an old version. If you try to use -licuuc then it would pick the Windows one instead of your user specified one. This patch slighly tweaks the ordering so user paths get prefered. Test Plan: ./validate Reviewers: RyanGlScott, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14456 Differential Revision: https://phabricator.haskell.org/D4274
* Kill off irrefutable pattern errorsDavid Feuer2018-01-157-15/+10
| | | | | | | | | | | | | | | | | Distinguishing between "refutable" and "irrefutable" patterns (as described by the Haskell Report) in incomplete pattern errors was more confusing than helpful. Remove references to irrefutable patterns. Reviewers: hvr, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie, carter GHC Trac Issues: #14569 Differential Revision: https://phabricator.haskell.org/D4261
* Rename -frule-check to -drule-check and documentMatthew Pickering2018-01-154-3/+16
| | | | | | | | | | Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4256
* Fix regression on i386 due to get/setAllocationCounter changeBen Gamari2018-01-151-2/+2
| | | | | | | | Reviewers: simonmar, erikd Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4312
* Support constructor Haddocks in more placesAlec Theriault2018-01-1226-42/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for adding Haddocks on individual non-record fields of regular (and GADT) constructors. The following now parses just fine with `-haddock` enabled: data Foo = Baz -- ^ doc on the `Baz` constructor Int -- ^ doc on the `Int` field of `Baz` String -- ^ doc on the `String` field of `Baz` | Int -- ^ doc on the `Int` field of the `:*` constructor :* -- ^ doc on the `:*` constructor String -- ^ doc on the `String` field of the `:*` constructor | Boa -- ^ doc on the `Boa` record constructor { y :: () } The change is backwards compatible: if there is only one doc and it occurs on the last field, it is lifted to apply to the whole constructor (as before). Reviewers: bgamari, alanz Subscribers: rwbarton, thomie, mpickering, carter Differential Revision: https://phabricator.haskell.org/D4292
* Fix mistaken mergeBen Gamari2018-01-121-22/+15
| | | | | | | When merging D4259 I had to resort to manual merge due to some conflicts that arc couldn't sort out. Unfortunately in the process I merged the wrong version of the patch. Fix this. Thanks to @ntc2 for the great documentation and noticing my mistake.
* KQueue: Fix write notification requests being ignored...Matthias Treydte2018-01-121-25/+21
| | | | | | | | | | | | | | | | | | | | | when read notifications are requested, too (#13903) Signed-off-by: Matthias Treydte <mt@waldheinz.de> KQueue: Drop Bits/FiniteBits instances for Filter as they are really constants whose bits should not be fiddled with Signed-off-by: Matthias Treydte <mt@waldheinz.de> Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: gridaphobe, kazu_yamamoto, rwbarton, thomie GHC Trac Issues: #13903 Differential Revision: https://phabricator.haskell.org/D3692