summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix wayswip/eventlog-heap-profileBen Gamari2016-03-263-37/+41
|
* DocumentationBen Gamari2016-03-261-0/+108
|
* Allow prof, eventlog, and threaded ways to coexistBen Gamari2016-03-263-2/+10
|
* Log heap profiler samples to event logBen Gamari2016-03-266-4/+300
|
* DWARF: Add debugging information chapter to users guideBen Gamari2016-03-262-0/+315
| | | | | | | | | | Test Plan: Proof-read Reviewers: scpmw, austin Subscribers: simonmar, thomie Differential Revision: https://phabricator.haskell.org/D1369
* testsuite: Identify framework failures in testsuite summaryBen Gamari2016-03-261-0/+14
| | | | | | | | | | | | | | | | Currently the testsuite driver tells you how many tests failed due to a framework failure but you need to manually grep through the testsuite output to identify which ones. Test Plan: Validate with, e.g., a timing out testcase Reviewers: austin, thomie Reviewed By: austin, thomie Differential Revision: https://phabricator.haskell.org/D2026 GHC Trac Issues: #11165
* Panic: Try outputting SDocsBen Gamari2016-03-262-20/+34
| | | | | | | | | | | | | | | | | This works in conjunction with D2036 to allow useful debug output before DynFlags has been initializated. See #11755. Reviewers: austin Reviewed By: austin Subscribers: thomie, gridaphobe Differential Revision: https://phabricator.haskell.org/D2037 GHC Trac Issues: #11755
* DynFlags: Initialize unsafeGlobalDynFlags enough to be usefulBen Gamari2016-03-261-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | Previously unsafeGlobalDynFlags would bottom if used prior to initialization. This meant that any attempt to use the pretty-printer early in the initialization process of the compiler would fail. This is quite inconvenient. Here we initialize unsafeGlobalDynFlags with defaultDynFlags, bottoming only if settings is accessed. See #11755. Test Plan: Validate Reviewers: austin Reviewed By: austin Subscribers: thomie, gridaphobe Differential Revision: https://phabricator.haskell.org/D2036 GHC Trac Issues: #11755
* More clarification in docs for implicit quantificationSimon Peyton Jones2016-03-251-1/+13
| | | | | | This is a follow-up patch to the previous one for #11726. It turns out that I'd missed the point of the ticket; this patch addresses it.
* Document implicit quantification betterSimon Peyton Jones2016-03-251-4/+5
| | | | Addresses Trac #11726
* Test Trac #11728Simon Peyton Jones2016-03-253-0/+32
|
* A raft of comments about TyBindersSimon Peyton Jones2016-03-256-274/+429
| | | | | | | | I had a conversation with Richard about TyBinders and VisibilityFlags. This patch adds a lot of comments to explain what is going on. I feel much more secure now. Richard please check.
* CorePrep: refactoring to reduce duplicationSimon Peyton Jones2016-03-251-28/+21
| | | | There's no functional change here, just tidying up
* Do not eta-reduce across Ticks in CorePrepSimon Peyton Jones2016-03-251-2/+7
| | | | | | | | The function tryEtaReducePrep was being over-ambitious. When Breakpoint ticks were involved (i.e. in GHCi), eta reduction left an out-of-scope variable in the Tick. Easily fixed. Fixes the original report in Trac #111728.
* An extra traceTc in tcExpr for ExprWithSigSimon Peyton Jones2016-03-251-0/+1
|
* base: Fix GHC.Word and GHC.Int on 32-bit platformsBen Gamari2016-03-252-4/+4
| | | | | | | Due to a cut-and-paste error D1980 (#11688) broke 32-bit platforms. This should fix it. See #11750.
* Remove code-duplication in the PPC NCGHerbert Valerio Riedel2016-03-241-26/+19
| | | | | | Reviewed By: bgamari, trommler Differential Revision: https://phabricator.haskell.org/D2020
* Add NCG support for AIX/ppc32Herbert Valerio Riedel2016-03-2412-46/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This extends the previous work to revive the unregisterised GHC build for AIX/ppc32. Strictly speaking, AIX runs on POWER4 (and later) hardware, but the PPC32 instructions implemented in the PPC NCG represent a compatible subset of the POWER4 ISA. IBM AIX follows the PowerOpen ABI (and shares many similiarites with the Linux PPC64 ELF V1 NCG backend) but uses the rather limited XCOFF format (compared to ELF). This doesn't support dynamic libraries yet. A major limiting factor is that the AIX assembler does not support the `@ha`/`@l` relocation types nor the ha16()/lo16() functions Darwin's assembler supports. Therefore we need to avoid emitting those. In case of numeric literals we simply compute the functions ourselves, while for labels we have to use local TOCs and hope everything fits into a 16bit offset (for ppc32 this gives us at most 16384 entries per TOC section, which is enough to compile GHC). Another issue is that XCOFF doesn't seem to have a relocation type for label-differences, and therefore the label-differences placed into tables-next-to-code can't be relocated, but the linker may rearrange different sections, so we need to place all read-only sections into the same `.text[PR]` section to workaround this. Finally, the PowerOpen ABI distinguishes between function-descriptors and actualy entry-point addresses. For AIX we need to be specific when emitting assembler code whether we want the address of the function descriptor `printf`) or for the entry-point (`.printf`). So we let the asm pretty-printer prefix a dot to all emitted subroutine calls (i.e. `BL`) on AIX only. For now, STG routines' entry-point labels are not prefixed by a label and don't have any associated function-descriptor. Reviewers: austin, trommler, erikd, bgamari Reviewed By: trommler, erikd, bgamari Differential Revision: https://phabricator.haskell.org/D2019
* Add option `no-keep-hi-files` and `no-keep-o-files` (fixes #4114)Kai Harries2016-03-2413-2/+197
| | | | | | | | | | | | | | | | | Summary: Remove `.hi` and `.o` files if the flags `no-keep-hi-files` and `no-keep-o-files` are given. Test Plan: ./validate Reviewers: austin, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2021 GHC Trac Issues: #4114
* users_guide: small improvements on pattern synonyms.Dominik Bollmann2016-03-241-11/+15
| | | | | | | | | | | | | | Since the order of required and provided constraint contexts of pattern synonyms has been switched recently, I updated a couple places in the users guide's pattern synonym section to accommodate for this. Test Plan: read it :-) Reviewers: goldfire, thomie, mpickering, simonpj, austin, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D2034
* users-guide: Add -Wredundant-constraints to flags referenceBen Gamari2016-03-242-0/+9
| | | | | | | | | | | | Test Plan: Validate and read Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2035 GHC Trac Issues: #11741
* users_guide: Fix various issuesBen Gamari2016-03-241-7/+11
| | | | | | | | | | | | | Sphinx apparently expects references to anchors that don't accompany a header to have a caption. Test Plan: validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2033
* Avoid local label syntax for assembler on AIXHerbert Valerio Riedel2016-03-242-5/+29
| | | | | | | | | | | | | Unfortunately (for inline `__asm__()` uses), IBM's `as` doesn't seem to support local labels[1] like GNU `as` does so we need to workaround this when on AIX. [1]: https://sourceware.org/binutils/docs/as/Symbol-Names.html#Symbol-Names Turns out this also addresses the long-standing bug #485 Reviewed By: bgamari, trommler Differential Revision: https://phabricator.haskell.org/D2029
* Tidy up handling of coercion variablesSimon Peyton Jones2016-03-2410-47/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Comments to explain that a CoVar, whose IdInfo is CoVarId, is always unlifted (but may be nominal or representational role) And TyCoRep.isCoercionType picks out only those unlifted types, NOT the lifted versions * Introduce Var.NcId for non-co-var Ids with predicate isNonCoVarId * Add assertions in CoreSubst that the Id env is only used for NcIds * Fix lurking bug in CSE which extended the CoreSubst Id env with a CoVar * Fix two bugs in Specialise.spec_call, which wrongly treated CoVars like NcIds - needed a varToCoreExpr in one place - needed extendSubst not extendIdSubst in another This was the root cause of Trac #11644 Minor refactoring * Eliminate unused mkDerivedLocalCoVarM, mkUserLocalCoVar * Small refactor in mkSysLocalOrCoVar
* Comments onlySimon Peyton Jones2016-03-241-1/+1
|
* Defer inlining of Eq for primitive typesBen Gamari2016-03-246-36/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is one solution to #11688, wherein (==) was inlined to soon defeating a rewrite rule provided by bytestring. Since the RHSs of Eq's methods are simple, there is little to be gained and much to be lost by inlining them early. For instance, the bytestring library provides, ```lang=haskell break :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString) breakByte :: Word8 -> ByteString -> (ByteString, ByteString) ``` and a rule ``` forall x. break ((==) x) = breakByte x ``` since `breakByte` implments an optimized version of `break (== x)` for known `x :: Word8`. If we allow `(==)` to be inlined too early, we will prevent this rule from firing. This was the cause of #11688. This patch just defers the `Eq` methods, although it's likely worthwhile giving `Ord` this same treatment. This regresses compiler allocations for T9661 by about 8% due to the additional inlining that we now require the simplifier to perform. Updates the `bytestring` submodule to include updated rewrite rules which match on `eqWord8` instead of `(==)`. Test Plan: * Validate, examine performance impact Reviewers: simonpj, hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1980 GHC Trac Issues: #11688
* Default RuntimeRep variables unless -fprint-explicit-runtime-repsBen Gamari2016-03-2410-12/+144
| | | | | | | | | | | | | | | | | | | | Summary: Addresses #11549 by defaulting `RuntimeRep` variables to `PtrRepLifted` and adding a new compiler flag `-fprint-explicit-runtime-reps` to disable this behavior. This is just a guess at the right way to go about this. If it's wrong-beyond-any-hope just say so. Test Plan: Working on a testcase Reviewers: goldfire, austin Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1961 GHC Trac Issues: #11549
* Show: Restore redundant parentheses around recordsBen Gamari2016-03-246-12/+23
| | | | | | | | | | | | | | | | | | | | As discussed in #2530 we are going to continue to produce parentheses here in order to preserve compatibility with previous GHC releases. It was found that dropped parentheses would break some testsuites which compared against output from Show. This has been documented in the users guide. This reverts commit 5692643c9d17e746327588cd6157a923642b7975. Test Plan: Validate Reviewers: hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2027 GHC Trac Issues: #2350
* Revert "Various ticky-related work"Ben Gamari2016-03-244-55/+25
| | | | | This reverts commit 6c2c853b11fe25c106469da7b105e2be596c17de which was supposed to be merged as individual commits.
* Add expected output for T9405Ben Gamari2016-03-241-0/+3
|
* DsExpr: Rip out static/dynamic check in list desugaringBen Gamari2016-03-244-78/+41
| | | | | | | | | | | | | | | | | | | | | | Previously we would try to break explicit lists into a dynamic prefix and static tail and desugar the former into a `build` expression. Unfortunately, this heuristic resulted in surprising behavior (see #11710) and wasn't pulling its weight. Here we drop it (along with the `-fsimple-list-literals` flag), leaving only the list length heuristic to determine whether `build` or cons list desugaring should be used. Test Plan: Validate Reviewers: simonpj, austin Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2023 GHC Trac Issues: #11710
* Create empty dump files (fixes #10320)Kai Harries2016-03-244-1/+34
| | | | | | | | | | | | | | Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2015 GHC Trac Issues: #10320
* Various ticky-related workJoachim Breitner2016-03-244-25/+55
| | | | | | | | | | | | | | | | | | this Diff contains small, self-contained changes as I work towards fixing #10613. It is mostly created to let harbormaster do its job, but feedback is welcome as well. Please do not merge this via arc; I’d like to push the individual patches as layed out here. I might push mostly trivial ones even without review, as long as the build passes. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2014
* Add unicode syntax for banana bracketsJosh Price2016-03-246-19/+72
| | | | | | | | | | | | | | | | | | | | | Summary: Add "⦇" and "⦈" as unicode alternatives for "(|" and "|)" respectively. This must be implemented differently than other unicode additions because ⦇" and "⦈" are interpretted as a $unigraphic rather than a $unisymbol. Test Plan: validate Reviewers: goldfire, bgamari, austin Reviewed By: bgamari, austin Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D2012 GHC Trac Issues: #10162
* Close ticky profiling file stream after printing (#9405)Flaviu Andrei Csernik2016-03-245-1/+21
| | | | | | | | | | | | | | Test Plan: T9405 Reviewers: simonmar, austin, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2008 GHC Trac Issues: #9405
* Add `PatSynSigSkol` and modify `PatSynCtxt`Rik Steenkamp2016-03-2412-68/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the type of a pattern synonym cannot in general be represented by a value of type Type, we cannot use a value `SigSkol (PatSynCtxt n) (Check ty)` to represent the signature of a pattern synonym (this causes incorrect signatures to be printed in error messages). Therefore we now represent it by a value `PatSynSigSkol n` (instead of incorrect signatures we simply print no explicit signature). Furthermore, we rename `PatSynCtxt` to `PatSynBuilderCtxt`, and use `SigSkol (PatSynBuilderCtxt n) (Check ty)` to represent the type of a bidirectional pattern synonym when used in an expression context. Before, this type was represented by a value `SigSkol (PatSynCtxt n) (Check ty)`, which caused incorrect error messages. Also, in `mk_dict_err` of `typecheck\TcErrors.hs` we now distinguish between all enclosing implications and "useful" enclosing implications, for better error messages concerning pattern synonyms. See `Note [Useful implications]`. See the Phabricator page for examples. Reviewers: mpickering, goldfire, simonpj, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1967 GHC Trac Issues: #11667
* ErrUtils: Add timings to compiler phasesBen Gamari2016-03-2417-108/+197
| | | | | | | | | | | | | | | | | | | | | | | This adds timings and allocation figures to the compiler's output when run with `-v2` in an effort to ease performance analysis. Todo: * Documentation * Where else should we add these? * Perhaps we should remove some of the now-arguably-redundant `showPass` occurrences where they are * Must we force more? * Perhaps we should place this behind a `-ftimings` instead of `-v2` Test Plan: `ghc -v2 Test.hs`, look at the output Reviewers: hvr, goldfire, simonmar, austin Reviewed By: simonmar Subscribers: angerman, michalt, niteria, ezyang, thomie Differential Revision: https://phabricator.haskell.org/D1959
* Ensure T9646 dump-simpl output is cleanedBen Gamari2016-03-241-1/+4
|
* base: Fix ClockGetTime on OS XBen Gamari2016-03-242-2/+2
| | | | | | | | | | | | | | | | | Apparently _POSIX_CPUTIME may be defined as -1 if CLOCK_PROCESS_CPUTIME_ID isn't defined. Test Plan: Validate Reviewers: austin, hvr, erikd, goldfire Reviewed By: erikd, goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2028 GHC Trac Issues: #11733
* Fix regression test for #11145.Dominik Bollmann2016-03-242-2/+2
| | | | | | | | | | | | | | Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2032 GHC Trac Issues: #11145
* Move DFunUnfolding generation to TcInstDclsSimon Peyton Jones2016-03-235-33/+52
| | | | | | | | The desugarer had a fragile case to generate the Unfolding for a DFun. This patch moves the unfolding generation to TcInstDcls, where all the pieces are to hand. Fixes Trac #11742
* Move applyTysX near piResultTysSimon Peyton Jones2016-03-231-12/+12
|
* Comment fixSimon Peyton Jones2016-03-231-1/+1
|
* Avoid running afoul of the zipTvSubst check.Richard Eisenberg2016-03-211-1/+2
| | | | | | | | addDataConStupidTheta includes comments that the types list might be longer than the tvs list. And the check in zipTvSubst doesn't appear to be terribly recent. I am utterly flummoxed as to why this worked before. It was clearly just broken. And now it's fixed.
* Use the correct in-scope set in coercionKindBartosz Nitka2016-03-211-2/+12
| | | | | | | | | | | | | | | | | The free vars of `ty2` need to be in scope to satisfy the substitution invariant. As far as I can tell we don't have the free vars of `ty2` when substituting, so unfortunately we have to compute them. Test Plan: ./validate Reviewers: austin, bgamari, simonpj, goldfire Subscribers: thomie, simonmar Differential Revision: https://phabricator.haskell.org/D2024 GHC Trac Issues: #11371
* PPC NCG: Emit more portable `fcmpu 0, ...` instead of `fcmpu cr0, ...`Herbert Valerio Riedel2016-03-211-2/+6
| | | | | | | Use `fcmpu 0, ...` rather than `fcmpu cr0, ...` for better portability since some non-GNU assembler (such as IBM's `as`) tend to not support the symbolic register name `cr0`. This matches the syntax that GCC emits for PPC targets.
* Comments (only) in TcFlattenRichard Eisenberg2016-03-211-7/+15
|
* stgMallocBytes: Tolerate malloc(0) returning a NULL ptrHerbert Valerio Riedel2016-03-211-0/+13
| | | | | | | | | | | | | | This is valid behaviour for `malloc()` according to ISO C99 and POSIX, and there's at least one operating system (AIX) which actually does return NULL for 0-sized allocations. The `createAdjustor()` routine is currently the only known use-site of `stgMallocBytes` which may call `stgMallocBytes()` requesting a 0-size allocation. Reviewed By: bgamari, austin Differential Revision: https://phabricator.haskell.org/D2022
* Improve panicking outputRichard Eisenberg2016-03-211-3/+3
|
* Fix #11723 and #11724.Richard Eisenberg2016-03-219-17/+86
| | | | Test cases: typecheck/should_fail/T1172{3,4}