summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Bump perf test targetswip/tdammers/D4394Tobias Dammers2018-04-112-3/+6
| | | | | | Collateral to #14737: a handful of tests perform somewhat worse with this patch, and one perfoms better. For now, just doctor the numbers to make it pass.
* Fix bug in invocation of decomposeFunCoSimon Peyton Jones2018-04-041-1/+1
| | | | | | We were invoking decomposeFunCo with the wrong role argument; i.e. one that did not match the pre-condition of decomposeFunCo, that that the role argument is the role of the coercion argument.
* Fix rebasing-induced failuresTobias Dammers2018-03-303-4/+14
|
* Fix rebasing mistakeTobias Dammers2018-03-272-4/+0
|
* Increased allocation limit for T5321 on OS XTobias Dammers2018-03-271-0/+3
|
* Fix test to reflect changed NthCo ctorTobias Dammers2018-03-271-1/+1
|
* Refactor mkCoCastTobias Dammers2018-03-271-12/+7
| | | | | Get rid of ugly case pattern matching in favor of simply getting the last two arguments unconditionally.
* Fixed unused variablesTobias Dammers2018-03-271-8/+8
|
* Another fix as per D4394Tobias Dammers2018-03-271-1/+1
|
* Refactored setNominalRole_maybe to avoid dragging role through recursionTobias Dammers2018-03-271-31/+35
|
* Removed dead codeTobias Dammers2018-03-271-6/+1
|
* Fixes to Coercion.hsTobias Dammers2018-03-271-9/+10
|
* NthCo handling, assertions and documentation improvementsTobias Dammers2018-03-271-65/+95
|
* Tighten cached role in NthCoRichard Eisenberg2018-03-2710-105/+115
|
* Documented invariant on cached rolesTobias Dammers2018-03-271-0/+4
|
* Fixed NthCo Note (discussion in D4385)Tobias Dammers2018-03-271-8/+14
| | | | https://phabricator.haskell.org/D4385#inline-34161
* Caching coercion roles in NthCo and coercionKindsRole refactoring (#11735)Richard Eisenberg2018-03-274-5/+8
| | | | | | | | Reviewers: goldfire, bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4394
* Make mkNthCo take a Role parameter.Richard Eisenberg2018-03-2713-166/+225
| | | | | | 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-03-2713-43/+68
|
* Simplification as per #11735Tobias Dammers2018-03-271-6/+4
| | | | (https://ghc.haskell.org/trac/ghc/ticket/11735#comment:19)
* Refactored coercionKindsRole (as per #11735)Tobias Dammers2018-03-271-49/+25
|
* Added SCCs to hunt down #14683Tobias Dammers2018-03-272-33/+48
|
* Applying patch suggested in #11735 to improve coercionKind perfTobias Dammers2018-03-271-0/+2
|
* rts: Fix profiled build after D4529Ben Gamari2018-03-272-4/+6
|
* testsuite: Add test for #14965Ben Gamari2018-03-274-0/+30
|
* CmmPipeline: add a second pass of CmmCommonBlockElimMichal Terepeta2018-03-272-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sinking pass often gets rid of unnecessary registers registers/assignements exposing more opportunities for CBE, so this commit adds a second round of CBE after the sinking pass and should fix #12915 (and some examples in #14226). Nofib results: * Binary size: 0.9% reduction on average * Compile allocations: 0.7% increase on average * Runtime: noisy, two separate runs of nofib showed a tiny reduction on average, (~0.2-0.3%), but I think this is mostly noise * Compile time: very noisy, but generally within +/- 0.5% (one run faster, one slower) One interesting part of this change is that running CBE invalidates results of proc-point analysis. But instead of re-doing the whole analysis, we can use the map that CBE creates for replacing/comparing block labels (maps a redundant label to a useful one) to update the results of proc-point analysis. This lowers the overhead compared to the previous experiment in #12915. Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com> Test Plan: ./validate Reviewers: bgamari, simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie, carter GHC Trac Issues: #12915, #14226 Differential Revision: https://phabricator.haskell.org/D4417
* configure: Throw error if OS is found to be msysBen Gamari2018-03-271-0/+3
| | | | | | | | | | | | | Test Plan: Try running configure on Windows with msys and mingw toolchains Reviewers: Phyx, hvr Reviewed By: Phyx Subscribers: rwbarton, thomie, erikd, carter Differential Revision: https://phabricator.haskell.org/D4526
* Fix the test for #13938Ryan Scott2018-03-274-68/+102
| | | | | Only half of the test files were checked in for T13938. This commit adds the missing half.
* Deal with join points with RULESSimon Peyton Jones2018-03-272-36/+86
| | | | | | | | | | Trac #13900 showed that when we have a join point that has a RULE, we must push the continuation into the RHS of the RULE. See Note [Rules and unfolding for join points] It's hard to tickle this bug, so I have not added a regression test.
* White space onlySimon Peyton Jones2018-03-271-0/+4
|
* Minor refactor and commmentsSimon Peyton Jones2018-03-271-17/+24
| | | | | Minor refactor and comments, following Ryan's excellent DeriveAnyClass bug (Trac #14932)
* Avoid quadratic complexity in typeKindSimon Peyton Jones2018-03-271-1/+10
| | | | | | | | I took 10 minute to fix this potential performance hole (Trac #14263) There are no actual bug reports against it, so no regression test.
* Comments onlySimon Peyton Jones2018-03-271-0/+4
|
* Fix performance of flattener patch (#12919)Alexander Vieth2018-03-267-161/+405
| | | | | | | | | | | This patch, authored by alexvieth and reviewed at D4451, makes performance improvements by critically optimizing parts of the flattener. Summary: T3064, T5321FD, T5321Fun, T9872a, T9872b, T9872c all pass. T9872a and T9872c show improvements beyond the -5% threshold. T9872d fails at 10.9% increased allocations.
* Fix #12919 by making the flattener homegeneous.Richard Eisenberg2018-03-2624-655/+1408
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes a key invariant of the flattener. Previously, flattening a type meant flattening its kind as well. But now, flattening is always homogeneous -- that is, the kind of the flattened type is the same as the kind of the input type. This is achieved by various wizardry in the TcFlatten.flatten_many function, as described in Note [flatten_many]. There are several knock-on effects, including some refactoring in the canonicalizer to take proper advantage of the flattener's changed behavior. In particular, the tyvar case of can_eq_nc' no longer needs to take casts into account. Another effect is that flattening a tyconapp might change it into a casted tyconapp. This might happen if the result kind of the tycon contains a variable, and that variable changes during flattening. Because the flattener is homogeneous, it tacks on a cast to keep the tyconapp kind the same. However, this is problematic when flattening CFunEqCans, which need to have an uncasted tyconapp on the LHS and must remain homogeneous. The solution is a more involved canCFunEqCan, described in Note [canCFunEqCan]. This patch fixes #13643 (as tested in typecheck/should_compile/T13643) and the panic in typecheck/should_compile/T13822 (as reported in #14024). Actually, there were two bugs in T13822: the first was just some incorrect logic in tryFill (part of the unflattener) -- also fixed in this patch -- and the other was the main bug fixed in this ticket. The changes in this patch exposed a long-standing flaw in OptCoercion, in that breaking apart an AppCo sometimes has unexpected effects on kinds. See new Note [EtaAppCo] in OptCoercion, which explains the problem and fix. Also here is a reversion of the major change in 09bf135ace55ce2572bf4168124d631e386c64bb, affecting ctEvCoercion. It turns out that making the flattener homogeneous changes the invariants on the algorithm, making the change in that patch no longer necessary. This patch also fixes: #14038 (dependent/should_compile/T14038) #13910 (dependent/should_compile/T13910) #13938 (dependent/should_compile/T13938) #14441 (typecheck/should_compile/T14441) #14556 (dependent/should_compile/T14556) #14720 (dependent/should_compile/T14720) #14749 (typecheck/should_compile/T14749) Sadly, this patch negatively affects performance of type-family- heavy code. The following patch fixes these performance degradations. However, the performance fixes are somewhat invasive and so I've kept them as a separate patch, labeling this one as [skip ci] so that validation doesn't fail on the performance cases.
* Fix compilation stopper on macOS with -WerrorRichard Eisenberg2018-03-261-0/+2
| | | | | | | | | Commit 94f02547083cf6df686ea0b95fed050184c533de added some pragmas that allow GCC to compile GHC, but stop macOS's clang. This adds another counter-pragma to halp clang lumber along, too. Fixes #14977.
* Make it evident in types that StgLam can't have empty argsÖmer Sinan Ağacan2018-03-262-8/+11
| | | | | | | | | | | | | StgLam can't have empty arguments. Reflect this in types. An assertion can now be deleted. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4484
* rts, base: Refactor stats.c to improve --machine-readable reportDouglas Wilson2018-03-264-317/+691
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There should be no change in the output of the '+RTS -s' (summary) report, or the 'RTS -t' (one-line) report. All data shown in the summary report is now shown in the machine readable report. All data in RTSStats is now shown in the machine readable report. init times are added to RTSStats and added to GHC.Stats. Example of the new output: ``` [("bytes allocated", "375016384") ,("num_GCs", "113") ,("average_bytes_used", "148348") ,("max_bytes_used", "206552") ,("num_byte_usage_samples", "2") ,("peak_megabytes_allocated", "6") ,("init_cpu_seconds", "0.001642") ,("init_wall_seconds", "0.001027") ,("mut_cpu_seconds", "3.020166") ,("mut_wall_seconds", "0.757244") ,("GC_cpu_seconds", "0.037750") ,("GC_wall_seconds", "0.009569") ,("exit_cpu_seconds", "0.000890") ,("exit_wall_seconds", "0.002551") ,("total_cpu_seconds", "3.060452") ,("total_wall_seconds", "0.770395") ,("major_gcs", "2") ,("allocated_bytes", "375016384") ,("max_live_bytes", "206552") ,("max_large_objects_bytes", "159344") ,("max_compact_bytes", "0") ,("max_slop_bytes", "59688") ,("max_mem_in_use_bytes", "6291456") ,("cumulative_live_bytes", "296696") ,("copied_bytes", "541024") ,("par_copied_bytes", "493976") ,("cumulative_par_max_copied_bytes", "104104") ,("cumulative_par_balanced_copied_bytes", "274456") ,("fragmentation_bytes", "2112") ,("alloc_rate", "124170795") ,("productivity_cpu_percent", "0.986838") ,("productivity_wall_percent", "0.982935") ,("bound_task_count", "1") ,("sparks_count", "5836258") ,("sparks_converted", "237") ,("sparks_overflowed", "1990408") ,("sparks_dud ", "0") ,("sparks_gcd", "3455553") ,("sparks_fizzled", "390060") ,("work_balance", "0.555606") ,("n_capabilities", "4") ,("task_count", "10") ,("peak_worker_count", "9") ,("worker_count", "9") ,("gc_alloc_block_sync_spin", "162") ,("gc_alloc_block_sync_yield", "0") ,("gc_alloc_block_sync_spin", "162") ,("gc_spin_spin", "18840855") ,("gc_spin_yield", "10355") ,("mut_spin_spin", "70331392") ,("mut_spin_yield", "61700") ,("waitForGcThreads_spin", "241") ,("waitForGcThreads_yield", "2797") ,("whitehole_gc_spin", "0") ,("whitehole_lockClosure_spin", "0") ,("whitehole_lockClosure_yield", "0") ,("whitehole_executeMessage_spin", "0") ,("whitehole_threadPaused_spin", "0") ,("any_work", "1667") ,("no_work", "1662") ,("scav_find_work", "1026") ,("gen_0_collections", "111") ,("gen_0_par_collections", "111") ,("gen_0_cpu_seconds", "0.036126") ,("gen_0_wall_seconds", "0.036126") ,("gen_0_max_pause_seconds", "0.036126") ,("gen_0_avg_pause_seconds", "0.000081") ,("gen_0_sync_spin", "21") ,("gen_0_sync_yield", "0") ,("gen_1_collections", "2") ,("gen_1_par_collections", "1") ,("gen_1_cpu_seconds", "0.001624") ,("gen_1_wall_seconds", "0.001624") ,("gen_1_max_pause_seconds", "0.001624") ,("gen_1_avg_pause_seconds", "0.000272") ,("gen_1_sync_spin", "3") ,("gen_1_sync_yield", "0") ] ``` Test Plan: Ensure that one-line and summary reports are unchanged. Reviewers: erikd, simonmar, hvr Subscribers: duog, carter, thomie, rwbarton GHC Trac Issues: #14660 Differential Revision: https://phabricator.haskell.org/D4529
* circleci: Bump Hackage index stateBen Gamari2018-03-261-1/+1
|
* Add a job running on Fedoramrkkrp2018-03-262-0/+45
|
* Add unaligned bytearray access primops. Fixes #4442.Reiner Pope2018-03-255-1/+543
| | | | | | | | | | | | Reviewers: bgamari, simonmar Reviewed By: bgamari Subscribers: dfeuer, rwbarton, thomie, carter GHC Trac Issues: #4442 Differential Revision: https://phabricator.haskell.org/D4488
* Add new debugging flag -dinline-checkBen Gamari2018-03-256-9/+72
| | | | | | | | | | | | | | | | | | | | | | | This flag reports a summary of the inlining decision for identifiers prefixed by the flag's argument. For example, `-dinline-check foo` will report why definitions whose prefix is `foo` are inlined or not. Previously the only way to get this information was to pass a combination of `-dverbose-core2core` and `-ddump-inlinings`. This combination led to a log of 12 million lines in a module of about 200 lines I recently had to apply it to. This flag provides a much more direct way to find the occurence you care about. Reviewers: osa1, dfeuer, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4458
* base: Fix Unicode handling of TyCon's Show instanceBen Gamari2018-03-251-1/+1
| | | | | | | | | | | | | | Test Plan: `make test TEST=T14925` Reviewers: hvr, dfeuer Reviewed By: dfeuer Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14925 Differential Revision: https://phabricator.haskell.org/D4530
* llvmGen: Pass -optlo flags last to optOleg Grenrus2018-03-251-1/+3
| | | | | | | | | | | | | | | LLVM, like GHC, processes flags in the order that they appear. Consequently, we need to ensure the user-provided flags appear last so they can override flags produced by GHC. See #14821. Test Plan: `ghc -O2 -optlo-O2 -v3 $FILE` and ensure that `opt` and `llc` are invoked with `-O2`. Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14821 Differential Revision: https://phabricator.haskell.org/D4421
* Fix scoped type variables in TH for several constructsHE, Tao2018-03-257-78/+177
| | | | | | | | | | | | | | | | | | | | | | | | Namely class methods, default signatures and pattern synonyms. When scoped type variables occur inside class default methods, default signatures and pattern synonyms, avoid re-create explicit type variables when represent the type signatures. This patch should fix Trac#14885. Signed-off-by: HE, Tao <sighingnow@gmail.com> Test Plan: make test TEST="T14885a T14885b T14885c" Reviewers: goldfire, bgamari, simonpj, RyanGlScott Reviewed By: simonpj, RyanGlScott Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14885 Differential Revision: https://phabricator.haskell.org/D4469
* Don't refer to blocks in debug info when -g1Bartosz Nitka2018-03-254-2/+20
| | | | | | | | | | | | | | | | | | | | -g1 removes block information, but it turns out that procs can refer to block information through parents. Note [Splitting DebugBlocks] explains the parentage relationship. Test Plan: * ./validate * added a new test Reviewers: bgamari, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14894 Differential Revision: https://phabricator.haskell.org/D4496
* Fix #14916 with an additional validity check in deriveTyDataRyan Scott2018-03-256-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually-written instances and standalone-derived instances have the benefit of having the `checkValidInstHead` function run over them, which catches manual instances of built-in types like `(~)` and `Coercible`. However, instances generated from `deriving` clauses weren't being passed through `checkValidInstHead`, leading to confusing results as in #14916. `checkValidInstHead` also has additional validity checks for language extensions like `FlexibleInstances` and `MultiParamTypeClasses`. Up until now, GHC has never required these language extensions for `deriving` clause, so to avoid unnecessary breakage, I opted to suppress these language extension checks for `deriving` clauses, just like we currently suppress them for `SPECIALIZE instance` pragmas. Test Plan: make test TEST=T14916 Reviewers: goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14916 Differential Revision: https://phabricator.haskell.org/D4501
* testsuite: Add test for #14925Ben Gamari2018-03-253-0/+8
| | | | | | | | | | | | | | Test Plan: Validate Reviewers: alpmestan Reviewed By: alpmestan Subscribers: alpmestan, leftaroundabout, rwbarton, thomie, carter GHC Trac Issues: #14925 Differential Revision: https://phabricator.haskell.org/D4512
* rts/RetainerProfile: Dump closure type if push() failsRyan Scott2018-03-251-1/+1
| | | | | | | | | | | | | | While investigating #14947, I noticed that the `barf`ed error message in `push()` doesn't print out the closure type that causes it to crash. Let's do so. Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: alexbiehl, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4525
* document: fix trac issue #14229Võ Anh Duy2018-03-251-2/+2
| | | | | | | | | | | | | | | Accroding to https://git.haskell.org/ghc.git/commitdiff/49672659113371c3bee691e6d913d f8e6f60a1d8, `-Wredundant-constraints` is no longer turn on by default. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4528