summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* base: Rework System.CPUTimeBen Gamari2016-03-208-121/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This started when I noticed that `getCPUTime` only provides 1 millisecond resolution on Linux. Unfortunately the previous implementation was quite unmaintainable, so this ended up being a bit more involved than I expected. Here we do several things, * Split up `System.CPUTime` * Add support for `clock_gettime`, allowing for significantly more precise timing information when available * Fix System.CPUTime resolution for Windows. While it's hard to get reliable numbers, the consensus is that Windows only provides 16 millisecond resolution in GetProcessTimes (see Python PEP 0418 [1]) * Eliminate terrible hack wherein we would cast between `CTime` and `Integer` through `Double` [1] https://www.python.org/dev/peps/pep-0418/#id59 Test Plan: Validate on various platforms Reviewers: austin, hvr, erikd Reviewed By: erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2001
* Add test for incompatible flags (issue #11580)Kai Harries2016-03-203-0/+11
| | | | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2013 GHC Trac Issues: #11580
* DsExpr: Don't build/foldr huge listsBen Gamari2016-03-202-2/+30
| | | | | | | | | | | | | | | | | Desugaring long lists with build trades large static data for large code, which is likely a poor trade-off. See #11707. Test Plan: Validate, nofib Reviewers: simonpj, austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2007 GHC Trac Issues: #11707
* prof: Fix heap census for large ARR_WORDS (#11627)Jason Eisenberg2016-03-205-0/+71
| | | | | | | | | | | | | | | | | The heap census now handles large ARR_WORDS objects which have been shrunk by shrinkMutableByteArray# or resizeMutableByteArray#. Test Plan: ./validate && make test WAY=profasm Reviewers: hvr, bgamari, austin, thomie Reviewed By: thomie Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2005 GHC Trac Issues: #11627
* Dwarf: Add support for labels in unwind expressionsBen Gamari2016-03-203-1/+6
| | | | | | | | | | | | Test Plan: Look at DWARF output. Reviewers: scpmw, austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1734
* Fix T9646Ben Gamari2016-03-201-1/+1
| | | | For #9646.
* Fix duplicate T11334 testBen Gamari2016-03-203-1/+1
|
* Revert "Add test for #11473"Ben Gamari2016-03-202-21/+0
| | | | | | This reverts commit 89bdac7635e6ed08927d760aa885d3e7ef3edb81 as this test is duplicated with dependent/should_fail/T11473, added by aade111248dce0834ed83dc4f18c234967b3202.
* Ensure T11702 always runs with optasmBen Gamari2016-03-201-1/+1
|
* Mark GHC.Real.even and odd as INLINEABLEBen Gamari2016-03-201-4/+2
| | | | | | | | | | | | | | | | | | Previously they were merely specialised at Int and Integer. It seems to me that these are cheap enough to be worth inlining. See #11701 for motivation. Test Plan: Validate Reviewers: austin, hvr, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1997 GHC Trac Issues: #11701
* PrelRules: Fix constant folding for WordRemOpBen Gamari2016-03-202-2/+7
| | | | | | | | | | | | | | Test Plan: Validate with testcase in D2002 Reviewers: austin, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2004 GHC Trac Issues: #11702
* Add test for #9646Erik de Castro Lopo2016-03-2010-0/+447
| | | | | | | | | | Test Plan: Test that it passes git HEAD and fails with GHC 7.8. Reviewers: bgamari, hvr, austin, goldfire, thomie Differential Revision: https://phabricator.haskell.org/D2009 GHC Trac Issues: #9646
* Fix #11512 by getting visibility right for methodsRichard Eisenberg2016-03-175-8/+32
| | | | Test case: typecheck/should_compile/T11512
* Fix #11716.Richard Eisenberg2016-03-178-12/+723
| | | | | | | | | | | There were several smallish bugs here: - We had too small an InScopeSet when rejigging GADT return types. - When adding the extra_tvs with a datatype kind signature, we were sometimes changing Uniques of an explicitly bound kind var. - Using coercionKind in the flattener got the wrong visibility for a binder. Now we just zonk to get what we need. Test case: dependent/should_compile/RaeJobTalk
* typechecker: fix trac issue #11708Csongor Kiss2016-03-171-2/+5
| | | | | | | | | | | | | | Summary: Fixes T11708 Reviewers: austin, bgamari, goldfire, simonpj Reviewed By: goldfire, simonpj Subscribers: simonpj, goldfire, thomie Differential Revision: https://phabricator.haskell.org/D2006 GHC Trac Issues: #11708
* Fix #11711.Richard Eisenberg2016-03-176-15/+78
| | | | | | | | There were two bugs here, both simple: we need to filter out covars before calling isMetaTyVar in the solver, and TcPat had a tcSubType the wrong way round. test case: dependent/should_compile/T11711
* DriverPipeline: Fix 'unused arguments' warnings from ClangErik de Castro Lopo2016-03-171-8/+24
| | | | | | | | | | | | | | | | | | | When using Clang as the C compiler, over 100 tests were failing due to Clang reporting that some command line arguments were not being used. These warnings only occur when Clang is compiling assembler files which happens in two places, one of which already conditionally adding `-Qunused-arguments` to the command line when the compiler was Clang. This fixes the other. Test Plan: validate with clang as the C compiler Reviewers: bgamari, hvr, austin, rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1998 GHC Trac Issues: #11684
* Clean up some pretty-printing in errors.Richard Eisenberg2016-03-1519-30/+79
| | | | | | | | | | | | | It turns out that there were some pretty egregious mistakes in the code that suggested -fprint-explicit-kinds, which are fixed. This commit also reorders a bunch of error messages, which I think is an improvement. This also adds the test case for #11471, which is what triggered the cleanup in TcErrors. Now that #11473 is done, there is nothing more outstanding for #11471. test case: dependent/should_fail/T11471
* Fix printing of "kind" vs. "type"Richard Eisenberg2016-03-154-9/+17
| | | | | | | This is as reported in #11471, though it's not the focus of that ticket. test case: polykinds/KindVType
* Fix #11473.Richard Eisenberg2016-03-154-7/+92
| | | | | | | | | | | | | | I've added a check in the zonker for representation polymorphism. I don't like having this be in the zonker, but I don't know where else to put it. It can't go in TcValidity, because a clever enough user could convince the solver to do bogus representation polymorphism even though there's nothing obviously wrong in what they wrote. Note that TcValidity doesn't run over *expressions*, which is where this problem arises. In any case, the check is simple and it works. test case: dependent/should_fail/T11473
* Fix #11357.Richard Eisenberg2016-03-154-11/+33
| | | | | | | | | We were looking at a data instance tycon for visibility info, which is the wrong place to look. Look at the data family tycon instead. Also improved the pretty-printing near there to suppress kind arguments when appropriate.
* Incorporate bgamari's suggestions for #11614.Richard Eisenberg2016-03-152-18/+43
|
* Remove redundant anonymiseTyBinders (#11648)Richard Eisenberg2016-03-152-30/+2
| | | | | This was necessary in an earlier version of the patch for #11648, but not in the final version. I forgot to remove it.
* Testsuite wibbles from previous commits.Richard Eisenberg2016-03-144-3/+7
|
* Allow eager unification with type families.Richard Eisenberg2016-03-1413-138/+40
| | | | | | | | | | | | | | | | | | | | Previously, checkTauTvUpdate, used in the eager unifier (TcUnify) right before writing to a metavar, refused to write a metavar to a type involving type functions. The reason for this was given in a Note, but the Note didn't make all that much sense and even admitted that it was a bit confused. The Note, in turn, referred to another Note, which it was quite sceptical of, as well. The type-family check was slowing down performance, so I tried removing it, running the tests referred to in the Note. The tests all passed without the check. Looking at more test results, I saw several error messages improve without the check, and some cases where GHC looped (T7788, in particular) it now doesn't. So, all in all, quite a win: Two hairy Notes removed, several lines of code removed, better performance, and improved output. [skip ci]
* Fix #11648.Richard Eisenberg2016-03-1425-190/+452
| | | | | | | | | | | | We now check that a CUSK is really a CUSK and issue an error if it isn't. This also involves more solving and zonking in kcHsTyVarBndrs, which was the outright bug reported in #11648. Test cases: polykinds/T11648{,b} This updates the haddock submodule. [skip ci]
* Document TypeInType (#11614)Richard Eisenberg2016-03-143-273/+607
| | | | [skip ci]
* Test case for #11699 in typecheck/should_compileRichard Eisenberg2016-03-142-0/+6
| | | | [skip ci]
* Expand Note [Non-trivial definitional equality]Richard Eisenberg2016-03-141-0/+52
| | | | | | This adapts the text from D1944. [skip ci]
* Refactor visible type application.Richard Eisenberg2016-03-1417-144/+167
| | | | | | | | | | | | | This replaces the old HsType and HsTypeOut constructors with HsAppType and HsAppTypeOut, leading to some simplification. (This refactoring addresses #11329.) This also fixes #11456, which stumbled over HsType (which is not an expression). test case: ghci/scripts/T11456 [skip ci]
* Fix #11401.Richard Eisenberg2016-03-143-24/+50
| | | | | | This commit teaches shortCutReduction about Derived constraints. [skip ci]
* Fix #11334.Richard Eisenberg2016-03-145-4/+69
| | | | | | | | | Now we fail when trying to default non-*-kinded kind variables with -XNoPolyKinds. test case: dependent/should_fail/T11334 [skip ci]
* Fix #11407.Richard Eisenberg2016-03-148-48/+70
| | | | | | | | | | | | | | This removes the `defer_me` check that was in checkTauTvUpdate and uses only a type family check instead. The old defer_me check repeated work done by fast_check in occurCheckExpand. There is also some error message improvement, necessitated by the terrible error message that the test case produced, even when it didn't consume all of memory. test case: dependent/should_fail/T11407 [skip ci]
* Move and expand (slightly) TypeApplications docsRichard Eisenberg2016-03-141-66/+77
| | | | [skip ci]
* Add regression test for #11702Ben Gamari2016-03-143-0/+12
| | | | | | | | | | | | Test Plan: Validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2002 GHC Trac Issues: #11702
* Fix the name of the Word16ElemRep wired-in dataconmniip2016-03-142-2/+2
| | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1999
* users_guide: Break up -fprint-* descriptionBen Gamari2016-03-131-16/+22
| | | | | This makes it a bit easier to find the description corresponding to particular flags.
* LlvmCodeGen: Fix generation of malformed LLVM blocksErik de Castro Lopo2016-03-123-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 673efccb3b uncovered a bug in LLVM code generation that produced LLVM code that the LLVM compiler refused to compile: { clpH: br label %clpH } This may well be a bug in LLVM itself. The solution is to keep the existing entry label and rewrite the function as: { clpH: br label %nPV nPV: br label %nPV } Thanks to Ben Gamari for pointing me in the right direction on this one. Test Plan: Build GHC with BuildFlavour=quick-llvm Reviewers: hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1996 GHC Trac Issues: #11649
* ghci: add message when reusing compiled code #9887Alexander Lukyanov2016-03-123-11/+18
| | | | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1991 GHC Trac Issues: #9887
* Simplify: Make generated names more usefulBen Gamari2016-03-1213-87/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | makeTrivial is responsible for concocting names during simplification. Previously, however, it would make no attempt to generate a name that might be useful to later readers of the resulting Core. Here we add a bit of state to SimplEnv: a finite depth stack of binders within which we are currently simplifying. We then derive generated binders from this context. See #11676. Open questions: * Is there a better way to accomplish this? * Is `maxContextDepth` too large/small? Test Plan: Validate, look at Core. Reviewers: austin, simonpj Reviewed By: simonpj Subscribers: thomie, simonpj Differential Revision: https://phabricator.haskell.org/D1970 GHC Trac Issues: #11676
* rts: fix threadStackUnderflow type in cmmSergei Trofimovich2016-03-113-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stg_stack_underflow_frame had an incorrect call of C function 'threadStackUnderflow': ("ptr" ret_off) = foreign "C" threadStackUnderflow( MyCapability(), CurrentTSO); Which means it's prototype is: void * (*) (W_, void*); While real prototype is: W_ (*) (Capability *cap, StgTSO *tso); The fix is simple. Fix type annotations: (ret_off) = foreign "C" threadStackUnderflow( MyCapability() "ptr", CurrentTSO "ptr"); Noticed when debugged T9045 test failure on m68k target which distincts between pointer and non pointer return types (uses different registers) While at it noticed and fixed return types for 'throwTo' and 'findSpark'. Trac #11395 Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Add -foptimal-applicative-doSimon Marlow2016-03-119-76/+251
| | | | | | | | | | | | | | | | | | | | Summary: The algorithm for ApplicativeDo rearrangement is based on a heuristic that runs in O(n^2). This patch adds the optimal algorithm, which is O(n^3), selected by a flag (-foptimal-applicative-do). It finds better solutions in a small number of cases (about 2% of the cases where ApplicativeDo makes a difference), but it can be very slow for large do expressions. I'm mainly adding it for experimental reasons. ToDo: user guide docs Test Plan: validate Reviewers: simonpj, bgamari, austin, niteria, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1969
* Bump allocations for T6048Ben Gamari2016-03-111-1/+2
| | | | | | | This occassionally fails with allocations a few tenths of a percent above threshold. Sadly there isn't a clear cause; it's likely just the result of gradual creep, further underscoring the need for more regular performance characterization.
* Move getOccFS to NameBen Gamari2016-03-112-11/+10
|
* Handle unset HOME environment variable more gracefullyBen Gamari2016-03-113-8/+17
| | | | | | | | | | | | | | | Test Plan: * Validate * try `env -i ghc` * try `env -i runghc HelloWorld.hs` Reviewers: austin Subscribers: thomie, ezyang Differential Revision: https://phabricator.haskell.org/D1971 GHC Trac Issues: #11678
* Add ghc-flag directory for -XPatternGuardsBen Gamari2016-03-111-5/+9
| | | | | | | | Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1987
* Add MonadUnique instance for LlvmMBen Gamari2016-03-112-9/+16
| | | | | | | | | | Reviewers: erikd, austin Reviewed By: erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1994
* rtx/posix/Itimer.c: Handle return value of `read`Erik de Castro Lopo2016-03-111-1/+2
| | | | | | | | | | | | | | | | | | On Ubuntu libc's `read` function is marked with attribute `warn_unused_result` which was causing build failures on Harbourmaster. Test Plan: validate on Harbourmaster Reviewers: austin, hvr, bgamari Reviewed By: hvr, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1993 GHC Trac Issues: #11697
* Add doc to (<$>) explaining its relationship to ($)Chris Martin2016-03-111-0/+9
| | | | | | | | | | Reviewers: bgamari, hvr, austin Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1989
* Fix readme link to FixingBugs wiki pageChris Martin2016-03-111-1/+1
| | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1988