summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
* Test #13585 in typecheck/should_compile/T13585Richard Eisenberg2017-05-025-0/+100
|
* Fix #13233 by checking for lev-poly primopsRichard Eisenberg2017-05-021-3/+3
| | | | | The implementation plan is all in Note [Detecting forced eta expansion] in DsExpr.
* Fix #13333 by fixing the covar's type in ctEvCoercionRichard Eisenberg2017-05-022-0/+29
| | | | | | | The change is noted in Note [Given in ctEvCoercion]. This patch also adds a bit more commentary to TcFlatten, documenting some key invariants of the flattening algorithm. While in the area, I also removed some stale commentary from TcCanonical.
* Shave the hair off mkCastTy.Richard Eisenberg2017-05-021-2/+2
| | | | | | | Previously, mkCastTy went to great lengths to shove casts around. But this doesn't seem to be necessary. However, the reflexivity check currently in mkCastTy is not enough. See the abortive Note [No reflexive casts in types]
* Fix #13233 by checking for lev-poly primopsRichard Eisenberg2017-05-025-13/+52
| | | | | | | | | | | | | | | The implementation plan is all in Note [Detecting forced eta expansion] in DsExpr. Test Plan: ./validate, codeGen/should_fail/T13233 Reviewers: simonpj, austin, bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13233 Differential Revision: https://phabricator.haskell.org/D3490
* Fix loss-of-SpecConstr bugSimon Peyton Jones2017-05-023-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | This bug, reported in Trac #13623 has been present since commit b8b3e30a6eedf9f213b8a718573c4827cfa230ba Author: Edward Z. Yang <ezyang@cs.stanford.edu> Date: Fri Jun 24 11:03:47 2016 -0700 Axe RecFlag on TyCons. SpecConstr tries not to specialise indefinitely, and had a limit (see Note [Limit recursive specialisation]) that made use of info about whether or not a data constructor was "recursive". This info vanished in the above commit, making the limit fire much more often -- and indeed it fired in this test case, in a situation where specialisation is /highly/ desirable. I refactored the test, to look instead at the number of iterations of the loop of "and now specialise calls that arise from the specialisation". Actually less code, and more robust. I also added record field names to a couple of constructors, and renamed RuleInfo to SpecInfo.
* Join-point refactoringSimon Peyton Jones2017-05-023-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit has a raft of refactorings that improve the treatment of join points. I wasn't aiming so much as to gain performance as to make the code simpler. The two big things are these: * Make mkDupableCont work for SimplBind as well. This is simpler than I thought and quite neat. (Luke had aready done StrictArg.) That's a win in its own right. But also now /all/ continuations can be made dup-able * Now that all continuations can be made dup-able, I could simplify mkDupableCont to return just one SimplCont, instead of two. That really is a worthwhile simlification! Much easier to think about. Plus a bunch of smaller things: * Remove the join-arity that had been added to seIdSubst. It can be done more simply by putting it in DoneEx, which is the only constructor that actually needs it, and now we don't need the unsavoury isJoinIdInEnv_maybe. * Re-order the handling of join points in Simplify, so that we don't need the horrible resultTypeOfDupableCont * Add field names for StrictBind, StrictArg; and use them * Define simplMonad.newJoinId, and use it * Rename the seFloats field of SimplEnv to seLetFloats Binary sizes seem to go up slightly, but allocations generally improve, sometimes significantly. I don't believe the runtime numbers are reliable enough to draw any conclusions about -------------------------------------------------------------------------------- Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- event +1.1% -12.0% -0.2% -0.2% -8.7% fulsom +1.9% -11.8% -10.0% -10.0% +5.3% last-piece +2.3% -1.2% -1.2% -1.2% +0.0% mate +0.9% -1.4% -0.6% -0.7% +0.0% multiplier +1.5% -8.3% 0.17 0.17 +0.0% parser +2.0% +1.0% 0.04 0.04 +0.0% parstof +1.5% +0.7% 0.01 0.01 +0.0% sched +1.3% -6.1% 0.03 0.03 +0.0% simple +1.8% +1.0% +9.7% +9.6% +0.0% -------------------------------------------------------------------------------- Min +0.5% -12.0% -10.0% -10.0% -8.7% Max +3.0% +1.0% +14.2% +14.2% +50.0% Geometric Mean +1.4% -0.4% +0.3% +0.4% +0.5% There's also a tests/perf/compiler improvement of 20% allocation in T6048. I think it's because we now generate smaller code.
* testsuite: Bump allocations of T3064Ben Gamari2017-05-011-1/+2
| | | | | | | | | | This seems to have regressed due to, commit 5c602d2228d28530621cc6c94fbb736b13f474fb Author: Reid Barton <rwbarton@gmail.com> Date: Mon May 1 11:17:47 2017 -0400 Avoid excessive space usage from unfoldings in CoreTidy
* Avoid excessive space usage from unfoldings in CoreTidyReid Barton2017-05-011-4/+8
| | | | | | | | | | | | | | Test Plan: validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie GHC Trac Issues: #13564 Differential Revision: https://phabricator.haskell.org/D3516
* Fix capitalization in message for #13609Ben Gamari2017-05-011-1/+1
| | | | I had meant to do this before merging but forgot.
* testsuite: Add test for #13609Ben Gamari2017-05-013-0/+9
|
* testsuite: Widen acceptance window of T13379Ben Gamari2017-04-301-1/+2
|
* Re-engineer caseRules to add tagToEnum/dataToTagSimon Peyton Jones2017-04-283-96/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See Note [Scrutinee Constant Folding] in SimplUtils * Add cases for tagToEnum and dataToTag. This is the main new bit. It allows the simplifier to remove the pervasive uses of case tagToEnum (a > b) of False -> e1 True -> e2 and replace it by the simpler case a > b of DEFAULT -> e1 1# -> e2 See Note [caseRules for tagToEnum] and Note [caseRules for dataToTag] in PrelRules. * This required some changes to the API of caseRules, and hence to code in SimplUtils. See Note [Scrutinee Constant Folding] in SimplUtils. * Avoid duplication of work in the (unusual) case of case BIG + 3# of b DEFAULT -> e1 6# -> e2 Previously we got case BIG of DEFAULT -> let b = BIG + 3# in e1 3# -> let b = 6# in e2 Now we get case BIG of b# DEFAULT -> let b = b' + 3# in e1 3# -> let b = 6# in e2 * Avoid duplicated code in caseRules A knock-on refactoring: * Move Note [Word/Int underflow/overflow] to Literal, as documentation to accompany mkMachIntWrap etc; and get rid of PrelRuls.intResult' in favour of mkMachIntWrap
* Make the tyvars in TH-reified data family instances uniformRyan Scott2017-04-283-0/+27
| | | | | | | | | | | | | | | | | | | | | It turns out we were using two different sets of type variables when reifying data family instances in Template Haskell. We were using the tyvars quantifying over the instance itself for the LHS, but using the tyvars quantifying over the data family instance constructor for the RHS. This commit uses the instance tyvars for both the LHS and the RHS, fixing #13618. Test Plan: make test TEST=T13618 Reviewers: goldfire, austin, bgamari Reviewed By: goldfire, bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13618 Differential Revision: https://phabricator.haskell.org/D3505
* Add regression test for #12104Ryan Scott2017-04-283-0/+17
| | | | | | | | | | | | | | | | | | Commit 2f9f1f86849ebc18af409c9b3fd809c9cd464021 (#13487) fixes #12104 as well. This adds a regression test for the program reported in #12104 to keep it fixed. Test Plan: make test TEST=T12104 Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #12104 Differential Revision: https://phabricator.haskell.org/D3495
* Be a bit more eager to inline in a strict contextSimon Peyton Jones2017-04-281-1/+1
| | | | | | | | | | | | | | | | | | | If we see f (g x), and f is strict, we want to be a bit more eager to inline g, because it may well expose an eval (on x perhaps) that can be eliminated or shared. I saw this in nofib boyer2, function RewriteFuns.onewayunify1. It showed up as a consequence of the preceding patch that makes the simplifier do less work (Trac #13379). We had f d (g x) where f was a class-op. Previously we simplified both d and (g x) with a RuleArgCtxt (making g a bit more eager to inline). But now we simplify only d that way, then fire the rule, and only then simplify (g x). Firing the rule produces a strict funciion, so we want to make a strict function encourage inlining a bit.
* Cure exponential behaviour in the simplifierSimon Peyton Jones2017-04-284-13/+397
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch nails a Bad Bug exposed in Trac #13379. Roughly, a deeply-nested application like f (f (f ....) ) ) could make the simplifier go exponential -- without producing an exponential-sized result! The reason was that we - simplified a (big) function argument - then decided to inline the function - then preInilneUnconditionally the argument - and then re-simplified the big argument And if the "big argument" itself had a similar structure things could get very bad. Once I'd understood, it was easy to fix: * See Note Note [Avoiding exponential behaviour] for an overview * The key change is that Simplify.simplLam now as a case for (isSimplified dup). This is what removes the perf bug. * But I also made simplCast more parsimonious about simplifying, avoiding doing so when the coercion is Refl * And similarly I now try to avoid simplifying arguments where possible before applying rules. See Note [Trying rewrite rules] The latter two points tackle common cases, and in those cases make the simplifier take fewer iterations.
* Comments onlySimon Peyton Jones2017-04-281-1/+1
|
* Update Cabal submodule, with necessary wibbles.Edward Z. Yang2017-04-261-2/+2
| | | | | | | | | | | | Test Plan: validate Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3501
* Only pretty-print binders in closed type families with -fprint-explicit-forallsRyan Scott2017-04-257-7/+23
| | | | | | | | | | | | | | | | | | | Previously, we were unconditionally pretty-printing all type variable binders when pretty-printing closed type families (e.g., in the output of `:info` in GHCi). This threw me for a loop, so let's guard this behind the `-fprint-explicit-foralls` flag. Test Plan: make test TEST=T13420 Reviewers: goldfire, austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13420 Differential Revision: https://phabricator.haskell.org/D3497
* Don't setProgramDynFlags on every :loadSimon Marlow2017-04-252-0/+19
| | | | | | | | | | | | | | | | | | | | Summary: setProgramDynFlags invalidates the whole module graph, forcing everything to be re-summarised (including preprocessing) on every :reload. Looks like this was a bad regression in 8.0, but we didn't notice because there was no test for it. Now there is! Test Plan: * validate * new unit test Reviewers: bgamari, triple, austin, niteria, erikd, jme Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3398
* Add failing test case for T13611Joachim Breitner2017-04-242-0/+10
| | | | this program should be rejected, but is not (and segfaults).
* testsuite/driver: Fix deletion retry logic on WindowsBen Gamari2017-04-241-7/+15
| | | | | | | | | | | | | | | Previously rmtree's error callback would throw an exception, breaking out of the retry loop. Test Plan: Validate on Windows Reviewers: Phyx, austin Reviewed By: Phyx Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3492
* Add regression test for #13603Ryan Scott2017-04-242-1/+11
| | | | | | | | | | | | | | | | | | Summary: Commit b207b536ded40156f9adb168565ca78e1eef2c74 (#11714) happened to fix #13603 as well. Let's add a regression test so that it stays fixed. Test Plan: make test TEST=T13603 Reviewers: bgamari, austin, simonpj Reviewed By: bgamari, simonpj Subscribers: simonpj, rwbarton, thomie GHC Trac Issues: #13603 Differential Revision: https://phabricator.haskell.org/D3489
* testsuite: Mark T13075 as broken due to #13075Ben Gamari2017-04-231-1/+1
|
* testsuite: Add testcase for #13075Ben Gamari2017-04-232-0/+8
|
* testsuite: Increase T13056 window size to +/-10%Ben Gamari2017-04-231-2/+3
|
* testsuite: Add testcase for #13587Ben Gamari2017-04-233-0/+27
| | | | | | | | | | | | Test Plan: Validate Reviewers: austin Subscribers: rwbarton, thomie GHC Trac Issues: #13587 Differential Revision: https://phabricator.haskell.org/D3474
* testsuite: Add test for #13591Ben Gamari2017-04-235-0/+12
| | | | | | | | | | Reviewers: austin Subscribers: rwbarton, thomie GHC Trac Issues: #13591 Differential Revision: https://phabricator.haskell.org/D3470
* Document the kind generalization behavior observed in #13555Ryan Scott2017-04-233-0/+67
| | | | | | | | | | | | | | | | | | | | The conclusion of #13555 was that a program which began to fail to typecheck (starting in GHC 8.2) was never correct to begin with. Let's document why this is the case with respect to `MonoLocalBinds`' interaction with kind generalization. Also adds the reported program as a `compile_fail` testcase. Test Plan: make test TEST=T13555 # Also, read the docs Reviewers: goldfire, simonpj, austin, bgamari Reviewed By: goldfire, simonpj, bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13555 Differential Revision: https://phabricator.haskell.org/D3472
* testsuite: Update performance metricsBen Gamari2017-04-211-2/+5
|
* testsuite: Bump timeout multiplier for T11195Ben Gamari2017-04-211-1/+1
| | | | | | | This test has been occassionally failing on the Darwin build bot for some time now. (cherry picked from commit b3a4dd1152884ff1240824137eca0a49cb6e5a2c)
* testsuite: disable 'optllvm' for unregisterised compilerSergei Trofimovich2017-04-201-1/+1
| | | | | | | | | | | | | | commit 74615f412ad3de2910a156ff494bfe5497fada7e ("UNREG: ignore -fllvm (Trac #13495)") enabled 'optllvm' tests to be ran in 'make fulltest' mode. As a result many (~1000) tests fail due to stderr misamatch: +when making flags consistent: warning: + Compiler unregisterised, so compiling via C The change removes 'optllvm' tests for unregisterised compiler. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Simplify StgCases when all alts refer to the case binderJoachim Breitner2017-04-181-1/+1
| | | | | | as proposed in #13588. Differential Revision: https://phabricator.haskell.org/D3467
* Add failing test case for #13588Joachim Breitner2017-04-184-0/+230
|
* Remove redundant flag (-O) registration (fixes #13392)Santiago Munin2017-04-173-0/+9
| | | | | | | | | | | | Reviewers: austin, bgamari, dfeuer Reviewed By: bgamari, dfeuer Subscribers: rwbarton, thomie GHC Trac Issues: #13392 Differential Revision: https://phabricator.haskell.org/D3461
* hs_add_root() RTS API removalSergei Trofimovich2017-04-172-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Before ghc-7.2 hs_add_root() had to be used to initialize haskell modules when haskell was called from FFI. commit a52ff7619e8b7d74a9d933d922eeea49f580bca8 ("Change the way module initialisation is done (#3252, #4417)") removed needs for hs_add_root() and made function a no-op. For backward compatibility '__stginit_<module>' symbol was not removed. This change removes no-op hs_add_root() function and unused '__stginit_<module>' symbol from each haskell module. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: ./validate Reviewers: simonmar, austin, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3460
* Yet more work on TcSimplify.simplifyInferSimon Peyton Jones2017-04-135-2/+56
| | | | | | | | | | | | | | | | | The proximate cause for this patch is Trac #13482, which pointed out further subtle interactions between - Inferring the most general type of a function - A partial type signature for that function That led me into /further/ changes to the shiny new stuff in TcSimplify.simplifyInfer, decideQuantification, decideMonoTyVars, and related functions. Happily, I was able to make some of it quite a bit simpler, notably the bit about promoting free tyvars. I'm happy with the result. Moreover I fixed Trac #13524 at the same time. Happy days.
* Allow qualified names to be children in export listsMatthew Pickering2017-04-122-0/+15
| | | | | | | | | | | | | | | | When doing this I noticed a horrible amount of duplication between lookupSubBndrOcc and lookupExportChild (which I am responsible for). I opened #13545 to keep track of this. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13528 Differential Revision: https://phabricator.haskell.org/D3434
* base: Implement bit casts between word and float typesErik de Castro Lopo2017-04-123-0/+234
| | | | | | | | | | | | | Test Plan: Test on x86 and x86_64 Reviewers: duncan, trofi, simonmar, tibbe, hvr, austin, rwbarton, bgamari Reviewed By: duncan Subscribers: Phyx, DemiMarie, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3358
* Use -G1 for reliable peak mem usageSimon Peyton Jones2017-04-121-0/+1
|
* Improve demand analysis for join pointsSimon Peyton Jones2017-04-123-0/+19
| | | | | | | | | I realised (Trac #13543) that we can improve demand analysis for join point quite straightforwardly. The idea is explained in Note [Demand analysis for join points] in DmdAnal
* Typos in comments [ci skip]Gabor Greif2017-04-116-6/+6
|
* Add a second regression test for #13536Joachim Breitner2017-04-103-0/+38
| | | | which counts allocations instead of observing recomputation directly.
* StgCse: Do not re-use trivial case scrutineesJoachim Breitner2017-04-104-0/+20
| | | | | | | | | as they might be marked as one-shot, and suddenly we’d evaluate them multiple times. This came up in #13536 (test cases included). The solution was layed out by SPJ in ticket:13536#comment:12. Differential Revision: https://phabricator.haskell.org/D3437
* Parenthesize type/data families correctly for -ddump-splicesAlan Zimmerman2017-04-094-0/+96
| | | | | | | Fix a regression in the pretty-printed code for -ddump-splices, which regressed since 8.0. Closes trac issue #13550
* Do Note [Improving seq] alwaysSimon Peyton Jones2017-04-073-0/+22
| | | | | | | | | | This patch fixes Trac #13468, and at the same time makes the code simpler and more uniform. In particular, I've eliminated the awkward conflict between the old built-in rule for seq (which elimianted a cast), and the desire to make case scrutinse a data type by doing type-family reduction (which adds a cast). Nice.
* testsuite: Update expected performance numbers on 32-bit LinuxBen Gamari2017-04-062-7/+10
| | | | | | The Harbormaster build seems to slightly disagree with my local build machine on a few of these. In the case of `haddock.compiler` the difference is nearly an order of magnitude. Odd.
* Add regression test for #13538Ryan Scott2017-04-062-0/+46
| | | | | | | | | | | | | | | | | | Commit 2b64e926a628fb2a3710b0360123ea73331166fe (#13135) ended up fixing #13538 as well. Let's add a regression test so that it stays fixed. Test Plan: make test TEST=T13538 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13538 Differential Revision: https://phabricator.haskell.org/D3426
* Be less aggressive about fragile-context warrningsSimon Peyton Jones2017-04-064-4/+36
| | | | | | | | | | In the implementation of WarnSimplifiableClassConstraints, be less aggressive about reporting a problem. We were complaining about a "fragile" case that in fact was not fragile. See Note [Simplifiable given constraints] in TcValidity. This fixes Trac #13526.