summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* remove redundant isSSE defwip/kavon-llvm-improveKavon Farvardin2018-09-301-3/+0
|
* Multiple fixes / improvements for LLVM backend #13904Kavon Farvardin2018-09-3020-45/+270
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - Fix for #13904 -- stop "trashing" callee-saved registers, since it is not actually doing anything useful. - Fix for #14251 -- fixes the calling convention for functions passing raw SSE-register values by adding padding as needed to get the values in the right registers. This problem cropped up when some args were unused an dropped from the live list. - Fixed a typo in 'readnone' attribute - Added 'lower-expect' pass to level 0 LLVM optimization passes to improve block layout in LLVM for stack checks, etc. Test Plan: `make test WAYS=optllvm` and `make test WAYS=llvm` Reviewers: bgamari, simonmar, angerman Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5190
| * Add -fkeep-cafsSimon Marlow2018-09-2811-1/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I noticed while playing around with https://github.com/fbsamples/ghc-hotswap/ that the main binary needs to have a custom main function to set `config.keep_cafs = true` when initialising the runtime. This is pretty annoying, it means an extra C file with some cryptic incantations in it, and a `-no-hs-main` flag. So I've replaced this with a link-time flag to GHC, `-fkeep-cafs` that does the same thing. Test Plan: New unit test that tests for the RTS's GC'd CAFs assertion, and also the -keep-cafs flag. Reviewers: bgamari, osa1, erikd, noamz Reviewed By: osa1 Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5183
| * Expose wopt_set/unset_fatal in DynFlagsNeil Mitchell2018-09-281-1/+1
| | | | | | | | PR: https://github.com/ghc/ghc/pull/199/
| * Normalise EmptyCase types using the constraint solverRyan Scott2018-09-289-43/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Certain `EmptyCase` expressions were mistakently producing warnings since their types did not have as many type families reduced as they could have. The most direct way to fix this is to normalise these types initially using the constraint solver to solve for any local equalities that may be in scope. Test Plan: make test TEST=T14813 Reviewers: simonpj, bgamari, goldfire Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #14813 Differential Revision: https://phabricator.haskell.org/D5094
* | add lower-expect to lvl 0 optimization; it's basically free perfKavon Farvardin2018-09-301-1/+1
| |
* | Mark T14251 as expected to pass.Kavon Farvardin2018-09-291-2/+1
| |
* | remove extra imported symbolKavon Farvardin2018-09-291-1/+1
| |
* | rewrote patch for T14619 to fix a lingering bug, and make it clearerKavon Farvardin2018-09-292-44/+26
| |
* | fixed issue with bad register sorting, and bad increment while traversingKavon Farvardin2018-09-291-15/+24
| |
* | fix issue in patch for T14251; missed an incrementKavon Farvardin2018-09-281-8/+9
| |
* | proposed patch for T14251Kavon Farvardin2018-09-272-14/+67
| |
* | fix typo in fn attribute nameKavon Farvardin2018-09-271-1/+1
| |
* | fix for #13904: LLVM trashing caller-save global varsKavon Farvardin2018-09-271-38/+2
|/
* Fix for recover with -fexternal-interpreter (#15418)Simon Marlow2018-09-278-22/+81
| | | | | | | | | | | | | | | | | | | | Summary: When using -fexternal-interpreter, recover was not treating a Q compuation that simply registered an error with addErrTc as failing. Test Plan: New unit tests: * T15418 is the repro from in the ticket * TH_recover_warns is a new test to ensure that we're keeping warnings when the body of recover succeeds. Reviewers: bgamari, RyanGlScott, angerman, goldfire, erikd Subscribers: rwbarton, carter GHC Trac Issues: #15418 Differential Revision: https://phabricator.haskell.org/D5185
* users' guide: document -freverse-errorsquasicomputational2018-09-271-0/+10
|
* Fix constant-folding for Integer shiftsSimon Peyton Jones2018-09-263-9/+44
| | | | | | | | | | | | | | | In this patch commit 869f69fd4a78371c221e6d9abd69a71440a4679a Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Wed Dec 11 18:19:34 2013 +0000 Guarding against silly shifts we deal with silly shifts like (Sll 1 9223372036854775807). But I only dealt with primops that Int# and Word#. Alas, the same problem affects shifts of Integer, as Trac #15673 showed. Fortunately, the problem is easy to fix.
* Fix Lint of unsaturated type familiesSimon Peyton Jones2018-09-263-24/+40
| | | | | | | | | | GHC allows types to have unsaturated type synonyms and type families, provided they /are/ saturated if you expand all type synonyms. TcValidity carefully checked this; see check_syn_tc_app. But Lint only did half the job, adn that led to Trac #15664. This patch just teaches Core Lint to be as clever as TcValidity.
* Expand the Note on let-bound skolemsSimon Peyton Jones2018-09-261-0/+25
|
* Add regression test for #15666Ryan Scott2018-09-252-0/+30
| | | | | | Commit 59f38587d44efd00b10a6d98f6a7a1b22e87f13a ended up fixing #15666. Let's add a regression test to ensure that it stays fixed.
* Don't show constraint tuples in errors (#14907)Alec Theriault2018-09-258-5/+59
| | | | | | | | | | | | | | | | | | | | | Summary: This means that 'GHC.Classes.(%,%)' is no longer mentioned in error messages for things like class (a,b,c) -- outside of 'GHC.Classes' class (a,Bool) Test Plan: make TEST=T14907a && make TEST=T14907b Reviewers: RyanGlScott, bgamari Reviewed By: RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #14907 Differential Revision: https://phabricator.haskell.org/D5172
* aclocal.m4: fix shell comment syntax: '#', not '$'Sergei Trofimovich2018-09-251-1/+1
| | | | | | | | | | | | Summary: Reported-by: Evan Laforge Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Reviewers: bgamari Subscribers: rwbarton, erikd, carter Differential Revision: https://phabricator.haskell.org/D5171
* Fix a MSG_BLACKHOLE sanity check, add some commentsÖmer Sinan Ağacan2018-09-242-3/+12
| | | | | | | | | | | | Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15508 Differential Revision: https://phabricator.haskell.org/D5178
* Add a recursivity check in nonVoidRyan Scott2018-09-234-53/+174
| | | | | | | | | | | | | | | | | | | | | | | Summary: Previously `nonVoid` outright refused to call itself recursively to avoid the risk of hitting infinite loops when checking recurisve types. But this is too conservative—we //can// call `nonVoid` recursively as long as we incorporate a way to detect the presence of recursive types, and bail out if we do detect one. Happily, such a mechanism already exists in the form of `checkRecTc`, so let's use it. Test Plan: make test TEST=T15584 Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15584 Differential Revision: https://phabricator.haskell.org/D5116
* Fix get getIdFromTrivialExprSimon Peyton Jones2018-09-235-8/+53
| | | | | | | | | | | | | This bug, discovered by Trac #15325, has been lurking since commit 1c9fd3f1c5522372fcaf250c805b959e8090a62c Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Thu Dec 3 12:57:54 2015 +0000 Case-of-empty-alts is trivial (Trac #11155) I'd forgotttnen to modify getIdFromTrivialExpr when I modified exprIsTrivial. Easy to fix, though.
* Comments onlySimon Peyton Jones2018-09-231-1/+1
|
* Don't look up unnecessary return in LastStmtSimon Peyton Jones2018-09-235-22/+49
| | | | | | This fixes Trac #15607. The general pattern is well established (e.g. see the guard_op binding in rnStmt of BodyStme), but we weren't using it for LastStmt.
* Buglet in reporting out of scope errors in rulesSimon Peyton Jones2018-09-236-12/+31
| | | | | | | | Most out of scope errors get reported by the type checker these days, but not all. Example, the function on the LHS of a RULE. Trace #15659 pointed out that this less-heavily-used code path produce a "wacky" error message. Indeed so. Easily fixed.
* testsuite: Bump T9630 expected allocationsBen Gamari2018-09-221-1/+2
| | | | This failed on Darwin.
* testsuite: Bump expected allocations for T12707Ben Gamari2018-09-211-1/+2
|
* testsuite: Bump expected allocations of T9675Ben Gamari2018-09-211-2/+4
| | | | | | This inexplicably started with 989dca6cbd93, which appears to be a bump of the `text` submodule. This is very fishy so I've opened #15663 to ensure we investigate.
* testsuite: Fix readFail048 and readFail032 brokenness declarationsBen Gamari2018-09-211-2/+2
| | | | Whoops.
* testsuite: Mark readFail032 and readFail048 as broken on DarwinBen Gamari2018-09-211-2/+4
| | | | It looks like Clang's CPP implementation has an off-by-one error here.
* testsuite: Don't force run of llvm ways in T14251Ben Gamari2018-09-211-2/+1
| | | | This breaks if LLVM is not available.
* Remove redundant slop zeroingÖmer Sinan Ağacan2018-09-211-6/+0
| | | | OVERWRITE_INFO already does zero slopping by calling OVERWRITING_CLOSURE
* Fix slop zeroing for AP_STACK eager blackholes in debug buildÖmer Sinan Ağacan2018-09-213-29/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As #15571 reports, eager blackholing breaks sanity checks as we can't zero the payload when eagerly blackholing (because we'll be using the payload after blackholing), but by the time we blackhole a previously eagerly blackholed object (in `threadPaused()`) we don't have the correct size information for the object (because the object's type becomes BLACKHOLE when we eagerly blackhole it) so can't properly zero the slop. This problem can be solved for AP_STACK eager blackholing (which unlike eager blackholing in general, is not optional) by zeroing the payload after entering the stack. This patch implements this idea. Fixes #15571. Test Plan: Previously concprog001 when compiled and run with sanity checks ghc-stage2 Mult.hs -debug -rtsopts ./Mult +RTS -DS was failing with Mult: internal error: checkClosure: stack frame (GHC version 8.7.20180821 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug thic patch fixes this panic. The test still panics, but it runs for a while before panicking (instead of directly panicking as before), and the new problem seems unrelated: Mult: internal error: ASSERTION FAILED: file rts/sm/Sanity.c, line 296 (GHC version 8.7.20180919 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug The new problem will be fixed in another diff. I also tried slow validate (which requires D5164): this does not introduce any new failures. Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15571 Differential Revision: https://phabricator.haskell.org/D5165
* user-guide: Allow build with sphinx < 1.8Ben Gamari2018-09-201-2/+7
| | | | | Apparently the override argument to add_directive_to_domain was added in sphinx 1.8.
* users_guide: fix sphinx error caused by non-explicit overrideZejun Wu2018-09-201-12/+5
| | | | | | | | | | | | | | | | | | | | | Encouter following error when `make`: ``` Extension error: The 'ghc-flag' directive is already registered to domain std ``` as we register `ghc-flag` to `std` in `add_object_type` first and then overtride it in `add_directive_to_domain`. Test Plan: make -C utils/haddock/doc html SPHINX_BUILD=/usr/bin/sphinx-build Reviewers: austin, bgamari, patrickdoc Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5161
* users-guide: Fix build with sphinx 1.8Ben Gamari2018-09-201-2/+10
| | | | | | It seems that both add_object_type and add_directive_to_domain both register a directive. Previously sphinx didn't seem to mind this but as of Sphinx 1.8 it crashes with an exception.
* Revert "adds -latomic to. ghc-prim"Ben Gamari2018-09-206-38/+24
| | | | | | | This commit was never properly justified and relies on the existence of libatomic, which doesn't appear to exist on Darwin. This reverts commit ec9aacf3eb2975fd302609163aaef429962ecd87.
* Add testcase for #14251Ben Gamari2018-09-203-0/+34
|
* users guide: Fix a few issuesFrank Steffahn2018-09-202-6/+9
|
* Remove -Waggregate-return when building RTSÖmer Sinan Ağacan2018-09-201-1/+0
| | | | | | | | | | | This causes slow validate build to fail (in Profiling.c:countTickss), and there's nothing wrong with struct returns. Reviewers: simonmar, bgamari, erikd Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5164
* Use predefined known-key names when possibleChaitanya Koparkar2018-09-191-12/+13
| | | | | | | | | | | | | | | | | | Summary: For certain entities in 'PrelNames', we were creating new 'Name's instead of reusing the ones already defined. Easily fixed. Test Plan: ./validate Reviewers: dfeuer, RyanGlScott, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #13279 Differential Revision: https://phabricator.haskell.org/D5160
* docs: fix example codejohn2018-09-191-2/+2
| | | | PR: https://github.com/ghc/ghc/pull/197/
* Don't shortcut SRTs for static functions (#15544)Simon Marlow2018-09-181-22/+130
| | | | | | | | | | | | | | | | | | | | Shortcutting the SRT for a static function can lead to resurrecting a static object at runtime, which violates assumptions in the GC. See comments for details. Test Plan: - manual testing (in progress) - validate Reviewers: osa1, bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15544 Differential Revision: https://phabricator.haskell.org/D5145
* Bump deepseq submoduleBen Gamari2018-09-181-0/+0
| | | | (cherry picked from commit c4209ba8a448b501a11d66640d280fe1e194f847)
* Bump text submoduleBen Gamari2018-09-181-0/+0
| | | | (cherry picked from commit a512f1e32bd4d6079559e3172522591863321fe7)
* Bump stm submoduleBen Gamari2018-09-181-0/+0
| | | | (cherry picked from commit f458bca3a9667af95b8782747eab5b0e70cba4b4)
* Invert FP conditions to eliminate the explicit NaN check.klebinger.andreas@gmx.at2018-09-185-22/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Optimisation: we don't have to test the parity flag if we know the test has already excluded the unordered case: eg > and >= test for a zero carry flag, which can only occur for ordered operands. By reversing comparisons we can avoid testing the parity for < and <= as well. This works since: * If any of the arguments is an NaN CF gets set. Resulting in a false result. * Since this allows us to rule out NaN we can exchange the arguments and invert the direction of the arrows. Test Plan: ci/nofib Reviewers: carter, bgamari, alpmestan Reviewed By: alpmestan Subscribers: alpmestan, simonpj, jmct, rwbarton, thomie GHC Trac Issues: #15196 Differential Revision: https://phabricator.haskell.org/D4990