summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Pattern match complex expressions by GVNwip/gvn-pmcheckSebastian Graf2019-05-031-43/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By referential transparency, multiple syntactic occurrences of the same expression evaluate to the same value. Global value numbering (GVN) assigns each such expression the same unique number (a `Name` in our case). Two expressions trivially have the same value if they are assigned the same value number. The term oracle `TmOracle` of the pattern match checker couldn't handle any complex expression before this patch. It would just give up on anything involving a function application whose head was not a constructor, by falling back to `PmExprOther`. This means it could not determine completeness of the following example: ```haskell foo | True <- id True = 1 | False <- id True = 2 ``` This is simply because `TmOracle` couldn't figure out that `id True` always evaluates to the same `Bool`. In this patch, we desugar such `PmExprOther`s in pattern guards to `CoreExpr`. We do so in order to utilise `CoreMap Name` for a light-weight GVN pass without concern for subexpressions. `TmOracle` only sees the representing variables, like so: ```haskell x = id True foo | True <- x = 1 | False <- x = 2 ``` So `TmOracle` still doesn't need to decide equality of complex expressions, which allows it to stay dead simple.
* Build Hadrian with -Werror in the 'ghc-in-ghci' CI jobAlp Mestanogullari2019-04-302-0/+6
|
* Move cGHC_UNLIT_PGM to be "unlit command" in settingsJohn Ericson2019-04-304-8/+5
| | | | | | | | | | | | The bulk of the work was done in #712, making settings be make/Hadrian controlled. This commit then just moves the unlit command rules in make/Hadrian from the `Config.hs` generator to the `settings` generator in each build system. I think this is a good change because the crucial benefit is *settings* don't affect the build: ghc gets one baby step closer to being a regular cabal executable, and make/Hadrian just maintains settings as part of bootstrapping.
* Remove settings.inJohn Ericson2019-04-301-34/+0
| | | | It is no longer needed
* Generate settings by make/hadrian instead of configureJohn Ericson2019-04-3014-21/+257
| | | | This allows it to eventually become stage-specific
* Compute demand signatures assuming idAritySebastian Graf2019-04-3017-174/+505
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This does four things: 1. Look at `idArity` instead of manifest lambdas to decide whether to use LetUp 2. Compute the strictness signature in LetDown assuming at least `idArity` incoming arguments 3. Remove the special case for trivial RHSs, which is subsumed by 2 4. Don't perform the W/W split when doing so would eta expand a binding. Otherwise we would eta expand PAPs, causing unnecessary churn in the Simplifier. NoFib Results -------------------------------------------------------------------------------- Program Allocs Instrs -------------------------------------------------------------------------------- fannkuch-redux +0.3% 0.0% gg -0.0% -0.1% maillist +0.2% +0.2% minimax 0.0% +0.8% pretty 0.0% -0.1% reptile -0.0% -1.2% -------------------------------------------------------------------------------- Min -0.0% -1.2% Max +0.3% +0.8% Geometric Mean +0.0% -0.0%
* ghci: Ensure that system libffi include path is searchedBen Gamari2019-04-291-0/+2
| | | | Previously hsc2hs failed when building against a system FFI.
* Use pp_itemWojciech Baranowski2019-04-291-3/+1
|
* Suggest only local candidates from global envWojciech Baranowski2019-04-294-8/+11
|
* Comment on 'candidates' functionWojciech Baranowski2019-04-291-0/+2
|
* osa1's patch: consistent suggestion messageWojciech Baranowski2019-04-292-5/+6
|
* Print suggestions in a single messageWojciech Baranowski2019-04-292-7/+9
|
* rename: hadle type signatures with typosWojciech Baranowski2019-04-295-2/+51
| | | | | | | When encountering type signatures for unknown names, suggest similar alternatives. This fixes issue #16504
* gitlab-ci: Reintroduce DWARF-enabled bindistsBen Gamari2019-04-251-0/+15
| | | | | It seems that this was inadvertently dropped in 1285d6b95fbae7858abbc4722bc2301d7fe40425.
* Update autoconf scriptsBen Gamari2019-04-256-4794/+5196
| | | | Scripts taken from autoconf a8d79c3130da83c7cacd6fee31b9acc53799c406
* update-autoconf: Initial commitBen Gamari2019-04-251-0/+27
|
* Minor RTS refactoring:Ömer Sinan Ağacan2019-04-253-4/+4
| | | | | | - Remove redundant casting in evacuate_static_object - Remove redundant parens in STATIC_LINK - Fix a typo in GC.c
* checkPattern error hint is PV contextVladislav Zavialov2019-04-253-90/+136
| | | | | There is a hint added to error messages reported in checkPattern. Instead of passing it manually, we put it in a ReaderT environment inside PV.
* Introduce MonadP, make PV a newtypeVladislav Zavialov2019-04-253-73/+104
| | | | | | | | | | | Previously we defined type PV = P, this had the downside that if we wanted to change PV, we would have to modify P as well. Now PV is free to evolve independently from P. The common operations addError, addFatalError, getBit, addAnnsAt, were abstracted into a class called MonadP.
* gitlab-ci: source-tarball job should have no dependenciesBen Gamari2019-04-241-0/+1
|
* Fix error message for './configure' regarding '--with-ghc' [skip ci]Alexandre Baldé2019-04-231-1/+1
|
* osReserveHeapMemory: handle signed rlim_tFraser Tweedale2019-04-231-2/+4
| | | | | | rlim_t is a signed type on FreeBSD, and the build fails with a sign-compare error. Add explicit (unsigned) cast to handle this case.
* Stop misusing EWildPat in pattern match coverage checkingVladislav Zavialov2019-04-221-27/+22
| | | | | | | | | | | | | | | | EWildPat is a constructor of HsExpr used in the parser to represent wildcards in ambiguous positions: * in expression context, EWildPat is turned into hsHoleExpr (see rnExpr) * in pattern context, EWildPat is turned into WildPat (see checkPattern) Since EWildPat exists solely for the needs of the parser, we could remove it by improving the parser. However, EWildPat has also been used for a different purpose since 8a50610: to represent patterns that the coverage checker cannot handle. Not only this is a misuse of EWildPat, it also stymies the removal of EWildPat.
* Hadrian: use the testsuite driver's config.haddock arg more correctlyAlp Mestanogullari2019-04-222-1/+16
| | | | | | | | | | | | | | | 4 haddock tests assume that .haddock files have been produced, by using the 'req_haddock' modifier. The testsuite driver assumes that this condition is satisfied if 'config.haddock' is non-empty, but before this patch Hadrian was always passing the path to where the haddock executable should be, regardless of whether it is actually there or not. Instead, we now pass an empty config.haddock when we can't find all of <build root>/docs/html/libraries/<pkg>/<pkg>.haddock>, where <pkg> ranges over array, base, ghc-prim, process and template-haskell, and pass the path to haddock when all those file exists. This has the (desired) effect of skipping the 4 tests (marked as 'missing library') when the docs haven't been built, and running the haddock tests when they have.
* Correct off by one error in ghci +cMatthew Pickering2019-04-227-8/+25
| | | | Fixes #16569
* testsuite: fix ifdef lint errors under tests/rts/linkerArtem Pyanykh2019-04-213-3/+3
|
* testsuite: move tests related to linker under tests/rts/linkerArtem Pyanykh2019-04-2153-162/+170
|
* [skip ci] correct the docs for casArray a little more. clarify that the ↵Andrew Martin2019-04-211-3/+5
| | | | returned element may be two different things
* [skip ci] correct formatting of casArray# in docs for casSmallArray#Andrew Martin2019-04-211-1/+1
|
* [skip ci] say "machine words" instead of "Int units" in the primops docsAndrew Martin2019-04-211-16/+19
|
* improve docs for casArray and casSmallArrayAndrew Martin2019-04-211-1/+8
|
* users-guide: Add libraries section to 8.10.1 release notesBen Gamari2019-04-211-0/+40
|
* users-guide: Add pretty to package listBen Gamari2019-04-211-0/+1
|
* gitlab-ci: Do not build profiled libraries on 32-bit WindowsBen Gamari2019-04-201-0/+4
| | | | Due to #15934.
* gitlab-ci: Add centos7 release jobBen Gamari2019-04-201-0/+21
|
* gitlab-ci: Only run release notes lint on release tagsBen Gamari2019-04-201-1/+2
|
* gitlab-ci: Allow doc-tarball job to failBen Gamari2019-04-201-0/+4
| | | | Due to allowed failure of Windows job.
* gitlab-ci: Improve error message on failure of doc-tarball jobBen Gamari2019-04-201-1/+13
| | | | Previously the failure was quite nondescript.
* Hadrian: Drop old/unused CI scriptsAndrey Mokhov2019-04-193-193/+0
|
* Haddock: support strict GADT args with docsAlec Theriault2019-04-197-29/+37
| | | | | | | | | Rather than massaging the output of the parser to re-arrange docs and bangs, it is simpler to patch the two places in which the strictness info is needed (to accept that the `HsBangTy` may be inside an `HsDocTy`). Fixes #16585.
* Tagless final encoding of ExpCmdI in the parserVladislav Zavialov2019-04-191-122/+131
| | | | | | | | | | | Before this change, we used a roundabout encoding: 1. a GADT (ExpCmdG) 2. a class to pass it around (ExpCmdI) 3. helpers to match on it (ecHsApp, ecHsIf, ecHsCase, ...) It is more straightforward to turn these helpers into class methods, removing the need for a GADT.
* Don't indent single alternative case expressions for STG.klebinger.andreas@gmx.at2019-04-191-5/+18
| | | | | | | Makes the width of STG dumps slightly saner. Especially for things like unboxing. Fixes #16580
* StgCmmPrim: remove an unnecessary instruction in doNewArrayOpMichal Terepeta2019-04-191-5/+2
| | | | | | | | | | | Previously we would generate a local variable pointing after the array header and use it to initialize the array elements. But we already use stores with offset, so it's easy to just add the header to those offsets during compilation and avoid generating the local variable (which would become a LEA instruction when using native codegen; LLVM already optimizes it away). Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
* Add test case for #16384Alec Theriault2019-04-182-0/+10
| | | | | | | | Now that `TExp` accepts unlifted types, #16384 is fixed. Since the real issue there was GHC letting through an ill-kinded type which `-dcore-lint` rightly rejected, a reasonable regression test is that the program from #16384 can now be accepted without `-dcore-lint` complaining.
* TH: make `Lift` and `TExp` levity-polymorphicAlec Theriault2019-04-1815-150/+306
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides the obvious benefits of being able to manipulate `TExp`'s of unboxed types, this also simplified `-XDeriveLift` all while making it more capable. * `ghc-prim` is explicitly depended upon by `template-haskell` * The following TH things are parametrized over `RuntimeRep`: - `TExp(..)` - `unTypeQ` - `unsafeTExpCoerce` - `Lift(..)` * The following instances have been added to `Lift`: - `Int#`, `Word#`, `Float#`, `Double#`, `Char#`, `Addr#` - unboxed tuples of lifted types up to arity 7 - unboxed sums of lifted types up to arity 7 Ideally we would have levity-polymorphic _instances_ of unboxed tuples and sums. * The code generated by `-XDeriveLift` uses expression quotes instead of generating large amounts of TH code and having special hard-coded cases for some unboxed types.
* Hadrian: fix the value we pass to the test driver for config.compiler_debuggedAlp Mestanogullari2019-04-181-3/+5
| | | | | We used to pass YES/NO, while that particular field is set to True/False. This happens to fix an unexpected pass, T9208.
* Hadrian: fix ghcDebugged and document itAlp Mestanogullari2019-04-184-5/+30
|
* Gitlab: allow execution of CI pipeline from the web interfaceSylvain Henry2019-04-181-0/+1
| | | | [skip ci]
* Add an Outputable instance for SDoc with ppr = id.klebinger.andreas@gmx.at2019-04-171-0/+4
| | | | When printf debugging this can be helpful.
* Typeset Big-O complexities with Tex-style notation (#16090)Sven Tennie2019-04-177-68/+69
| | | | E.g. use `\(\mathcal{O}(n^2)\)` instead of `/O(n^2)/`.